Skip to content

fix(pass): return a copy from PassValue.Marshal - #693

Merged
Benehiko merged 1 commit into
mainfrom
fix/passvalue-marshal-copy
Oct 13, 2026
Merged

Benehiko merged 1 commit into
mainfrom
fix/passvalue-marshal-copy

Conversation

@Benehiko

@Benehiko Benehiko commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Store backends (macOS and Linux keychain, Windows credential manager, posixage) zero the bytes returned by Marshal once they have written them. PassValue.Marshal returned its own backing buffer, so saving a PassValue wiped the caller's secret value.

Marshal now returns a copy, matching Unmarshal, which already copies. Adds a test that clears the result of Marshal and checks the PassValue still holds its value.

Found while reviewing #687.

AI disclosure: the code, test and this description were written by Claude (Anthropic) through the alki coding agent, at my direction.

Store backends zero the bytes Marshal returns once they have written them. PassValue returned its own backing buffer, so saving a PassValue wiped the caller's secret.

Signed-off-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>
@Benehiko
Benehiko requested a review from joe0BAB October 13, 2026 13:08
@Benehiko
Benehiko enabled auto-merge October 13, 2026 13:08

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

@Benehiko
Benehiko merged commit 4e761c0 into main Oct 13, 2026
24 checks passed
@Benehiko
Benehiko deleted the fix/passvalue-marshal-copy branch October 13, 2026 13:30
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.

3 participants