Skip to content

fix(auth): use-after-free bug when trying to find gsheet secret#105

Merged
mharrisb1 merged 2 commits into
evidence-dev:mainfrom
mharrisb1:fix/macos-secret-dynamic-cast
Feb 21, 2026
Merged

fix(auth): use-after-free bug when trying to find gsheet secret#105
mharrisb1 merged 2 commits into
evidence-dev:mainfrom
mharrisb1:fix/macos-secret-dynamic-cast

Conversation

@mharrisb1

Copy link
Copy Markdown
Collaborator

Overview

Fixes a use-after-free bug in GetGSheetSecret that caused read_gsheet and COPY TO to fail on macOS with 'token' not found in gsheet secret.

GetGSheetSecret returned a raw KeyValueSecret * pointing into a SecretMatch that was destroyed when the function returned. The caller then read from freed memory. On Linux the allocator happened to leave the memory intact, masking the bug. On macOS the allocator reclaims the memory sooner, causing secret_map to appear empty.

The fix inlines the secret access into CreateAuthFromSecret so the SecretMatch stays alive on the stack for the duration of use. GetGSheetSecret is removed.

@mharrisb1
mharrisb1 merged commit a209d8a into evidence-dev:main Feb 21, 2026
12 checks passed
@mharrisb1
mharrisb1 deleted the fix/macos-secret-dynamic-cast branch February 21, 2026 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant