Uh oh!
There was an error while loading. Please reload this page.
doc: correct unsafe URL example in http docs - #52555
Conversation
nodejs-github-bot
commented
Apr 16, 2024
Review requested:
|
avivkeller
commented
Apr 16, 2024
LGTM |
ShogunPanda
commented
Apr 16, 2024
I kinda like it. |
430c3dd to
4d39eb2Comparemlegenhausen
commented
Apr 16, 2024
I will try to formulate something that doesn't get to complicated. For the classic copy/paste developer this at least contains no surprises. Everyone else beyond that will understand how to adapt this. Should I document something about the dangers of the |
ShogunPanda
commented
Apr 16, 2024
I would say keep it. When it's about security we are never verbose enough ;) |
4d39eb2 to
2e593a6Comparemlegenhausen
commented
Apr 16, 2024
The previous documentation example for converting `request.url` to an `URL` object was unsafe, as it could allow a server crash through malformed URL inputs and potentially enable host header attacks. This commit revises the example to use string concatenation over the usage of the `baseUrl` and removes the usage of the `req.headers.host` as the authority part of the url, mitigating both the crash and security risks by ensuring the host part of the URL remains controlled and predictable. Fixesnodejs#52494 Co-authored-by: @astlouisf Co-authored-by: @samhh
2e593a6 to
e1f6dc7Compareavivkeller
commented
Apr 16, 2024
Everything seems good to me! |
lpinca
commented
Apr 17, 2024
@mlegenhausen can you please fix the lint issue? |
mlegenhausen
commented
Apr 18, 2024
@lpinca fixed |
nodejs-github-bot
commented
Apr 21, 2024
Landed in 461722d |
The previous documentation example for converting `request.url` to an `URL` object was unsafe, as it could allow a server crash through malformed URL inputs and potentially enable host header attacks. This commit revises the example to use string concatenation over the usage of the `baseUrl` and removes the usage of the `req.headers.host` as the authority part of the url, mitigating both the crash and security risks by ensuring the host part of the URL remains controlled and predictable. Fixes#52494 Co-authored-by: @astlouisf Co-authored-by: @samhh PR-URL: #52555 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it>
The previous documentation example for converting `request.url` to an `URL` object was unsafe, as it could allow a server crash through malformed URL inputs and potentially enable host header attacks. This commit revises the example to use string concatenation over the usage of the `baseUrl` and removes the usage of the `req.headers.host` as the authority part of the url, mitigating both the crash and security risks by ensuring the host part of the URL remains controlled and predictable. Fixes#52494 Co-authored-by: @astlouisf Co-authored-by: @samhh PR-URL: #52555 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it>
The previous documentation example for converting `request.url` to an `URL` object was unsafe, as it could allow a server crash through malformed URL inputs and potentially enable host header attacks. This commit revises the example to use string concatenation over the usage of the `baseUrl` and removes the usage of the `req.headers.host` as the authority part of the url, mitigating both the crash and security risks by ensuring the host part of the URL remains controlled and predictable. Fixes#52494 Co-authored-by: @astlouisf Co-authored-by: @samhh PR-URL: #52555 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Co-authored-by: @astlouisf
Co-authored-by: @samhh
The previous documentation example for converting
request.urlto anURLobject was unsafe, as it could allow a server crash through malformed URL inputs and potentially enable host header attacks.This commit revises the example to use string concatenation over the usage of the
baseUrland removes the usage of thereq.headers.hostas the authority part of the url, mitigating both the crash and security risks by ensuring the host part of the URL remains controlled and predictable.Fixes#52494
Successor of #52536