The four-byte SSH fingerprints (and tagged recipient tags) are hints to
avoid unnecessary password prompts or hardware interactions. Treat an
authenticated unwrap failure after a hint match as a false positive and
continue looking for a matching stanza.
Without this, a colliding recipient stanza that appears before the
valid stanza makes decryption fail even though the file is correctly
encrypted to the identity. Any password prompt or hardware interaction
has already happened by then.
Reported by Claude, Anthropic's AI assistant, and triaged by the
Anthropic security team in collaboration with Anthropic Research,
as ANT-2026-S9C25K8W.
The application has no way to limit the header separately from the body,
so we have to enforce some sanity limits to prevent excessive memory use.
To relax the limits somewhat, make the parsing more efficient.
New limits are:
* 2 MiB total header size (enough for > 1024 PQ recipients)
* 1024 recipient stanzas
* 128 arguments per stanza
Fixes#701
The trailing data check after a full-length final chunk ignored the
byte count, so a reader returning (1, io.EOF), as io.Reader permits,
would have its trailing data silently accepted, and a transient
(0, nil) return would be misreported as trailing data. io.ReadFull
handles both.
trackReader.Read panicked if called again after a read returned io.EOF,
which can happen with readers that do not return EOF consistently, such
as a terminal after Ctrl-D. Latch the EOF instead, per the io.Reader
contract, so count stays consistent with the file size.
Fixes#719
Co-authored-by: Filippo Valsorda <hi@filippo.io>
Replace two hand-rolled slicesEqual helpers with slices.Equal from
the standard library, which is already imported in age.go.
(age.go:211-221, plugin/plugin.go:666-676)
Fix godoc link typo [Indentity] -> [Identity].
(plugin/plugin.go:3)
Fix comment typo "not MinPayload" -> "so MinPayload".
(internal/inspect/inspect.go:25)
Co-authored-by: Claude <noreply@anthropic.com>
Remove the go-version-file test target, because it will just use the
toolchain line. It's a bit unfortunate we lose coverage of a go.mod
version that's older than oldstable, but that should not happen and it'd
not be a supported Go version anyway.