JWT encoder signs payloads that aren't JSON objects, and the decoder then rejects them
I maintainer di solito rispondono entro 1 giorno
@MugdhoAI ci sta già lavorando.
Dal 22/10/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
In the JWT decoder's Encode tab, a payload of [1, 2, 3], "hello", 42 or null is signed without complaint. Paste the token into Decode, as the panel suggests, and you get "Payload is not a JSON object". A JWT's claims set has to be a JSON object (RFC 7519), and decodeJwt already checks that (lib/jwt-utils.ts, lines 89 to 91).
generate (app/(tools)/jwt-decoder/components/EncoderTab.tsx, lines 37 to 51) only checks that the payload is valid JSON (line 39) before it signs it (line 51).
What to do
- After the JSON check, refuse anything that isn't a plain object (arrays, strings, numbers, booleans and
null) with an error like "The payload must be a JSON object", shown where the JSON error shows today. - Objects sign exactly as before.
Where to look
app/(tools)/jwt-decoder/components/EncoderTab.tsx:generate(lines 37 to 51)lib/jwt-utils.ts: the same check indecodeJwt(lines 89 to 91)app/(tools)/jwt-decoder/components/DecodedCard.test.tsx: a component test for this tool
Acceptance criteria
-
[1, 2, 3],"hello",42,trueandnullshow the error and produce no token - An object payload still produces a token that Decode accepts
- Tests for these cases
-
npm run lint,npm run testandnpm run buildpass
Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off develop, and open your PR against develop with Closes #253 in the description.
- Lingua principale
- TypeScript
- Stelle
- 1
- Fork
- 9
- Merge medio
- 9h 9m
- PR unite (30g)
- 118
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un 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 codercops/toolbelt
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 55/100
I maintainer di solito rispondono entro 1 giorno
-
JSON to YAML: control characters are written raw, so PyYAML and js-yaml can't read the outputForse già presa @anurag2787 l’ha presa 1 giorno fa. Apertabug good first issue hacktoberfest
codercops/toolbelt#234 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
JSON formatter: Escape for code gives broken Python when the text has a run of single quotesForse già presa @anurag2787 l’ha presa 1 giorno fa. Apertabug good first issue hacktoberfest
codercops/toolbelt#233 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Add the URL encoder to the README, the home share card and package.jsonForse già presa @Abhishek764 l’ha presa 4 giorni fa. Apertadocumentation good first issue hacktoberfest
codercops/toolbelt#153 · 4 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
hacktoberfest
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 1/100
codercops/toolbelt#101 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di codercops/toolbelt
Issue simili
-
area:agent-view area:tui bug platform:macos
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
anthropics/claude-code#104558 ·
I maintainer di solito rispondono entro 1 giorno
-
updater
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
UniversityOfHelsinkiCS/oodikone#5141 ·
-
maintanance
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
inmanta/web-console#7606 ·
I maintainer di solito rispondono entro 1 giorno
-
bug skills
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
equinor/fusion-framework#5846 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 74/100