Vulnerabilities in pkg:golang/github.com/mccutchen/go-httpbin/v2

PACKAGE
Advisory Identifier: GHSA-528q-4pgm-wvg2
Advisory Summary

CVE-2025-45286 is a LOW cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Github.com/mccutchen/go httpbin libraries in the Go ecosystem. The issue involves reflected xss in go-httpbin due to unrestricted client control over content-type. Remediation is available by upgrading affected packages to version 2.18.0.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/mccutchen/go-httpbin/v2

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/mccutchen/go-httpbin/v2. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-528q-4pgm-wvg2 CVE-2025-45286 LOW Reflected XSS in go-httpbin due to unrestricted client control over Content-Type
GHSA-p4f6-h8jj-vfvf - LOW Duplicate Advisory: Reflected XSS in go-httpbin due to unrestricted client control over Content-Type

CVE-2025-45286 at a Glance

CVE Identifier CVE-2025-45286
GHSA Identifier GHSA-528q-4pgm-wvg2
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Github.com/mccutchen/go httpbin
Package Ecosystem Go
Published Date
Last Updated

How to Fix CVE-2025-45286

To remediate this vulnerability, upgrade all affected Github.com/mccutchen/go httpbin dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/mccutchen/go-httpbin fixed: 2.18.0
Upgrade github.com/mccutchen/go-httpbin to 2.18.0
github.com/mccutchen/go-httpbin/v2 fixed: 2.18.0
Upgrade github.com/mccutchen/go-httpbin/v2 to 2.18.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/mccutchen/go-httpbin

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-45286, inspect your project dependencies for Github.com/mccutchen/go httpbin:

inspect dependencies for github.com/mccutchen/go-httpbin

Analyze the terminal output to locate any version of Github.com/mccutchen/go httpbin in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.18.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Github.com/mccutchen/go httpbin, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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

CVE-2025-45286 Affected Github.com/mccutchen/go httpbin Versions

2 component(s)
Fixed Versions:
2.18.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/mccutchen/go-httpbin
Go
< 2.18.0
2.18.0
github.com/mccutchen/go-httpbin/v2
Go
< 2.18.0
2.18.0

References

Frequently Asked Questions

What is CVE-2025-45286?
CVE-2025-45286 is a security vulnerability in Github.com/mccutchen/go httpbin involving Reflected XSS in go-httpbin due to unrestricted client control over Content-Type under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Github.com/mccutchen/go httpbin versions are affected?
Affected versions include releases prior to 2.18.0 across affected packages: github.com/mccutchen/go-httpbin, github.com/mccutchen/go-httpbin/v2.
What version fixes CVE-2025-45286?
Upgrading to 2.18.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/mccutchen/go-httpbin affected?
Yes, github.com/mccutchen/go-httpbin is affected in releases prior to 2.18.0. Upgrade your dependency to 2.18.0 or later.
Is github.com/mccutchen/go-httpbin/v2 affected?
Yes, github.com/mccutchen/go-httpbin/v2 is affected in releases prior to 2.18.0. Upgrade your dependency to 2.18.0 or later.
What CWE is associated with CVE-2025-45286?
CVE-2025-45286 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check Go dependencies for CVE-2025-45286?
Run the dependency tree command: 'inspect dependencies for github.com/mccutchen/go-httpbin'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-528q-4pgm-wvg2",
  "modified" : "2026-01-02T20:32:35Z",
  "published" : "2025-03-21T22:29:47Z",
  "aliases" : [ "CVE-2025-45286" ],
  "summary" : "Reflected XSS in go-httpbin due to unrestricted client control over Content-Type",
  "details" : "### Description\n\nThe 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.\n\n### Affected URLs:\n- `/response-headers?Content-Type=text/html&xss=%3Cimg/src/onerror=alert(%27xss%27)%3E`\n- `/base64/PGltZy9zcmMvb25lcnJvcj1hbGVydCgneHNzJyk+?content-type=text/html`\n- `/base64/decode/PGltZy9zcmMvb25lcnJvcj1hbGVydCgneHNzJyk+?content-type=text/html`\n\n### Steps to reproduce:\n1. Visit one of the above mentioned URLs.\n2. XSS window will popup\n\n### Suggested fix\n- Allow Only Safe Content-Type Values Or give users option to define whitelisted Content-Type headers\n\n\n### Criticality\nThe following can be major impacts of the issue:\n* Access to victim's sensitive Personal Identifiable Information.\n* Access to CSRF token\n* Cookie injection\n* Phishing\n* And any other thing Javascript can perform",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/mccutchen/go-httpbin"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.18.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/mccutchen/go-httpbin/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.18.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/mccutchen/go-httpbin/security/advisories/GHSA-528q-4pgm-wvg2"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-45286"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mccutchen/go-httpbin/commit/0decfd1a2e88d85ca6bfb8a92421653f647cbc04"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mccutchen/go-httpbin"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mccutchen/go-httpbin/releases/tag/v2.18.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-03-21T22:29:47Z",
    "nvd_published_at" : null
  }
}