Vulnerability / Unexpected Token Verification Behavior with Private Key
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
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, node.js
- Ambito
- authentication, security
Direzione di ricerca
Inizia riproducendo il comportamento segnalato con il modulo crypto di Node.js e i punti di ingresso sign e verify di JWT, usando i passaggi RS256 descritti nell'issue. Verifica le aspettative documentate sulla gestione delle chiavi per le versioni 8.5.1 e 9.0.1; il lavoro è completato quando il comportamento è spiegato e il risultato atteso o la modifica necessaria è chiaramente stabilita.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Issue Title: Unexpected Token Verification Behavior with Private Key
Description:
I've encountered unexpected behavior while using the jsonwebtoken library for token verification. As per best practices, I'm aware that token verification should use the public key, but I noticed that token verification is succeeding even when using the private key.
Steps to Reproduce:
Generate an RSA key pair using the crypto module.
Sign a JWT using the private key with the RS256 algorithm.
Attempt to verify the JWT using the private key instead of the public key.
Expected Behavior:
Token verification using the private key should fail, as the private key is meant for signing, not verification.
Actual Behavior:
Token verification using the private key surprisingly succeeds, which contradicts the expected behavior.
Environment:
Node.js version: v16.19.0
jsonwebtoken library version: 9.0.1/8.5.1 -> In these versions I have checked.
Operating System: Windows 10
Additional Information:
I've verified this behavior in multiple environments to ensure accuracy. It's important to clarify that this behavior goes against established best practices for token verification. I would appreciate assistance in understanding if this is an issue or if there's a valid explanation for this behavior.
- Lingua principale
- JavaScript
- Stelle
- 18.2k
- Fork
- 1.3k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri 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 auth0/node-jsonwebtoken
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
auth0/node-jsonwebtoken#1042 · 1 commento ·
-
`jwt.sign()` callback is executed twice for "The payload already has an "..." property" errors Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
auth0/node-jsonwebtoken#1000 · 2 commenti · 1 reazione ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 65/100
auth0/node-jsonwebtoken#1046 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 10/100
auth0/node-jsonwebtoken#1034 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
auth0/node-jsonwebtoken#1032 ·
Tutte le issue di auth0/node-jsonwebtoken
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
palladius/rails8-app-on-gcp#145 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
dotenvx/dotenv-vscode#139 ·
-
test-change-proposal
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
web-platform-tests/interop#1455 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
corsairdev/corsair#1764 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100