Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

How can I differentiate a tampered signed cookie from a `false` JSON cookie?

Aperta
#168 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
javascript, node.js
Ambito
backend

Direzione di ricerca

Inizia esaminando la documentazione di cookie-parser sui cookie firmati e sui cookie JSON, quindi riproduci la collisione tra un valore false valido, firmato e con prefisso j:, e una firma non riuscita. Determina se l’API attuale espone informazioni sufficienti per distinguerli; documenta il risultato oppure definisci il comportamento richiesto e i relativi casi di verifica.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

question

Forewarning: I am extremely new to Node.js and NPM.

From reading the documentation of cookieParser, it appears that cookies that are signed but fail validation are assigned false in the req.signedCookies object.

Signed cookies that fail signature validation will have the value false instead of the tampered value.

Also, cookies prefixed with j: are automatically parsed with JSON.parse.

In addition, this module supports special "JSON cookies". These are cookie where the value is prefixed with j:. When these values are encountered, the value will be exposed as the result of JSON.parse.

However, the string 'false' is valid JSON, so it should get parsed to false. I also found no option to disable the built-in JSON parser. How can I differentiate a valid signed j:'false' cookie from an invalid signed cookie?

If this is not possible, I request that this be relabeled to a bug report or feature request.

Lingua principale
JavaScript
Stelle
2k
Fork
235
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di expressjs/cookie-parser

Tutte le issue di expressjs/cookie-parser

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.