{"id":"CVE-2026-40472","aliases":["CVE-2026-40472","HSEC-2026-0004"],"related":[],"kind":"vulnerability","state":"published","title":"Hackage package metadata stored XSS vulnerability","summary":"In hackage-server, user-controlled metadata from .cabal files are rendered into HTML\nhref attributes without proper sanitization, enabling stored\nCross-Site Scripting (XSS) attacks.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In hackage-server, user-controlled metadata from .cabal files are rendered into HTML\nhref attributes without proper sanitization, enabling stored\nCross-Site Scripting (XSS) attacks.","source":"cvelist"},{"lang":"en","text":"# Hackage package metadata stored XSS vulnerability\n\nUser-controlled metadata from `.cabal` files are rendered into HTML\n`href` attributes without proper sanitization, enabling stored\nCross-Site Scripting (XSS) attacks.  The specific fields affected\nare:\n\n- `homepage`\n- `bug-reports`\n- `source-repository.location`\n- `description` (Haddock hyperlinks)\n\nThe Haskell Security Response Team audited the entire corpus of\n**published** packages on `hackage.haskell.org`—all published\npackage versions but *not* candidates.  No exploitation attempts\nwere detected.\n\nTo fix the issue, *hackage-server* now inspects target URIs and only\nproduces a hyperlink when the URI has an approved scheme: `http`,\n`https`, and (only for some fields) `mailto`.\n\nThe fix has been [committed][commit] and deployed on\n`hackage.haskell.org`.  Other operations of *hackage-server*\ninstances should update as soon as possible to commit\n`2de3ae45082f8f3f29a41f6aff620d09d0e74058` or later.\n\n## Acknowledgements\n\n- **Joshua Rogers** (https://joshua.hu/) of AISLE\n  (https://aisle.com/) reported the issue to the Haskell Security\n  Response Team.\n- **Fraser Tweedale** implemented the fix.\n- **Gershom Bazerman** merged the fix and deployed it to\n  `hackage.haskell.org`.\n\n[commit]: https://github.com/haskell/hackage-server/commit/2de3ae45082f8f3f29a41f6aff620d09d0e74058","format":"markdown","source":"hsec"}],"published":"2026-03-28T16:05:12.000Z","modified":"2026-06-17T10:45:20.490Z","severity":{"scorer":"redhat-cnalr","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:L","score":9.9,"rating":"CRITICAL"},"severities":[{"scorer":"redhat-cnalr","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:L","score":9.9,"rating":"CRITICAL"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"type":"semver","introduced":"0.1","fixed":"*","status":"affected"}],"package":"hackage-server","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0.1","status":"affected"}],"ecosystem":"Hackage","package":"hackage-server","purl":"pkg:hackage/hackage-server","source":"hsec"}],"references":[{"url":"https://osv.dev/vulnerability/HSEC-2026-0004","tags":[],"sources":["cvelist","nvd"]},{"url":"https://github.com/haskell/hackage-server/commit/2de3ae45082f8f3f29a41f6aff620d09d0e74058","tags":["fix"],"sources":["hsec"]}],"credits":[],"assigner":"redhat-cnalr","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-04-23T16:15:39.611Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-40472","url":"https://www.cve.org/CVERecord?id=CVE-2026-40472","licence":"CVE Terms of Use","modified":"2026-04-23T16:22:06.841Z"},{"source":"hsec","name":"Haskell Security Advisories","id":"HSEC-2026-0004","url":"https://osv.dev/vulnerability/HSEC-2026-0004","licence":"CC0-1.0","modified":"2026-04-14T18:05:13.142Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-40472","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40472","licence":"Public domain","modified":"2026-06-17T10:45:20.490Z"}],"updatedAt":"2026-11-25T22:59:19.392Z","epss":{"score":0.00315,"percentile":0.26309,"date":"2026-12-01T12:00:22.000Z"}}