Skip to content

loop/foundation 2026 06 22 162643 - #343

Merged
bordumb merged 7 commits into
mainfrom
loop/foundation-2026-06-22_162643
Jun 22, 2026
Merged

bordumb merged 7 commits into
mainfrom
loop/foundation-2026-06-22_162643

Conversation

@bordumb

@bordumb bordumb commented Jun 22, 2026

Copy link
Copy Markdown
Contributor
  • fix(auths-keri): guard receipt-couple parsing against malformed CESR
  • fix(auths-keri): fail closed on a malformed CESR primitive in decode_qualified
  • refactor(auths-keri): derive verkey length validation from the shared guard
  • test(auths-keri): fuzz the receipt-couple parser + wire it into CI
  • style: rustfmt the new CESR parse-guard code
  • fix(auths-keri): reject non-ASCII CESR attachments before slicing
  • test(auths-keri): fuzz the attachment parsers + wire into CI

bordumb added 7 commits June 22, 2026 16:58
parse_nontrans_receipt_couples handed the raw attachment stream straight
to the CESR verkey/signature decoder, which slices the input by a length
derived from the derivation code and panics out of bounds on a truncated
or variable-length code. Add a shared take_matter_qb64 helper that reads
the code, validates the input is ASCII and holds the full primitive, and
returns its exact qb64 width before the decoder runs, so a malformed
couple fails closed with a typed error. Adds a regression test.

Auths-Id: did:keri:EB5cPHY0t-ejNC_rUzPS1dclTvd6kG-R9mQzjozCuGgd
Auths-Device: did:keri:EB5cPHY0t-ejNC_rUzPS1dclTvd6kG-R9mQzjozCuGgd
Auths-Anchor-Seq: 1
…qualified

decode_qualified passed untrusted input straight to the verkey/digest
decoder (out-of-bounds panic on a short variable-length code) and, on the
miss path, sliced the error message at a fixed byte offset (panic when it
split a multi-byte char). Take the exact primitive width via the shared
guard first, so both the decode and the error message operate on a
validated, bounded, ASCII primitive. Adds a regression test.

Auths-Id: did:keri:EB5cPHY0t-ejNC_rUzPS1dclTvd6kG-R9mQzjozCuGgd
Auths-Device: did:keri:EB5cPHY0t-ejNC_rUzPS1dclTvd6kG-R9mQzjozCuGgd
Auths-Anchor-Seq: 1
… guard

KeriPublicKey::parse carried its own copy of the verkey qb64 lengths
(44/48) and prefix checks. Route it through the shared take_matter_qb64
helper so those sizes live in one place, and reject trailing bytes after
the primitive. No behavior change — the existing parse battery is the
regression.

Auths-Id: did:keri:EB5cPHY0t-ejNC_rUzPS1dclTvd6kG-R9mQzjozCuGgd
Auths-Device: did:keri:EB5cPHY0t-ejNC_rUzPS1dclTvd6kG-R9mQzjozCuGgd
Auths-Anchor-Seq: 1
Adds a cargo-fuzz target over parse_nontrans_receipt_couples (invariant:
never panic on attacker bytes) and adds it to the CI fuzz-smoke matrix.
The parser now prevents the out-of-bounds decoder panic rather than
relying on unwinding, so the target builds and runs clean.

Auths-Id: did:keri:EB5cPHY0t-ejNC_rUzPS1dclTvd6kG-R9mQzjozCuGgd
Auths-Device: did:keri:EB5cPHY0t-ejNC_rUzPS1dclTvd6kG-R9mQzjozCuGgd
Auths-Anchor-Seq: 1
Auths-Id: did:keri:EB5cPHY0t-ejNC_rUzPS1dclTvd6kG-R9mQzjozCuGgd
Auths-Device: did:keri:EB5cPHY0t-ejNC_rUzPS1dclTvd6kG-R9mQzjozCuGgd
Auths-Anchor-Seq: 1
The -A signature and -G source-seal attachment readers sliced the qb64
stream at byte offsets derived from each primitive's code, checking only
the byte length — so a multi-byte UTF-8 char straddling a slice boundary
panicked. These parsers run over a presented bundle's attachments in the
offline verifier before any signature is checked. CESR qb64 is ASCII, so
reject non-ASCII at the parser boundary; the byte-offset slices are then
always on char boundaries. Adds a regression test.

Auths-Id: did:keri:EB5cPHY0t-ejNC_rUzPS1dclTvd6kG-R9mQzjozCuGgd
Auths-Device: did:keri:EB5cPHY0t-ejNC_rUzPS1dclTvd6kG-R9mQzjozCuGgd
Auths-Anchor-Seq: 1
Adds a cargo-fuzz target over parse_attachment / parse_delegated_attachment
(the -A/-G readers the offline verifier runs over presented attachments;
invariant: never panic on attacker bytes) and adds it to the CI fuzz-smoke
matrix.

Auths-Id: did:keri:EB5cPHY0t-ejNC_rUzPS1dclTvd6kG-R9mQzjozCuGgd
Auths-Device: did:keri:EB5cPHY0t-ejNC_rUzPS1dclTvd6kG-R9mQzjozCuGgd
Auths-Anchor-Seq: 1
@bordumb
bordumb merged commit ad8b5e1 into main Jun 22, 2026
1 of 2 checks passed
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
auths Building Building Preview, Comment Jun 22, 2026 6:12pm

@github-actions

Copy link
Copy Markdown

Auths Commit Verification

Commit Status Details
892d6111 ❌ Failed No signature found
e58fd238 ❌ Failed No signature found
c3b498ab ❌ Failed No signature found
c75c8136 ❌ Failed No signature found
1f9d882c ❌ Failed No signature found
29690e7f ❌ Failed No signature found
108610e0 ❌ Failed No signature found

Result: ❌ 0/7 commits verified


How to fix

Commit 892d6111 has no Auths signature (no Auths-Id/Auths-Device trailer).

1. Install auths

macOS: brew install auths
Linux: Download from releases

2. One-time setup (creates your identity and configures Git)

auths init

3. Sign this branch and push

auths sign origin/main..HEAD
git push --force-with-lease

For CI to verify the signer, commit an identity bundle:

auths id export-bundle --alias main --output .auths/ci-bundle.json --max-age-secs 31536000

Quickstart →

This branch was successfully deployed

1 active deployment
Preview — 892d6111 Deployed Jun 22, 2026 by vercel[bot]
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