CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-528Q-4PGM-WVG2

CVE-2025-45286: Reflected Cross-Site Scripting (XSS) in mccutchen go-httpbin

Amit Schendel
Amit Schendel
Senior Security Researcher

Jun 9, 2026·6 min read·37 visits

Executive Summary (TL;DR)

Unauthenticated reflected Cross-Site Scripting (XSS) in mccutchen go-httpbin allowed attackers to execute malicious JavaScript payloads in a victim's browser by manipulating response headers in the /response-headers and /base64 endpoints.

A reflected Cross-Site Scripting (XSS) vulnerability was identified in mccutchen go-httpbin prior to version 2.18.0. An unauthenticated attacker can control the response Content-Type header via query parameters, causing the application to return raw user input with executable MIME-types. This allow attackers to execute arbitrary web scripts or HTML in a victim's browser context.

Vulnerability Overview

The framework go-httpbin is a Go-based implementation of the popular HTTP request and response service httpbin. This tool is commonly used by developers and automated testing pipelines to mock backend endpoints, test HTTP clients, and debug custom request structures.

Because the primary design objective of go-httpbin is reflecting user parameters back to the client, it exposes a broad attack surface of dynamic endpoints. Prior to version v2.18.0, the framework did not enforce sanitization or strict typing when echoing these input values.

Specifically, the endpoints /response-headers and /base64 allowed arbitrary parameter manipulation. By injecting raw script payloads alongside a forced text/html media-type, an unauthenticated attacker could trigger a reflected Cross-Site Scripting (XSS) condition.

Although go-httpbin is typically hosted in local development environments or isolated test clusters, exposed instances on corporate networks or public infrastructure create a direct pathway for session hijacking, credential harvesting, or request forgery.

Root Cause Analysis

The vulnerability belongs to the class of CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page. This occurs because the application processes raw data from upstream requests and copies it into output documents without neutralization.

In the /response-headers endpoint, the application extracts query parameter keys and values using r.URL.Query() and places them directly into response headers. It then serializes these parameters into a JSON body returned to the client.

When an attacker supplies Content-Type=text/html as a query parameter, the application overrides the standard JSON content-type and sets the HTTP response header to text/html. The browser, relying on this MIME-type, treats the subsequent unescaped JSON text as an HTML document.

In the /base64 endpoint, the application decodes raw bytes from a URL-encoded string and serves them directly back to the client. If an attacker passes a content-type=text/html parameter with base64-encoded JavaScript, the application writes the raw HTML/JS content back, prompting immediate browser rendering and script execution.

Detailed Patch Analysis

The vulnerability was remediated in commit 0decfd1a2e88d85ca6bfb8a92421653f647cbc04 by introducing a MIME-type classification and sanitization pipeline.

In httpbin/helpers.go, a map of safe content types is established. This allowlist defines content types that are safe from HTML interpretation:

var safeContentTypes = map[string]bool{
	"text/plain":               true,
	"application/json":         true,
	"application/octet-string": true,
}
 
// isDangerousContentType determines whether the given Content-Type header
// value could be unsafe (e.g. at risk of XSS) when rendered by a web browser.
func isDangerousContentType(ct string) bool {
	mediatype, _, err := mime.ParseMediaType(ct)
	if err != nil {
		return true // Default to dangerous if invalid or unparseable
	}
	return !safeContentTypes[mediatype]
}

The framework also introduces a helper to check if HTML escaping is required, unless explicitly bypassed via a configuration parameter:

// mustEscapeResponse returns true if the response body should be HTML-escaped
// to prevent XSS and similar attacks when rendered by a web browser.
func (h *HTTPBin) mustEscapeResponse(contentType string) bool {
	if h.unsafeAllowDangerousResponses {
		return false // Opt-in backward compatibility bypass
	}
	return isDangerousContentType(contentType)
}

In httpbin/handlers.go, both /response-headers and /base64 integrate this verification step. For the /response-headers handler, query parameters are recursively escaped using Go's html.EscapeString before writing them to the response buffer:

	if h.mustEscapeResponse(contentType) {
		tmp := make(url.Values, len(args))
		for k, vs := range args {
			for _, v := range vs {
				tmp.Add(html.EscapeString(k), html.EscapeString(v))
			}
		}
		args = tmp
	}

This mitigates the flaw by ensuring that any browser rendering the payload as HTML sees only escaped string literals instead of executable nodes.

Exploitation Methodology

An attacker can exploit this vulnerability using two distinct endpoints, depending on how they wish to transport and represent the payload.

Attack Vector A: The /response-headers Endpoint

The attacker crafts a URL targeting /response-headers and overrides the content-type while packing the payload inside an arbitrary variable:

GET /response-headers?Content-Type=text%2Fhtml&xss=%3Cimg%20src%3Dx%20onerror%3Dalert(document.domain)%3E HTTP/1.1
Host: target.local

The server processes the request and returns a raw HTML document containing the unescaped <img> tag within the JSON serialization:

HTTP/1.1 200 OK
Content-Type: text/html
Connection: close
 
{"Content-Type":["text/html"],"xss":["<img src=x onerror=alert(document.domain)>"]}

Attack Vector B: The /base64 Endpoint

To avoid signature-based detection mechanisms in transit, the attacker can leverage base64 representation. First, the payload is encoded:

PGltZy9zcmMvb25lcnJvcj1hbGVydCgnYmFzZTY0eHNzJyktPg== (which decodes to <img/src/onerror=alert('base64xss')>).

The target is called with an explicit content-type flag:

GET /base64/PGltZy9zcmMvb25lcnJvcj1hbGVydCgnYmFzZTY0eHNzJyktPg==?content-type=text/html HTTP/1.1
Host: target.local

The application decodes the string and flushes it to the client under the text/html directive. The browser parses the decoded string directly as an HTML fragment and executes the DOM-event script injection.

Impact Assessment

The security severity is rated as Medium with a CVSS v3.1 base score of 6.1 (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).

The primary consequence of a successful exploitation is execution of unauthorized code inside the victim's session context. Attackers can leverage this access to perform DOM modifications, manipulate interface elements, capture user keystrokes, and extract storage data.

Because go-httpbin may be deployed inside testing clusters, it often shares domains or subdomains with internal development platforms. A script running on a trusted domain can compromise cross-domain boundaries, allowing the attacker to read session keys or target local APIs.

While the EPSS score of 0.00006 indicates low current volumes of mass exploitation in the wild, the technical ease of execution makes it a high-utility target for directed phishing or internal lateral movement campaigns.

Remediation & Detection

The definitive mitigation for CVE-2025-45286 is upgrading to version v2.18.0 or later of the go-httpbin library.

If upgrading is not immediately possible, security teams can implement several environmental controls to prevent execution:

  1. Ensure MIME-Sniffing Prevention: Configure upstream reverse proxies (like Nginx, HAProxy, or Cloudflare) to force the X-Content-Type-Options: nosniff header across all responses.
  2. Parameter Filtering: Block or drop incoming GET requests containing Content-Type=text/html or similar markup-based media-type parameters.
  3. Isolate Sandbox Environments: Ensure that testing components like go-httpbin are hosted on dedicated, isolated domains (e.g., httpbin.local) rather than primary development domains to minimize the impact of domain-scoped storage exposure.

Deploying automated detection templates such as Nuclei can verify the susceptibility of internal services across corporate address spaces.

Official Patches

mccutchenOfficial patch implementing output escaping for dangerous Content-Types.

Fix Analysis (1)

Technical Appendix

CVSS Score
6.1/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
EPSS Probability
0.01%
Top 100% most exploited
1,500
via Shodan

Affected Systems

mccutchen go-httpbin web framework

Affected Versions Detail

Product
Affected Versions
Fixed Version
go-httpbin
mccutchen
< v2.18.0v2.18.0
AttributeDetail
CWE IDCWE-80
Attack VectorNetwork
CVSS v3.16.1 (Medium)
EPSS Score0.00006
Exploit Statuspoc
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1204.001User Execution: Malicious Link
Execution
T1059.007Command and Scripting Interpreter: JavaScript
Execution
T1189Drive-by Compromise
Initial Access
CWE-80
Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)

The application receives input from an upstream source but fails to neutralize or sanitize HTML tags before reflecting the input back to the user's browser.

Known Exploits & Detection

GitHub Security AdvisoryReflected Cross-Site Scripting (XSS) via response parameters and base64 payloads.
NucleiDetection Template Available

Vulnerability Timeline

Official fix commit committed and released in v2.18.0
2025-03-20
Vulnerability formally disclosed and CVE-2025-45286 assigned
2026-01-02
Vulnerability populated in the Go Vulnerability Database
2026-01-02
National Vulnerability Database (NVD) publishes analyzed metadata
2026-01-07

References & Sources

  • [1]GitHub Security Advisory GHSA-528q-4pgm-wvg2
  • [2]GitHub Advisory Database Entry
  • [3]Release v2.18.0 Changelog
  • [4]CVE Record on CVE.org
  • [5]NVD Detail Page
Related Vulnerabilities
CVE-2025-45286

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 2 hours ago•CVE-2024-29203
4.3

CVE-2024-29203: Client-Side Cross-Site Scripting via Unsandboxed Iframes and Legacy Embed Elements in TinyMCE

CVE-2024-29203 identifies a cross-site scripting (XSS) vulnerability in the content ingestion and parsing mechanics of TinyMCE rich text editor. Due to a failure to enforce sandbox attributes on dynamic iframe elements and safely handle legacy embed objects, unauthenticated attackers can inject malicious elements that execute scripts within the context of the parent application session.

Amit Schendel
Amit Schendel
5 views•5 min read
•about 4 hours ago•CVE-2026-9277
8.1

CVE-2026-9277: OS Command Injection in shell-quote via Object-Token Line Terminator Parsing Defect

A technical breakdown of the OS command injection vulnerability in the shell-quote NPM package (CVE-2026-9277 / GHSA-w7jw-789q-3m8p). The bug resides in the character-by-character backslash-escaping logic applied to the .op field of object-tokens within the quote() function, which fails to match and escape line terminators due to a regex matching oversight in JavaScript. This allows unauthenticated remote attackers to execute arbitrary shell commands if they can control inputs processed by this library.

Alon Barad
Alon Barad
7 views•6 min read
•about 6 hours ago•CVE-2026-11645
8.8

CVE-2026-11645: Out-of-Bounds Memory Access in Google Chrome V8 Engine

A high-severity memory corruption vulnerability exists in the V8 JavaScript engine of Google Chrome before versions 149.0.7827.102/103. The flaw arises from an incorrect bounds-check elimination during JIT compilation by the TurboFan optimizer, allowing remote attackers to achieve out-of-bounds read and write access inside the sandboxed renderer process.

Amit Schendel
Amit Schendel
21 views•6 min read
•about 14 hours ago•CVE-2026-50751
9.3

CVE-2026-50751: Authentication Bypass in Check Point Security Gateway IKEv1 Legacy Validation

An improper authentication vulnerability (CWE-287) exists in the legacy, deprecated Internet Key Exchange version 1 (IKEv1) key exchange protocol implementation in Check Point Security Gateways. The vulnerability is caused by a logic flow weakness during the certificate validation process for Remote Access VPN and Mobile Access (SSL VPN) connections. An unauthenticated remote attacker can exploit this weakness to bypass user authentication entirely, establishing a fully functional Remote Access VPN connection without a valid password.

Alon Barad
Alon Barad
67 views•6 min read
•1 day ago•CVE-2026-39922
6.3

CVE-2026-39922: Server-Side Request Forgery in GeoNode Service Registration Endpoint

GeoNode versions prior to 4.4.5 and 5.0.2 are vulnerable to Server-Side Request Forgery (SSRF) in the service registration endpoint. Authenticated attackers with low privileges can exploit insufficient input validation in the Web Map Service (WMS) registration module to force the application server to make outbound network queries to loopback addresses, private RFC1918 subnets, link-local scopes, and cloud metadata endpoints. This technical report details the mechanics of the vulnerability, the underlying architectural flaw, and how to effectively remediate and mitigate the associated security risks.

Alon Barad
Alon Barad
4 views•7 min read
•1 day ago•CVE-2022-0492
7.8

CVE-2022-0492: Privilege Escalation and Container Escape via cgroups v1 release_agent

CVE-2022-0492 is a high-severity missing authorization vulnerability in the Linux kernel's Control Groups (cgroups) v1 implementation. The flaw resides within the cgroup_release_agent_write function in kernel/cgroup/cgroup-v1.c, where the kernel fails to validate if the process writing to the release_agent file possesses administrative capabilities in the initial user namespace. This allows a local attacker inside a container with root privileges (UID 0) to abuse user namespaces, mount a cgroups v1 directory, modify the release_agent parameter, and execute arbitrary commands on the host system as host root, effectively achieving a complete container escape.

Amit Schendel
Amit Schendel
12 views•7 min read