Go
CVE-2026-118652
Echo vulnerable to Reflected Cross-Site Scripting (XSS) via unsanitized JSONP callback in Context.JSONP / Context.JSONPBlob
- Severity
- Medium 6.1
- Published
- 28 Oct 2026
- Last changed
- 5 Nov 2026
- Added to UpHeron
- 23 Nov 2026
- Fixed in
- 4.16.0, 5.4.0
- Exploit chance
- 0.3% in the next 30 daysHigher than 21% of CVEs. EPSS by FIRST, 24 Nov 2026
- Weakness
- Cross-site scripting (CWE-79)
- Attack
- Over the network · No login needed · Needs someone to click or open something
- Attacker can
- Read some data · Change some data
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N- Also known as
- GHSA-h9g5-28mm-hx3g, GO-2026-6876
- Sources
- OSV.dev and GitHub
Description
The Context.JSONP, Context.JSONPBlob, and internal jsonPBlob helper in context.go directly concatenate the caller-supplied callback parameter into a JavaScript response without any validation, escaping, or allow-listing.
This creates a high-impact reflected XSS that can be triggered by any route passing attacker-controlled data (query string, form, header, path param, etc.) into the callback.
- Session hijacking, cookie theft, account takeover, keylogging, defacement.
- Works even with strict CSP (response is served as application/javascript).
Workarounds
Manually sanitize the callback before calling JSONP/JSONPBlob:
Or migrate away from JSONP entirely (use CORS + application/json).
Validate the callback in your handler before calling Context.JSONP, for example against ^[A-Za-z_$][A-Za-z0-9_$](.[A-Za-z_$][A-Za-z0-9_$])*$, and set X-Content-Type-Options: nosniff. JSONP responses can be read by any website with the user's cookies, so do not serve data that requires authentication through JSONP.
Affected software
| Software | Affected versions |
|---|---|
github.com/labstack/echo/v4Go · osv:Go:github.com/labstack/echo/v4 |
|
github.com/labstack/echo/v5Go · osv:Go:github.com/labstack/echo/v5 |
|
About github.com/labstack/echo/v4
Vulnerabilities in github.com/labstack/echo/v4
- In our list
- 10
- Published in the last 12 months
- 10
- Critical, last 12 months
- 0
- High, last 12 months
- 1
- Known exploited
- 0
- CVE-2026-118657Echo: HTTPS Redirect and HSTS Bypass via Unconditional Trust of Forwarded Scheme HeadersMedium 5.9 28 Oct 2026
- CVE-2026-118654Echo static file middleware route protection bypass via encoded dot-dot traversalMedium 5.9 28 Oct 2026
- CVE-2026-118655Echo has a Static Middleware Double-Unescape Path TraversalMedium 5.9 28 Oct 2026
- CVE-2026-118656Echo has Open Redirect via Control-Character Prefix Defeating sanitizeURIMedium 6.1 28 Oct 2026
- CVE-2026-118658Echo has Arbitrary Scheme Injection in WWWRedirect/NonWWWRedirect Middlewares via X-Forwarded-ProtoMedium 4.7 28 Oct 2026
- CVE-2026-118650Echo's middleware.Static: `%2F`-encoded path bypasses route/group middleware guarding a statically-served pathHigh 7.5 28 Oct 2026
About github.com/labstack/echo/v5
Vulnerabilities in github.com/labstack/echo/v5
- In our list
- 10
- Published in the last 12 months
- 10
- Critical, last 12 months
- 0
- High, last 12 months
- 1
- Known exploited
- 0
- CVE-2026-118657Echo: HTTPS Redirect and HSTS Bypass via Unconditional Trust of Forwarded Scheme HeadersMedium 5.9 28 Oct 2026
- CVE-2026-118654Echo static file middleware route protection bypass via encoded dot-dot traversalMedium 5.9 28 Oct 2026
- CVE-2026-118655Echo has a Static Middleware Double-Unescape Path TraversalMedium 5.9 28 Oct 2026
- CVE-2026-118656Echo has Open Redirect via Control-Character Prefix Defeating sanitizeURIMedium 6.1 28 Oct 2026
- CVE-2026-118658Echo has Arbitrary Scheme Injection in WWWRedirect/NonWWWRedirect Middlewares via X-Forwarded-ProtoMedium 4.7 28 Oct 2026
- CVE-2026-118650Echo's middleware.Static: `%2F`-encoded path bypasses route/group middleware guarding a statically-served pathHigh 7.5 28 Oct 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-118652
- GitHub Advisory Database https://github.com/advisories/GHSA-h9g5-28mm-hx3g