Files
node/doc/api
Malte Legenhausen@astlouisf@samhh
461722d64c doc: correct unsafe URL example in http docs
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: https://github.com/nodejs/node/pull/52555
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2024-04-21 12:56:11 +00:00
..
2024-03-18 14:27:59 +00:00
2023-04-23 13:34:08 +00:00
2024-04-13 19:41:20 +00:00
2024-03-26 17:42:38 +00:00
2024-04-21 09:03:50 +00:00
2023-08-10 15:37:10 +00:00
2024-04-20 18:37:01 +00:00
2024-02-13 21:37:42 +00:00
2022-11-01 04:21:13 +00:00
2023-05-21 16:41:28 +00:00
2024-02-13 21:37:42 +00:00
2024-03-26 17:42:38 +00:00