{"id":"CVE-2026-26022","aliases":["CVE-2026-26022","GHSA-xrcr-gmf5-2r8j","GO-2026-4620"],"related":[],"kind":"vulnerability","state":"published","title":"Gogs: Stored XSS via data URI in issue comments","summary":"Gogs is an open source self-hosted Git service. Prior to version 0.14.2, a stored cross-site scripting (XSS) vulnerability exists in the comment and issue description functionality. The application's HTML sanitizer explicitly allows data: URI schemes, enabling authenticated users to inject arbitrary JavaScript execution via malicious links. This issue has been patched in version 0.14.2.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Gogs is an open source self-hosted Git service. Prior to version 0.14.2, a stored cross-site scripting (XSS) vulnerability exists in the comment and issue description functionality. The application's HTML sanitizer explicitly allows data: URI schemes, enabling authenticated users to inject arbitrary JavaScript execution via malicious links. This issue has been patched in version 0.14.2.","source":"cvelist"},{"lang":"en","text":"### Summary\nA Stored Cross-site Scripting (XSS) vulnerability exists in the comment and issue description functionality. The application's HTML sanitizer explicitly allows `data:` URI schemes, enabling authenticated users to inject arbitrary JavaScript execution via malicious links.\n\n### Details\nThe vulnerability is located in `internal/markup/sanitizer.go`. The application uses the `bluemonday` HTML sanitizer but explicitly weakens the security policy by allowing the `data` URL scheme:\n\n```go\n// internal/markup/sanitizer.go\nfunc NewSanitizer() {\n    sanitizer.init.Do(func() {\n        // ...\n        // Data URLs\n        sanitizer.policy.AllowURLSchemes(\"data\")\n        // ...\n    })\n}\n```\n\nWhile the Markdown renderer rewrites relative links (mitigating standard Markdown `[link](data:...)` attacks), Gogs supports **Raw HTML** input. Raw HTML anchor tags bypass the Markdown parser's link rewriting and are processed directly by the sanitizer. Since the sanitizer is configured to allow `data:` URIs, payloads like `<a href=\"data:text/html...\">` are rendered as-is.\n\n### PoC\n1.  Create a file named `exploit.md` in a repository.\n2.  Add the following content (Raw HTML):\n    ```html\n    <a href=\"data:text/html;base64,PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4=\">Click me for XSS</a>\n    ```\n3.  Commit and push the file.\n4.  Navigate to the file in the Gogs web interface.\n5.  Click the \"Click me for XSS\" link.\n6.  **Result:** An alert box with \"XSS\" appears, executing the JavaScript payload.\n\n### Impact\nThis is a **Stored XSS** vulnerability. Any user who views the malicious comment and clicks the link will execute the attacker-supplied JavaScript in their browser context. This allows attackers to:\n*   Steal authentication cookies and session tokens.\n*   Perform arbitrary actions on behalf of the victim (e.g., modifying repositories, adding collaborators).\n*   Redirect users to malicious sites.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Gogs: Stored XSS via data URI in issue comments in gogs.io/gogs.\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: gogs.io/gogs before v0.14.2.","format":"markdown","source":"go"},{"lang":"es","text":"Gogs es un servicio Git autoalojado de código abierto. Antes de la versión 0.14.2, existe una vulnerabilidad de cross-site scripting (XSS) almacenado en la funcionalidad de comentarios y descripción de incidencias. El saneador HTML de la aplicación permite explícitamente esquemas URI data:, permitiendo a usuarios autenticados inyectar ejecución arbitraria de JavaScript a través de enlaces maliciosos. Este problema ha sido parcheado en la versión 0.14.2.","source":"nvd"}],"published":"2026-03-05T18:34:12.843Z","modified":"2026-06-17T10:25:36.953Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N","score":8.7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N","score":8.7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N","score":8.7,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"< 0.14.2","status":"affected"}],"vendor":"gogs","product":"gogs","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.14.2"}],"ecosystem":"Go","package":"gogs.io/gogs","purl":"pkg:golang/gogs.io/gogs","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"gogs.io/gogs","purl":"pkg:golang/gogs.io/gogs","source":"go"},{"ranges":[{"status":"affected","fixed":"0.14.2"}],"vendor":"gogs","product":"gogs","cpe":"cpe:2.3:a:gogs:gogs:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/gogs/gogs/security/advisories/GHSA-xrcr-gmf5-2r8j","tags":["advisory","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/gogs/gogs/pull/8174","tags":["issue-tracking","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/gogs/gogs/commit/441c64d7bd8893b2f4e48660a8be3a7472e14291","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/gogs/gogs/releases/tag/v0.14.2","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-26022","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/gogs/gogs","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-03-06T00:00:00.000Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-26022","url":"https://www.cve.org/CVERecord?id=CVE-2026-26022","licence":"CVE Terms of Use","modified":"2026-03-10T03:55:24.998Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-xrcr-gmf5-2r8j","url":"https://github.com/advisories/GHSA-xrcr-gmf5-2r8j","licence":"CC-BY-4.0","modified":"2026-03-23T04:56:09.965Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-4620","url":"https://pkg.go.dev/vuln/GO-2026-4620","licence":"CC-BY-4.0","modified":"2026-03-23T04:53:16.958Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-26022","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-26022","licence":"Public domain","modified":"2026-06-17T10:25:36.953Z"}],"updatedAt":"2026-11-25T22:59:15.321Z","epss":{"score":0.00535,"percentile":0.38669,"date":"2026-11-29T12:00:22.000Z"}}