Skip to content

Open Redirect in login page

Moderate
marcelgerber published GHSA-34x3-7p49-hg52 Apr 21, 2025

Package

owid/owid-grapher (Git commit)

Affected versions

< 84e04a2be7af74d6118e5c32a47eab7f23d95514

Patched versions

>= 84e04a2be7af74d6118e5c32a47eab7f23d95514

Description

An open redirect was identified in the admin site of the Owid Grapher. This allows an attacker to redirect a victim to an arbitrary website.

The vulnerable code is shown here:

// Prevents redirect to external URLs
let redirectTo = "/admin"
if (req.query.next) {
try {
redirectTo = new URL(req.query.next as string, ADMIN_BASE_URL)
.pathname
} catch (err) {
console.error(err)
}
}
return res.redirect(redirectTo)

The code is meant to prevent the accessing of arbitrary URLs, however, an attacker can bypass this by using the following payload

?next=C:http://attacker.com

This URL is seen as a valid URL and the pathname is set to http://attacker.com, which means the last line becomes res.redirect('http://attacker.com').

Showcasing that C:http://attacker.com is seen as a valid URL and that the pathname becomes http://attacker.com

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Changed
Confidentiality
None
Integrity
Low
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:L/A:N

CVE ID

No known CVE

Weaknesses

URL Redirection to Untrusted Site ('Open Redirect')

The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. Learn more on MITRE.

Credits