|
|
|
|
|
by uyt
1905 days ago
|
|
I'm not a security expert, but in node.js (specifically express.js) there's a concept of "signedCookies". Usually you can just set a "httpOnly" flag to make sure client-side javascript can't mess with the cookie. But if you also sign the cookie, it further enforces this for any client tampering with the cookie manually too. Because only the server knows the secret for creating a new signature, if the client sends back a cookie that is modified in any way (including case sensitivity), it will be discarded. It should prevent the whole class of bugs caused by "unexpected format". |
|