signedCookie is unlikely to be used correctly
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, node.js
Research direction
Start with cookie-parser's signedCookie function and inspect its existing tests and the callers described in the issue. Confirm how unsigned values are currently returned, then define and test the intended false-return behavior while checking the API impact on existing callers.
Written by the indexing model from the issue text.
Description
cookie-parser's signedCookie function has the following behavior when it encounters an unsigned value:
"If the value was not signed, the original value is returned."
This is subtle behavior, and it seems unlikely that a caller would actually know to check that the return value was different from what was passed in. If the caller depends on the signature mechanism to prevent tampering this could be a serious problem.
A cursory check shows all 3 callers on github are not checking the return value:
I'd suggest changing the API to return false if passed a non-signature cookie value, similar to failing the signature check.
- Dominant language
- JavaScript
- Stars
- 2k
- Forks
- 237
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from expressjs/cookie-parser
-
question
Difficulty 4/5 3-5 days Newbie friendliness 35/100
expressjs/cookie-parser#168 · 5 comments ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
expressjs/cookie-parser#138 ·
-
req.cookies is showing nullPossibly taken @D-393Patel claimed this 372 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
expressjs/cookie-parser#128 ·
-
perf: limit cookie parse only on some cookiePossibly taken @cesco69 claimed this 584 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 42/100
expressjs/cookie-parser#126 · 1 reaction ·
-
future question
Difficulty 5/5 Over a week Newbie friendliness 25/100
expressjs/cookie-parser#124 · 7 reactions ·
All issues in expressjs/cookie-parser
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
anothaDev/luci-theme-vantage#143 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
kingcharleslzy-ai/dsh-purge#282 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
a-corriger bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
christian-raj/S-Aloha#340 ·
-
area:image documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day