[bug]: Rust signing example signs the whole Signature-Agent member, so the TypeScript verifier rejects it
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 54/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- rust, typescript
- Ambito
- cryptography, security
Direzione di ricerca
Start with examples/rust/signing.rs and examples/rust/verify.rs, then read the referenced RFC 9421 Section 2.1.2 and the SignedMessage::lookup_component and UnsignedMessage::fetch_components_to_cover documentation. Run cargo run -p rust-examples --bin signing and verify its output with the TypeScript verifier. Done when the Rust examples use the keyed member value consistently and the signing output verifies.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
examples/rust/signing.rs covers "signature-agent";key="sig1" but supplies the whole member, sig1="https://myexample.com/.well-known/http-message-signatures-directory", as the component value. RFC 9421 Section 2.1.2 defines the value of a key component as the member's value alone, without the key. So the signature base the example builds differs from the one a conforming verifier builds, and the TypeScript verifier in this repo rejects the example's output.
Issue type
- A library does not implement the Web Bot Auth specification faithfully
- A provided example does not work
- A vulnerability is present
Affected component
- An example under
examples/:examples/rust/signing.rs,examples/rust/verify.rs
Environment
- Crate/package version:
mainat01c0d10(v0.8.0) - Toolchain: rustc 1.99.1, Node.js 22.23.3
- Runtime: native
- Link to affected code or repository:
examples/rust/signing.rs
Reproduction
cargo run -p rust-examples --bin signingand take the printedSignature-InputandSignature.- Pass them, with
Signature-Agent: sig1="https://myexample.com/.well-known/http-message-signatures-directory",@authorityexample.comand the example's Ed25519 public key, toverify()frompackages/web-bot-auth.
Expected behaviour: verifies. Section 5.2.1 of the protocol draft requires signing the Signature-Agent member keyed to the label, and RFC 9421 Section 2.1.2 puts the member value "https://myexample.com/.well-known/http-message-signatures-directory" in the signature base.
Actual behaviour: VerificationFailed: Signature verification failed.
examples/rust/verify.rs uses the same whole-member convention (agent1="https://myexample.com") for its lookup, so it accepts signatures built this way.
Test output
cargo +stable test --workspace --all-features --all-targets passes at 01c0d10 (56 passed); the examples are not covered by tests.
Proposed fix
Examples and docs only, no library change: sign the member value in signing.rs, return the member value for the keyed component in verify.rs (with a signature regenerated to match), and note the Section 2.1.2 rule on SignedMessage::lookup_component and UnsignedMessage::fetch_components_to_cover. With that change, the signing example's output passes the TypeScript verifier. I have it ready and can open a PR if you want it.
Checklist
- I have read CONTRIBUTING.md and confirmed this is an accepted issue form.
- This is not an interop issue. (The example deviates from RFC 9421 Section 2.1.2; the TypeScript result is the evidence, not the claim.)
- Lingua principale
- Rust
- Stelle
- 182
- Fork
- 49
- Merge medio
- 1g 20m
- PR unite (30g)
- 19
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cloudflare/web-bot-auth
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
cloudflare/web-bot-auth#203 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
cloudflare/web-bot-auth#172 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 1-2 giorni Idoneità per principianti 56/100
cloudflare/web-bot-auth#202 ·
I maintainer di solito rispondono entro 1 giorno
-
Demo verifier rejects the dictionary-form Signature-Agent that draft -01 requires; accepts the legacy formForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 50/100
cloudflare/web-bot-auth#199 ·
I maintainer di solito rispondono entro 1 giorno
-
http-message-sig: trailing "#" in the target URI ends up in @path / @queryForse già presa @konippi l’ha presa 4 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 58/100
cloudflare/web-bot-auth#194 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di cloudflare/web-bot-auth
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
symposium-dev/symposium#530 ·
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
topgrade-rs/topgrade#2540 ·
I maintainer di solito rispondono entro 1 giorno
-
Invalid JSON options for ngram and edge_ngram silently use defaultsForse già presa @Tilendlesa l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
noemaforge/vimanam#153 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno