{"id":"CVE-2026-40472","aliases":["EUVD-2026-25235","GHSA-8fw8-47cx-j4q4","HSEC-2026-0004"],"status":"published","title":"Hackage package metadata stored XSS vulnerability","description":"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.","severity":{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:L","level":"critical","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.00303,"percentile":0.23207,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":false},"cwes":["CWE-79"],"published":"2026-03-28T16:05:12Z","modified":"2026-06-17T10:45:20Z","affected":[{"source":"osv","ecosystem":"Hackage","package":"hackage-server","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.1"}]}],"versions":["0.4","0.5.0"]}],"references":[{"url":"https://osv.dev/vulnerability/HSEC-2026-0004"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40472"},{"url":"https://github.com/advisories/GHSA-8fw8-47cx-j4q4"},{"url":"https://github.com/haskell/hackage-server/commit/2de3ae45082f8f3f29a41f6aff620d09d0e74058","tags":["fix"]}],"sources":{"cve":[{"id":"CVE-2026-40472","title":"Hackage package metadata stored XSS vulnerability","description":"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.","status":"published","published":"2026-04-23T15:00:09.063Z","modified":"2026-04-23T16:22:06.841Z","cvss":[{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:L","level":"critical","assessor":"cna"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T13:43:11.445168Z"}],"euvd":[{"id":"EUVD-2026-25235","description":"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.","status":"published","published":"2026-04-23T15:00:09Z","modified":"2026-04-23T16:22:06Z","cvss":[{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:L","level":"critical"}],"updated_at":"2026-11-02T19:24:19.171803Z"}],"ghsa":[{"id":"GHSA-8fw8-47cx-j4q4","title":"In hackage-server, user-controlled metadata from .cabal files are rendered into HTML\nhref...","description":"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.","status":"published","published":"2026-04-23T18:33:03Z","modified":"2026-04-23T18:33:23Z","cvss":[{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:L","level":"critical"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T15:07:36.455512Z"}],"nvd":[{"id":"CVE-2026-40472","description":"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.","status":"published","published":"2026-04-23T16:16:25.753Z","modified":"2026-06-17T10:45:20.49Z","cvss":[{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:L","level":"critical","assessor":"secondary"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:12:15.867234Z"}],"osv":[{"id":"HSEC-2026-0004","title":"Hackage package metadata stored XSS vulnerability","description":"# 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\n","status":"published","published":"2026-03-28T16:05:12Z","modified":"2026-04-14T18:05:13.142186Z","updated_at":"2026-11-02T15:47:17.805107Z"}]}}
