CVE-2026-118652: Echo JSONP callback code injection

CVE-2026-118652 · Severity: medium · CVSS 6.1 · Published 2026-10-28

Echo is a Go web framework used to build web applications and APIs. The JSONP response methods in Echo fail to validate user-supplied callback names, allowing an attacker to inject arbitrary JavaScript code that executes in a victim's browser when they visit a malicious link. This enables reflected cross-site scripting attacks without requiring authentication.

Technologies: github.com/labstack/echo/v4 (Go), github.com/labstack/echo/v5 (Go), Labstack Echo. Vendors: Go, Labstack.

Quick answers

Is CVE-2026-118652 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-118652 being exploited in the wild.
How severe is CVE-2026-118652?
Medium severity, with a CVSS score of 6.1, published 28 October 2026.
Which products and versions are affected?
github.com/labstack/echo/v4 (Go) < 4.16.0, SEMVER:introduced=0,fixed=4.16.0; github.com/labstack/echo/v5 (Go) < 5.4.0, SEMVER:introduced=0,fixed=5.4.0; Labstack Echo before 4.16.0 and before 5.4.0.
Is there a fix for CVE-2026-118652?
Yes. github.com/labstack/echo/v4 (Go): upgrade to 4.16.0 or later; github.com/labstack/echo/v5 (Go): upgrade to 5.4.0 or later. Until then: Validate callback parameters manually to ensure they contain only valid JavaScript identifiers and dot-separated paths (ASCII letters, digits, underscore, and dollar sign) before passing them to Context.JSONP or Context.JSONPBlob, or avoid JSONP entirely in favor of CORS-enabled JSON endpoints. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-118652 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-118652?
Check whether you run github.com/labstack/echo/v4 (Go), github.com/labstack/echo/v5 (Go) or Labstack Echo at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • github.com/labstack/echo/v4 (Go): upgrade to 4.16.0 or later
    go get github.com/labstack/echo/v4@v4.16.0
  • github.com/labstack/echo/v5 (Go): upgrade to 5.4.0 or later
    go get github.com/labstack/echo/v5@v5.4.0

Validate callback parameters manually to ensure they contain only valid JavaScript identifiers and dot-separated paths (ASCII letters, digits, underscore, and dollar sign) before passing them to Context.JSONP or Context.JSONPBlob, or avoid JSONP entirely in favor of CORS-enabled JSON endpoints.

Technical details

Context.JSONP and Context.JSONPBlob concatenate an unvalidated callback parameter directly into the JavaScript response without escaping or validation. An attacker can craft a malicious URL with a callback containing arbitrary JavaScript syntax, which will be executed by the browser. The vulnerability requires an application route that passes attacker-controlled input as the callback argument.

Affected products

  • labstack Echo before 4.16.0 and before 5.4.0

Identifiers

  • CVE-2026-118652
  • GHSA-h9g5-28mm-hx3g
  • GO-2026-6876

Timeline

  • 2026-10-28: disclosed

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.