{"id":"GHSA-h9g5-28mm-hx3g","revision":null,"records":[{"revision":"8fb049b5e09d449f908804397ca22feb","observedAt":"2026-11-03T14:57:17.179+00:00","statement":{"source":"cve-program","id":"CVE-2026-118652","aliases":[],"title":"Echo: Reflected Cross-Site Scripting (XSS) via unsanitized JSONP callback in Context.JSONP / Context.JSONPBlob","description":"Echo is a Go web framework. Prior to 4.16.0 and 5.4.0, Context.JSONP and Context.JSONPBlob concatenate an unvalidated callback value into a JavaScript response. A route that passes attacker-controlled input as the callback can return executable script syntax, allowing reflected cross-site scripting when a user loads the crafted response. The vulnerable jsonPBlob path performs no callback validation or escaping, and exploitation requires an application route that exposes attacker control over the callback argument. This issue is fixed in 4.16.0 and 5.4.0.","state":0,"publishedAt":"2026-10-28T19:35:47.103+00:00","modifiedAt":"2026-11-03T13:27:48.704+00:00","affected":[{"ecosystem":"Vendor product","name":"echo","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"labstack\",\n                    \"product\": \"echo\",\n                    \"versions\": [\n                        {\n                            \"version\": \"< 4.16.0\",\n                            \"status\": \"affected\"\n                        },\n                        {\n                            \"version\": \">= 5.0.0, < 5.4.0\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"severity":"MEDIUM"}],"references":["https://github.com/labstack/echo/security/advisories/GHSA-h9g5-28mm-hx3g","https://github.com/labstack/echo/commit/b838391e2eade87ae7e5a09d7bb5087bec271ec1","https://github.com/labstack/echo/commit/fc410094b2f3415cf2bf5204082137b205bfd5af","https://github.com/labstack/echo/releases/tag/v4.16.0","https://github.com/labstack/echo/releases/tag/v5.4.0"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-118652","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-118652","identifiers":["CVE-2026-118652"]},"retained":false,"historicalAffected":[]},{"revision":"6836222ca29c4f62a442b171129a4ad8","observedAt":"2026-11-16T04:35:41.921+00:00","statement":{"source":"euvd","id":"EUVD-2026-112408","aliases":["CVE-2026-118652","GHSA-h9g5-28mm-hx3g"],"title":"Echo is a Go web framework. Prior to 4.16.0 and 5.4.0, Context.JSONP and Context.JSONPBlob concatenate an unvalidated callback value into a JavaScript response. A route that passes attacker-controlled input as the callback can return execut…","description":"Echo is a Go web framework. Prior to 4.16.0 and 5.4.0, Context.JSONP and Context.JSONPBlob concatenate an unvalidated callback value into a JavaScript response. A route that passes attacker-controlled input as the callback can return executable script syntax, allowing reflected cross-site scripting when a user loads the crafted response. The vulnerable jsonPBlob path performs no callback validation or escaping, and exploitation requires an application route that exposes attacker control over the callback argument. This issue is fixed in 4.16.0 and 5.4.0.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"severity":null}],"references":["https://github.com/labstack/echo/security/advisories/GHSA-h9g5-28mm-hx3g","https://github.com/labstack/echo/commit/b838391e2eade87ae7e5a09d7bb5087bec271ec1","https://github.com/labstack/echo/commit/fc410094b2f3415cf2bf5204082137b205bfd5af","https://github.com/labstack/echo/releases/tag/v4.16.0","https://github.com/labstack/echo/releases/tag/v5.4.0"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-112408","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Oct 28, 2026, 7:35:47 PM","dateUpdated":"Nov 3, 2026, 1:27:48 PM"},"relatedAdvisories":[],"note":"EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON."},"key":"euvd:EUVD-2026-112408","identifiers":["EUVD-2026-112408","CVE-2026-118652","GHSA-h9g5-28mm-hx3g"]},"retained":false,"historicalAffected":[]},{"revision":"b9cf5141803f429aac241b8c974e1ba0","observedAt":"2026-11-03T22:59:08.68+00:00","statement":{"source":"nvd","id":"CVE-2026-118652","aliases":[],"title":"Echo is a Go web framework. Prior to 4.16.0 and 5.4.0, Context.JSONP and Context.JSONPBlob concatenate an unvalidated callback value into a JavaScript response. A route that passes attacker-controlled input as the callback can return execut…","description":"Echo is a Go web framework. Prior to 4.16.0 and 5.4.0, Context.JSONP and Context.JSONPBlob concatenate an unvalidated callback value into a JavaScript response. A route that passes attacker-controlled input as the callback can return executable script syntax, allowing reflected cross-site scripting when a user loads the crafted response. The vulnerable jsonPBlob path performs no callback validation or escaping, and exploitation requires an application route that exposes attacker control over the callback argument. This issue is fixed in 4.16.0 and 5.4.0.","state":0,"publishedAt":"2026-10-28T20:17:22.25+00:00","modifiedAt":"2026-11-03T14:17:31.56+00:00","affected":[],"metrics":[{"system":"CVSS 3.1 · security-advisories@github.com · Secondary","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"severity":"MEDIUM"}],"references":["https://github.com/labstack/echo/commit/b838391e2eade87ae7e5a09d7bb5087bec271ec1","https://github.com/labstack/echo/commit/fc410094b2f3415cf2bf5204082137b205bfd5af","https://github.com/labstack/echo/releases/tag/v4.16.0","https://github.com/labstack/echo/releases/tag/v5.4.0","https://github.com/labstack/echo/security/advisories/GHSA-h9g5-28mm-hx3g"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-118652","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Undergoing Analysis","weaknesses":["CWE-79"],"productCriteria":[],"sourceDates":{"published":"2026-10-28T20:17:22.250","lastModified":"2026-11-03T14:17:31.560"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2026-118652","identifiers":["CVE-2026-118652"]},"retained":false,"historicalAffected":[]},{"revision":"c68b299fe0fe4ffc97e7875b9bc991a1","observedAt":"2026-11-05T23:38:32.248+00:00","statement":{"source":"osv","id":"GHSA-h9g5-28mm-hx3g","aliases":["CVE-2026-118652","GO-2026-6876"],"title":"Echo vulnerable to Reflected Cross-Site Scripting (XSS) via unsanitized JSONP callback in Context.JSONP / Context.JSONPBlob","description":"### Summary\n\nThe `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**.  \n\nThis 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.\n\n**Present in current master and v5.1.0 (latest release).**\n\n### Vulnerable Code (verbatim)\n\n```go\nfunc (c *Context) jsonPBlob(code int, callback string, i any) (err error) {\n\tc.writeContentType(MIMEApplicationJavaScriptCharsetUTF8)\n\tc.response.WriteHeader(code)\n\tif _, err = c.response.Write([]byte(callback + \"(\")); err != nil {\n\t\treturn\n\t}\n\tif err = c.echo.JSONSerializer.Serialize(c, i, \"\"); err != nil {\n\t\treturn\n\t}\n\tif _, err = c.response.Write([]byte(\");\")); err != nil {\n\t\treturn\n\t}\n\treturn\n}\n\nfunc (c *Context) JSONP(code int, callback string, i any) (err error) {\n\treturn c.jsonPBlob(code, callback, i)\n}\n\nfunc (c *Context) JSONPBlob(code int, callback string, b []byte) (err error) {\n\tc.writeContentType(MIMEApplicationJavaScriptCharsetUTF8)\n\tc.response.WriteHeader(code)\n\tif _, err = c.response.Write([]byte(callback + \"(\")); err != nil {\n\t\treturn\n\t}\n\tif _, err = c.response.Write(b); err != nil {\n\t\treturn\n\t}\n\t_, err = c.response.Write([]byte(\");\"))\n\treturn\n}\n```\nNo sanitization is performed on the callback string.\n\n### Exploit (one-request repro)\nAny route using the official pattern is vulnerable:\n```\nGoe.GET(\"/api\", func(c echo.Context) error {\n    return c.JSONP(200, c.QueryParam(\"callback\"), map[string]string{\"status\": \"ok\"})\n})\n```\nAttacker request:\n```\nGET /api?callback=alert(document.domain)%2f%2f HTTP/1.1\nHost: target.com\n```\nServer response:\n```\nContent-Type: application/javascript; charset=utf-8\n\nalert(document.domain)//({\"status\":\"ok\"});\n```\n→ Immediate arbitrary JavaScript execution (full reflected XSS).\n### Impact\n\n- Session hijacking, cookie theft, account takeover, keylogging, defacement.\n- Works even with strict CSP (response is served as application/javascript).\n\n#### Affected Versions\n\n- All versions ≤ v5.1.0 (including current master)\n\n#### Workarounds\nManually sanitize the callback before calling JSONP/JSONPBlob:\n```\nGofunc safeCallback(cb string) string {\n    if matched, _ := regexp.MatchString(`^[a-zA-Z0-9_.\\[\\]]+$`, cb); !matched {\n        return \"callback\"\n    }\n    return cb\n}\n```\nOr migrate away from JSONP entirely (use CORS + application/json).\n### References\n\n- https://github.com/labstack/echo/blob/master/context.go\n- https://echo.labstack.com/docs/cookbook/jsonp\n\n## Patches\n\nFixed in `github.com/labstack/echo/v5` v5.4.0 and `github.com/labstack/echo/v4` v4.16.0. `Context.JSONP` and `Context.JSONPBlob` accept only a callback that is empty, a JavaScript identifier or a dot-separated path of identifiers (ASCII letters, digits, `_` and `$`); any other callback returns a 400 Bad Request error wrapping `ErrInvalidJSONPCallback` and nothing is written. JSONP responses also carry `X-Content-Type-Options: nosniff`.\n\n## Workarounds\n\nValidate 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.","state":0,"publishedAt":"2026-10-28T19:54:05+00:00","modifiedAt":"2026-11-05T23:26:16.3389988+00:00","affected":[{"ecosystem":"Go","name":"github.com/labstack/echo/v5","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"5.4.0"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"Go","name":"github.com/labstack/echo/v4","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"4.16.0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/labstack/echo/security/advisories/GHSA-h9g5-28mm-hx3g","https://github.com/labstack/echo/commit/b838391e2eade87ae7e5a09d7bb5087bec271ec1","https://github.com/labstack/echo/commit/fc410094b2f3415cf2bf5204082137b205bfd5af","https://github.com/labstack/echo","https://github.com/labstack/echo/releases/tag/v4.16.0","https://github.com/labstack/echo/releases/tag/v5.4.0"],"sourceUrl":"https://github.com/advisories/GHSA-h9g5-28mm-hx3g","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-h9g5-28mm-hx3g","identifiers":["GHSA-h9g5-28mm-hx3g","CVE-2026-118652","GO-2026-6876"]},"retained":false,"historicalAffected":[]},{"revision":"6388204fa4a34e71b15661cd383d521d","observedAt":"2026-11-05T23:38:32.248+00:00","statement":{"source":"osv","id":"GO-2026-6876","aliases":["CVE-2026-118652","GHSA-h9g5-28mm-hx3g"],"title":"Cross-Site Scripting (XSS) via unsanitized JSONP callback in github.com/labstack/echo","description":"Cross-Site Scripting (XSS) via unsanitized JSONP callback in github.com/labstack/echo","state":0,"publishedAt":"2026-11-05T22:54:32+00:00","modifiedAt":"2026-11-05T23:15:15.4613234+00:00","affected":[{"ecosystem":"Go","name":"github.com/labstack/echo/v4","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"4.16.0"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"Go","name":"github.com/labstack/echo/v5","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"5.4.0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[],"references":["https://github.com/labstack/echo/security/advisories/GHSA-h9g5-28mm-hx3g","https://github.com/labstack/echo/commit/b838391e2eade87ae7e5a09d7bb5087bec271ec1","https://github.com/labstack/echo/commit/fc410094b2f3415cf2bf5204082137b205bfd5af","https://github.com/labstack/echo/releases/tag/v4.16.0","https://github.com/labstack/echo/releases/tag/v5.4.0"],"sourceUrl":"https://osv.dev/vulnerability/GO-2026-6876","license":"OSV · upstream source license applies","key":"osv:GO-2026-6876","identifiers":["GO-2026-6876","CVE-2026-118652","GHSA-h9g5-28mm-hx3g"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-11-17T06:29:38.2958139+00:00","complete":true,"records":1781,"lastAttemptAt":"2026-11-17T06:29:38.2958139+00:00","lastSuccessAt":"2026-11-17T06:29:41.2543024+00:00","error":null,"lastVerifiedAt":"2026-11-17T06:29:41.2543032+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-30c3da459c38698a15d626d89e52e03e55e19fc45dae0e6d8d723cbf35472cf4-9c90debbc1f8950b3c0f1d5a421574a28f1b0b2fa45e289f49fdf2a8e9fb3901","complete":true,"records":426272,"lastAttemptAt":"2026-11-17T06:25:59.4634811+00:00","lastSuccessAt":"2026-11-17T05:26:09.3579252+00:00","error":null,"lastVerifiedAt":"2026-11-17T06:25:59.4634811+00:00","snapshotPublishedAt":"2026-11-17T05:19:51+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-0c65521bf68f4e32a6056cdacec309eb","complete":false,"records":13836,"lastAttemptAt":"2026-11-17T06:40:28.6106863+00:00","lastSuccessAt":"2026-11-17T06:40:28.606+00:00","error":"71 identifier lookups failed; latest failures include AccessDenied (HTTP 403). Other identifiers were checked independently.","lastVerifiedAt":"2026-11-17T06:40:28.606+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13442,"expectedIdentifiers":13890,"failedIdentifiers":71},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-11-17T06:29:38.2958139+00:00","complete":true,"records":1125,"lastAttemptAt":"2026-11-17T06:29:38.2958139+00:00","lastSuccessAt":"2026-11-17T06:29:41.2602594+00:00","error":null,"lastVerifiedAt":"2026-11-17T06:29:41.2602635+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-4d28621da3eb492ea48a120da4fcdb58","complete":true,"records":13849,"lastAttemptAt":"2026-11-17T06:29:44.6841344+00:00","lastSuccessAt":"2026-11-17T06:29:44.673+00:00","error":null,"lastVerifiedAt":"2026-11-17T06:29:44.673+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13890,"expectedIdentifiers":13890,"failedIdentifiers":0},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-db3ae05f3e19425298b475ceb81e33f22d67df93dfef77c2b0200c8b05fd85ae","complete":true,"records":9958,"lastAttemptAt":"2026-11-17T06:29:38.1094421+00:00","lastSuccessAt":"2026-11-16T23:31:31.5526753+00:00","error":null,"lastVerifiedAt":"2026-11-17T06:29:38.1094421+00:00","snapshotPublishedAt":"2026-11-16T22:48:36+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-f4424d7d4861b1af1404bd15abcb83f295dcd003412a9340ca99dc8200aa148a","complete":true,"records":2014,"lastAttemptAt":"2026-11-17T06:26:00.5062256+00:00","lastSuccessAt":"2026-11-13T19:57:08.2864435+00:00","error":null,"lastVerifiedAt":"2026-11-17T06:26:00.5062256+00:00","snapshotPublishedAt":"2026-11-13T19:33:10+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-6086d649bcb454cdf302d7d9275177bda73550e1b6e446b3520e9b6266d3582c","complete":true,"records":3148,"lastAttemptAt":"2026-11-17T06:29:38.2380461+00:00","lastSuccessAt":"2026-11-15T11:05:17.1034234+00:00","error":null,"lastVerifiedAt":"2026-11-17T06:29:38.2380461+00:00","snapshotPublishedAt":"2026-11-15T10:03:04+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-d2be9f4bf5c8eefd1f37fa3a7150771a6fadcf6ec7b00f77182b082af7ca8a09","complete":true,"records":232592,"lastAttemptAt":"2026-11-17T06:29:37.3616984+00:00","lastSuccessAt":"2026-11-17T06:29:36.4291644+00:00","error":null,"lastVerifiedAt":"2026-11-17T06:29:37.3616984+00:00","snapshotPublishedAt":"2026-11-17T06:03:42+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}