CVE-2026-40471
JSON

9.6critical

Hackage CSRF vulnerability

Severity
9.6critical CVSS:3.1 by redhat-cnalr
Exploit likelihood
0.14% (higher than 3% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
redhat-cnalr
Also known as
HSEC-2026-0002

Description

hackage-server lacked Cross-Site Request Forgery (CSRF) protection across its endpoints. Scripts on foreign sites could trigger requests to hackage server, possibly abusing latent credentials to upload packages or perform other administrative actions. Some unauthenticated actions could also be abused (e.g. creating new user accounts).

Affected

Product or packageVersionsReported by
hackage-serverfrom 0.1 before *CVE List
hackage-server (Hackage)from 0.1Haskell Security Advisories

Classification

CWE-352

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

What each source says

CVE List

hackage-server lacked Cross-Site Request Forgery (CSRF) protection across its endpoints. Scripts on foreign sites could trigger requests to hackage server, possibly abusing latent credentials to upload packages or perform other administrative actions. Some unauthenticated actions could also be abused (e.g. creating new user accounts).

Haskell Security Advisories

Hackage CSRF vulnerability

  • Vulnerable File: src/Distribution/Server/Features/Votes.hs (example)
  • Impact: can forge requests through XSS

hackage-server lacked Cross-Site Request Forgery (CSRF) protection across its endpoints. Scripts on foreign sites could trigger requests to hackage server, possibly abusing latent credentials to upload packages or perform other administrative actions. Some unauthenticated actions could also be abused (e.g. creating new user accounts).

To fix the issue, a new CSRF middleware checks all requests. Requests using HTTP methods other than GET, HEAD and OPTIONS are subject to a check of the Sec-Fetch-Site header, which is widely supported by modern browsers. Cross-site requests are 403 Forbidden. Certain approved and expected non-browser user agents (e.g. cabal-install/*) are exempted from the check, as are requests using token authentication (Authorization: X-ApiKey ...).

The fix has been committed and deployed on hackage.haskell.org.

Acknowledgements

  • Joshua Rogers (https://joshua.hu/) of AISLE (https://aisle.com/) reported the issue to the Haskell Security Response Team.
  • Spenser Janssen implemented the fix, and Fraser Tweedale reviewed it.
  • Gershom Bazerman merged the fix and deployed it to hackage.haskell.org.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-40471 changed 2026-04-23CVE Terms of Use
Haskell Security AdvisoriesHSEC-2026-0002 changed 2026-04-14CC0-1.0
NVDCVE-2026-40471 changed 2026-06-17Public domain