fix: audit parser hardness — bounded sections, x509, DSSE fuzz#98
Merged
Conversation
… mime-type Closes 4 findings from the 2026-04-30 audit: H-1 — bound WASM SectionsIterator at MAX_SECTIONS=4096 H-2 — bound x509 chain depth at MAX_CHAIN_DEPTH=8 H-6 — PAYLOAD_TYPE_SLSA → application/vnd.slsa.provenance+json H-7 — add fuzz_dsse_envelope target with round-trip oracle Fixes: H-1, H-2, H-6, H-7 Verifies: CR-8 (bounded resource consumption) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
4 tasks
avrabe
added a commit
that referenced
this pull request
Apr 30, 2026
Bumps Cargo.toml, MODULE.bazel, src/cli/BUILD.bazel, and Cargo.lock to 0.8.1. Adds CHANGELOG.md (new file, repo did not have one) with the full release notes. This release closes 26 of 33 findings from the 2026-04-30 14-perspective audit. Specific fix-PRs are #96 (STPA-Sec / docs), #97 (hygiene), #98 (parser hardness), #99 (formal-verif honesty + CI), #100 (keyless / OIDC hardening). Two findings (cert-pinning enforcement, no_std verifier) are deferred to issue #95 and issue #79 respectively. Note on H-8 (version drift): MODULE.bazel and src/cli/BUILD.bazel were at 0.2.7 on main; this commit takes them straight to 0.8.1. PR #97 also bumps these to 0.8.0 as part of its H-8 fix; whichever PR merges last has a trivial conflict that resolves to 0.8.1. Trace: skip Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
avrabe
added a commit
that referenced
this pull request
May 1, 2026
Bumps Cargo.toml, MODULE.bazel, src/cli/BUILD.bazel, and Cargo.lock to 0.8.1. Adds CHANGELOG.md (new file, repo did not have one) with the full release notes. This release closes 26 of 33 findings from the 2026-04-30 14-perspective audit. Specific fix-PRs are #96 (STPA-Sec / docs), #97 (hygiene), #98 (parser hardness), #99 (formal-verif honesty + CI), #100 (keyless / OIDC hardening). Two findings (cert-pinning enforcement, no_std verifier) are deferred to issue #95 and issue #79 respectively. Note on H-8 (version drift): MODULE.bazel and src/cli/BUILD.bazel were at 0.2.7 on main; this commit takes them straight to 0.8.1. PR #97 also bumps these to 0.8.0 as part of its H-8 fix; whichever PR merges last has a trivial conflict that resolves to 0.8.1. Trace: skip Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
avrabe
added a commit
that referenced
this pull request
May 1, 2026
Bumps Cargo.toml, MODULE.bazel, src/cli/BUILD.bazel, and Cargo.lock to 0.8.1. Adds CHANGELOG.md (new file, repo did not have one) with the full release notes. This release closes 26 of 33 findings from the 2026-04-30 14-perspective audit. Specific fix-PRs are #96 (STPA-Sec / docs), #97 (hygiene), #98 (parser hardness), #99 (formal-verif honesty + CI), #100 (keyless / OIDC hardening). Two findings (cert-pinning enforcement, no_std verifier) are deferred to issue #95 and issue #79 respectively. Note on H-8 (version drift): MODULE.bazel and src/cli/BUILD.bazel were at 0.2.7 on main; this commit takes them straight to 0.8.1. PR #97 also bumps these to 0.8.0 as part of its H-8 fix; whichever PR merges last has a trivial conflict that resolves to 0.8.1. Trace: skip Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
avrabe
added a commit
that referenced
this pull request
May 11, 2026
The target referenced four APIs that no longer exist on `wsc::signature::keys`: - `PublicKey::from_openssh` - `PublicKey::from_any` - `PublicKeySet::from_openssh` - `SecretKey::from_openssh` OpenSSH ingestion and the polymorphic `from_any` auto-detect entry point were removed from the public-key surface; only raw-bytes, PEM, and DER parsing remain. Audit PR #98 (parser hardness) flagged the build failure as a pre-existing leftover, out of scope for that change. This commit rewrites the target against the current surface only: - PublicKey::{from_bytes,from_pem,from_der} + round-trip oracles - SecretKey::{from_bytes,from_pem,from_der} + round-trip (handling the `Zeroizing<Vec<u8>>` / `Zeroizing<String>` returns of `SecretKey::to_bytes` / `to_pem` via deref coercion) - determinism check on `PublicKey::attach_default_key_id` A module-level comment documents the dropped APIs so the next reviewer does not re-introduce them. No core source touched; only the fuzz target was changed. Verified: - `cd fuzz && cargo build --bin fuzz_public_key` -> clean - `cd fuzz && cargo build --bins` -> clean - `cargo build --workspace --release` -> clean Trace: skip Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 11, 2026
avrabe
added a commit
that referenced
this pull request
May 11, 2026
Patch release bundling four merged PRs: #107 — cargo-deny CI step hardening (closes #103) #108 — discharge lemma_le64_injective Verus admit (audit C-1 partial) #109 — repair fuzz_public_key target (audit follow-up from #98) #110 — clear 3 RUSTSEC advisories via dep bumps (fixes #102) Companion work on 0.8.2+next: #111 — criterion benches for signature verification (#89) #112 — lift Kani wasm_module mask; document merkle + format See CHANGELOG.md for the full release notes. Trace: skip Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
avrabe
added a commit
that referenced
this pull request
May 12, 2026
Adds criterion-driven benchmarks for the four signature-verification hot paths: Ed25519 verify, DSSE envelope parse+verify, Merkle tree validation (parameterised by leaf count), and cert-chain validation (parameterised by chain length, matching MAX_CHAIN_DEPTH=8 from audit PR #98). SLH-DSA bench deferred to issue #46. CI integration deferred to a follow-up PR — this commit only lands the bench harness so baselines can be captured. Traceability comments at the top of the bench file link each group to its CR-* artifact. Implements: #89 Verifies: CR-1, CR-3, CR-7, CR-8 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
avrabe
added a commit
that referenced
this pull request
May 12, 2026
…111) Adds criterion-driven benchmarks for the four signature-verification hot paths: Ed25519 verify, DSSE envelope parse+verify, Merkle tree validation (parameterised by leaf count), and cert-chain validation (parameterised by chain length, matching MAX_CHAIN_DEPTH=8 from audit PR #98). SLH-DSA bench deferred to issue #46. CI integration deferred to a follow-up PR — this commit only lands the bench harness so baselines can be captured. Traceability comments at the top of the bench file link each group to its CR-* artifact. Implements: #89 Verifies: CR-1, CR-3, CR-7, CR-8 Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Closes 4 parser-hardness findings from the 2026-04-30 audit.
src/lib/src/wasm_module/mod.rsSectionsIteratornow caps total emitted sections atMAX_SECTIONS=4096and returnsWSError::TooManySectionswhen exceeded.src/lib/src/signature/keyless/format.rsKeylessSignature::verify_cert_chainrejects chains deeper thanMAX_CHAIN_DEPTH=8before invokingx509_parser/ WebPKI; newWSError::ChainTooDeepvariant.src/attestation/src/dsse.rs:29PAYLOAD_TYPE_SLSAcorrected fromapplication/vnd.in-toto+json(collision withPAYLOAD_TYPE_INTOTO) toapplication/vnd.slsa.provenance+json.fuzz/fuzz_targets/fuzz_dsse_envelope.rs(new),fuzz/Cargo.tomlwsc::dsse::DsseEnvelopeJSON parsing. Oracle is parse + serialize + re-parse equality, not just no-panic.Constant choices
MAX_SECTIONS = 4096— generous vs. the ~100-section legitimate ceiling but bounds adversarial inputs declaring millions of empty sections. No prior ELF constant to align with.MAX_CHAIN_DEPTH = 8— industry-standard ceiling. Real Fulcio chains are 2–3 deep; commercial CAs ship at most 4–5; 8 leaves comfortable headroom while rejecting heap-exhaustion-class adversarial chains.Tests added
wasm_module::tests::test_sections_iterator_max_sections_cap— feedsMAX_SECTIONS+1empty Type sections, asserts the iterator yields exactlyMAX_SECTIONSthen errors withTooManySections.signature::keyless::format::tests::test_verify_cert_chain_rejects_too_deep— 100-cert synthetic chain rejected withChainTooDeep(MAX_CHAIN_DEPTH).signature::keyless::format::tests::test_verify_cert_chain_at_max_depth_proceeds_to_parser— chain at exactlyMAX_CHAIN_DEPTHis not depth-rejected (proves the bound is atMAX_CHAIN_DEPTH+1, not below).Test plan
cargo build --workspace --releasepasses.cargo test --workspacepasses (732 lib tests + downstream).test_sections_iterator_max_sections_cap,test_verify_cert_chain_rejects_too_deep,test_verify_cert_chain_at_max_depth_proceeds_to_parser).cd fuzz && cargo build --bin fuzz_dsse_envelopecompiles and links the new target.Out of scope
Fixes: H-1, H-2, H-6, H-7
Verifies: CR-8 (bounded resource consumption)
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com