Vulnerabilities

Vulnerability · CVE-2026-40470

Hackage package and doc upload stored XSS vulnerability

Published Jan 16, 2026 · catalog updated Jun 17, 2026 · Hackage package and doc

Check if you run it

No confirmed exploitation is on record for CVE-2026-40470. EPSS is 0.43%. Act only if a listed version of Hackage package and doc is installed.

Gaps on this record

  • The stored product name is a package slug. The name on this page is taken from the title (Hackage package and doc).
  • No vendor fix or required action is stored. Compare the linked advisory before you change production.
Severity
Critical9.9
Known exploitation
Not in CISA/VulnCheck KEV
EPSS
0.43%
Remediation
Not established
Affected products
Hackage hackage-server

# 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

Are you affected?

Enter the version you run. The result uses only the ranges stored on this record.

The check returns affected, not affected, or incomplete. It does not guess a version that is missing from the record.

  • Hackage hackage-server0.1 → 0.6

How to fix CVE-2026-40470

What to do

Three questions, each answered from this record only. Confirm the vendor advisory before you patch.

Should you patch?

No confirmed exploitation is on record for CVE-2026-40470. EPSS is 0.43%. Act only if a listed version of Hackage package and doc is installed.

Which versions are affected?

Compare what you have installed with 0.1 → 0.6. Compare the installed version with the linked vendor advisory before you change production.

What should an analyst verify?

CWE-79: Cross-site Scripting (XSS). EPSS 0.43%. There is no CISA KEV listing. No Exploit-DB or Metasploit reference is linked. Use the source links for the original advisory.

Code

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

Timeline

Detection, updates, and resolution for this record.

  1. Jan 16, 2026 · OpenSSF OSV / OSV Scanner

    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 · OpenSSF OSV / OSV Scanner

    Fix available

    hackage-server fixed in 0.6

  3. Apr 14, 2026 · OpenSSF OSV / OSV Scanner

    Fix available

    hackage-server fixed in 0.6

  4. Apr 14, 2026 · OpenSSF OSV / OSV Scanner

    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

Sources

  • CVE.orgVulnerability recordCVE-2026-40470

    Official CVE identifier

    cve.org
  • FIRST EPSSExploitation probabilityCVE-2026-40470

    30-day exploitation probability 0.4%

    first.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
  • OpenSSF OSV / OSV ScannerPackage advisoryHSEC-2024-0004

    Hackage package and doc upload stored XSS vulnerability

    osv.dev

References

Freshness

Last verified in this catalog Oct 18, 2026. Significant claims (KEV, EPSS, CVSS, affected ranges) come from the source rows above — open the original publisher for the authoritative advisory.