GitHub Advisoryadvisory · Go

GHSA-528q-4pgm-wvg2 Reflected XSS in go-httpbin due to unrestricted client control over Content-Type

LOW Published 2025-03-21 Modified 2026-01-02 Official page ↗
Aliases
CVE-2025-45286
Ecosystem
Go
Packages
github.com/mccutchen/go-httpbin, github.com/mccutchen/go-httpbin/v2
Severity
Low
CVSS vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:U
Weaknesses
CWE-79
Reviewed
2025-03-21

Affected packages

• Go github.com/mccutchen/go-httpbin: < 2.18.0 → fixed in 2.18.0 • Go github.com/mccutchen/go-httpbin/v2: < 2.18.0 → fixed in 2.18.0

Description

Description The go-httpbin framework is vulnerable to XSS as the user can control the `Response Content-Type` from GET parameter. This allows attacker to execute cross site scripts in victims browser. Affected URLs: • `/response-headers?Content-Type=text/html&xss=%3Cimg/src/onerror=alert(%27xss%27)%3E` • `/base64/PGltZy9zcmMvb25lcnJvcj1hbGVydCgneHNzJyk+?content-type=text/html` • `/base64/decode/PGltZy9zcmMvb25lcnJvcj1hbGVydCgneHNzJyk+?content-type=text/html` Steps to reproduce: 1. Visit one of the above mentioned URLs. 2. XSS window will popup Suggested fix • Allow Only Safe Content-Type Values Or give users option to define whitelisted Content-Type headers Criticality The following can be major impacts of the issue: • Access to victim's sensitive Personal Identifiable Information. • Access to CSRF token • Cookie injection • Phishing • And any other thing Javascript can perform

Related

Alias · CVE (1)

  • CVE-2025-45286 A cross-site scripting (XSS) vulnerability in mccutchen httpbin v2.17.1 allows attackers to execute arbitrary web scripts or HTML via a… vulnerability

Weakness · CWE (1)

  • CWE-79 Improper Neutralization of Input During Web Page Generation weakness

References