Findings

CVE-2026-40470

Hackage package and doc upload stored XSS vulnerability

Published Jan 16, 2026 · updated Jun 17, 2026

# Hackage package and doc upload stored XSS vulnerability *Author: Fraser Tweedale (Haskell SRT)* ## Executive summary A **critical XSS vulnerability** affected *hackage-server* and . HTML and JavaScript files provided in source packages or via the documentation upload facility were served *as-is* on the main domain. As a consequence, when a user with latent HTTP credentials browses to the package pages or documentation uploaded by a malicious package maintainer, their **session can be hijacked** to upload packages or documentation, amend maintainers or other package metadata, or perform any other action the user is authorised to do. This issue was discovered and reported to the Haskell Security Response Team (SRT) in June 2024. Remediations were progressively developed and deployed throughout 2025. **The known issues have been fully mitigated on as of January 2026.** The mitigations involve serving user content from a sister domain. In the case of , this domain is . Operators of other *hackage-server* instances should update to the branch from the upstream repository (https://github.com/haskell/hackage-server; commit or later), and configure the user content domain (new flag ). ## Scope of the issue ### Package documentation uploads Any Hackage user can upload documentation bundles for the packages they own. Typically those are prepared by Haddock, but they may be customised or modified. Malicious code can be delivered in several ways: - In JavaScript files loaded by an HTML page; - In tags on an HTML page; - In action attributes (e.g. ) on an HTML page. ### JavaScript In addition to the supplied HTML pages, parts of the uploaded documentation bundle are referenced from the main package page (and candidate pages)—in particular, , which implements the "quick jump" feature, and the corresponding CSS file (CSS can also present an XSS risk). These files are included by the following templates: - - It is loaded via a tag: ### Source tarball browsing HTML content in the

Code

The project this record applies to. Exploit listings stay in References.

Timeline

Detection, updates, and resolution for this record.

  1. Jan 16, 2026 · OSV.dev

    Detected

    # Hackage package and doc upload stored XSS vulnerability *Author: Fraser Tweedale (Haskell SRT)* ## Executive summary A **critical XSS vulnerability** affected *hackage-server* and . HTML and JavaScript files provided in source packages or via the documentation upload facility were served *as-is* on the main domain. As a consequence, when a user with latent HTTP credentials browses to the package

  2. Apr 14, 2026 · OSV.dev

    Fix available

    hackage-server fixed in 0.6

  3. Apr 14, 2026 · OSV.dev

    Fix available

    hackage-server fixed in 0.6

  4. Apr 14, 2026 · OSV.dev

    Updated

    # Hackage package and doc upload stored XSS vulnerability *Author: Fraser Tweedale (Haskell SRT)* ## Executive summary A **critical XSS vulnerability** affected *hackage-server* and . HTML and JavaScript files provided in source packages or via the documentation upload facility were served *as-is* on the main domain. As a consequence, when a user with latent HTTP credentials browses to the package

  5. Jun 17, 2026 · NIST NVD

    Updated

    A critical XSS vulnerability affected hackage-server and hackage.haskell.org. HTML and JavaScript files provided in source packages or via the documentation upload facility were served as-is on the main hackage.haskell.org domain. As a consequence, when a user with latent HTTP credentials browses to the package pages or documentation uploaded by a malicious package maintainer, their session can be

Affected

  • Hackage hackage-server0.1 → 0.6

Sources

  • CVE.orgVulnerability recordCVE-2026-40470

    Official CVE identifier

    cve.org
  • NIST NVDVulnerability recordCVE-2026-40470

    A critical XSS vulnerability affected hackage-server and hackage.haskell.org. HTML and JavaScript files provided in source packages or via the documentation upload facility were served as-is on the main hackage.haskell.org domain. As a consequence, when a user with latent HTTP

    nvd.nist.gov
  • OSV.devPackage advisoryHSEC-2024-0004

    Hackage package and doc upload stored XSS vulnerability

    osv.dev

References

CVE-2026-40470 · ZeroDay Findings