src/Distribution/Server/Features/Votes.hs (example)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.
hackage.haskell.org.{
"home": "https://github.com/haskell/security-advisories",
"osvs": "https://raw.githubusercontent.com/haskell/security-advisories/refs/heads/generated/osv-export",
"repository": "https://github.com/haskell/security-advisories"
}"https://github.com/haskell/security-advisories/blob/generated/osv-export/2026/HSEC-2026-0002.json"
"https://raw.githubusercontent.com/haskell/security-advisories/refs/heads/generated/osv-export/2026/HSEC-2026-0002.json"
"https://github.com/haskell/security-advisories/tree/main/advisories/published/2026/HSEC-2026-0002.md"