Repository navigation
fix(age): prevent agent panic when decrypting plugin identities - #3633
Merged
dominikschulz merged 1 commit intoOct 1, 2026
Merged
Conversation
Signed-off-by: エモン <zhangchao050530@gmail.com>
dominikschulz
approved these changes
Oct 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #3620, including my [macOS Secure Enclave reproduction](#3620 (comment)).
The age agent constructs plugin identities with a nil
ClientUI. In age v1.3.2,ClientUI.readStanzadereferences this pointer, causing a panic during plugin decryption.This change supplies an empty, non-nil
plugin.ClientUI. Plugins can decrypt normally without client UI callbacks. Unavailable UI requests receive the protocol'sfailresponse, allowing plugins to return an ordinary error instead of crashing the agent.Regression coverage
Add a hardware-independent test plugin that exercises the actual identity-v1 subprocess protocol through
Agent.decrypt, covering:Removing the fix reproduces the original nil-pointer panic. No panic recovery or dependency changes are introduced.
Validation
go vet, license-lint, golangci-lint, and keep-sorted pass.govulncheck ./...reports no called vulnerabilities.make testandmake test-integrationwere run, but Unix socket restrictions in the cloud environment prevent agent sockets and gpg-agent from starting. The affected age unit tests also fail on unmodified master.make codequalitywas run but is blocked by capslock: its source-processing dependency is incompatible with Go 1.27; under Go 1.26.1, its capability comparison produces the same failure as unmodified master.I also tested the patched build locally on macOS with age-plugin-se 0.2.1, retaining only the SE identity. Touch ID authorization and secret decryption succeeded, the command exited with status 0, and the agent remained running. Debug logs showed no agent error or fallback to direct decryption.
Scope
This fixes the plugin identity panic. It does not add background terminal UI forwarding, cache Touch ID authorization or decrypted file keys, or recover stale sockets. Touch ID may still be required for each decryption.
Hardware validation with age-plugin-tpm remains outstanding.