http-message-sig: trailing "#" in the target URI ends up in @path / @query
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 58/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- backend-api-design, security
Direzione di ricerca
Start by reading requestTarget in core.ts and trace how it handles URL fragments for @path, @query, and @target-uri. Reproduce the examples in the issue and check how the project tests cover target URI fragments. The change is complete when a URI ending in a bare # is handled consistently with fragments and the signature matches the target sent on the wire; the issue asks whether to reject or strip it, so that behavior needs a decision.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
A target URI with a fragment is rejected, but one ending in a bare # gets through and the # lands in the signature base.
import { createSignature } from "http-message-sig";
const signer = {
algorithm: "ed25519",
sign(data) {
console.log(new TextDecoder().decode(data) + "\n");
return new Uint8Array(64);
}};
for (const targetUri of ["https://example.com/path#", "https://example.com/a?b#"]) {
await createSignature(
{ kind: "request", method: "GET", targetUri, fields: [] },
{ signer, components: ["@path", "@query"], parameters: { created: 1794312000 } }
);
}
0.3.0 and main at 01c0d10:
"@path": /path#
"@query": ?
"@signature-params": ("@path" "@query");created=1794312000
"@path": /a
"@query": ?b#
"@signature-params": ("@path" "@query");created=1794312000
requestTarget in core.ts checks url.hash !== "", but url.hash is empty for a bare #. fetch drops the # on the wire, so the server computes /path and the signature doesn't verify. @target-uri has the same problem.
I can send a PR. Should it be rejected like #frag, or stripped?
- 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
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 54/100
cloudflare/web-bot-auth#195 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di cloudflare/web-bot-auth
Issue simili
-
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à 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 3 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno