fix: remove ambiguous encodings from hash inputs - #7492
Open
jmecom wants to merge 4 commits into
Open
Conversation
🔐 Codex Security Review
|
jmecom
marked this pull request as ready for review
September 8, 2026 19:27
Signed-off-by: Jordan Mecom <jm@squareup.com>
Signed-off-by: Jordan Mecom <jm@squareup.com>
Signed-off-by: Jordan Mecom <jm@squareup.com>
Signed-off-by: Jordan Mecom <jm@squareup.com>
jmecom
force-pushed
the
jm/fix-hash-input-encodings
branch
from
September 8, 2026 19:29
daa6f43 to
dcd3148
Compare
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.
problem
Buzz has several instances where the encoding of hash inputs is non-injective. This means that two semantically distinct inputs can produce the same hash. The core issue is lack of proper separation. For example, consider a protocol which hashes a first name and last name:
hash("Jane"||"Doe")is equivalent tohash("Jan"||"eDoe"). Although the names are distinct, the input to the hash function is identical.The correct approach is to, for example, use TLV-encoding or another unambiguous encoding. Each input is transformed:
fix
Replace ambiguous hash inputs in four places, with one fix per commit:
Apply audit migration 0045 and upgrade audit/Git verifiers before deploying new writers. Existing audit hashes are retained; mixed-version chains verify. OAuth users must sign in once after upgrading. Legacy audit and Git checks cannot establish the original interpretation of arbitrary inputs hashed before the upgrade; the compatibility assumptions are documented.
Checked with the audit, Git signing, agent, and database suites (903 passed), including real Git commit/tag signing, OAuth integration tests, collision regressions, and PostgreSQL test discovery. Workspace formatting and Clippy pass.
Full repository checks are still running. Live PostgreSQL/Redis tests are blocked by Docker Desktop's organization sign-in requirement.