You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JavaScript: Request forgery taint blocked by base argument of "new URL(url, base)" #23066
CodeQL fails to detect JavaScript request forgery vulnerabilities where the taint (user input) is passed through the base argument of the new URL(url, base) constructor.
Reproduction steps
CodeQL correctly detects a server-side request forgery issue in this code:
const via = req.headers["via"];
const url = new URL("/assets/head.html", `https://${via}`);
const response = await fetch(url.href);
res.send(await response.text());
Other details
The base argument of new URL(url, base) doesn't flow taint into the URL object in every situation; for example, an absolute URL supplied in the url could cause base to be ignored. For that reason, it's unclear whether this was an intentional design to reduce false positives or an omission; I'm suspecting the later.
Activity
ebickle commentedon Nov 9, 2026
Sample and reproduction source code:
ssrf-uri-examples.zip