HSEC-2026-0002 (CVE-2026-40471)
Vulnerability from osv_haskell – Published: 2026-03-28 16:04 – Updated: 2026-03-28 16:04 – Source websiteHackage 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.
| URL | Type | |
|---|---|---|
{
"affected": [
{
"database_specific": {
"human_link": "https://github.com/haskell/security-advisories/tree/main/advisories/published/2026/HSEC-2026-0002.md",
"osv": "https://raw.githubusercontent.com/haskell/security-advisories/refs/heads/generated/osv-export/2026/HSEC-2026-0002.json"
},
"package": {
"ecosystem": "Hackage",
"name": "hackage-server"
},
"ranges": [
{
"events": [
{
"introduced": "0.1"
}
],
"type": "ECOSYSTEM"
}
],
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:L",
"type": "CVSS_V3"
}
]
}
],
"aliases": [
"CVE-2026-40471"
],
"database_specific": {
"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"
},
"details": "# Hackage CSRF vulnerability\n\n* Vulnerable File: `src/Distribution/Server/Features/Votes.hs` (example)\n* Impact: can forge requests through XSS\n\nhackage-server lacked Cross-Site Request Forgery (CSRF) protection\nacross its endpoints. Scripts on foreign sites could trigger\nrequests to hackage server, possibly abusing latent credentials to\nupload packages or perform other administrative actions. Some\nunauthenticated actions could also be abused (e.g. creating new user\naccounts).\n\nTo fix the issue, a new CSRF middleware checks all requests.\nRequests using HTTP methods other than `GET`, `HEAD` and `OPTIONS`\nare subject to a check of the [`Sec-Fetch-Site`\nheader][sec-fetch-site], which is [widely supported by modern\nbrowsers][caniuse-sec-fetch-site]. Cross-site requests are `403\nForbidden`. Certain approved and expected non-browser user agents\n(e.g. `cabal-install/*`) are exempted from the check, as are\nrequests using token authentication (`Authorization: X-ApiKey ...`).\n\nThe fix has been [committed][commit] and deployed on\n`hackage.haskell.org`.\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- **Spenser Janssen** implemented the fix, and **Fraser Tweedale**\n reviewed it.\n- **Gershom Bazerman** merged the fix and deployed it to\n `hackage.haskell.org`.\n\n[sec-fetch-site]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-Fetch-Site\n[caniuse-sec-fetch-site]: https://caniuse.com/?search=sec-fetch-site\n[commit]: https://github.com/haskell/hackage-server/commit/2de3ae45082f8f3f29a41f6aff620d09d0e74058\n",
"id": "HSEC-2026-0002",
"modified": "2026-03-28T16:04:58Z",
"published": "2026-03-28T16:04:58Z",
"references": [
{
"type": "FIX",
"url": "https://github.com/haskell/hackage-server/commit/2de3ae45082f8f3f29a41f6aff620d09d0e74058"
}
],
"schema_version": "1.5.0",
"summary": "Hackage CSRF vulnerability"
}
Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline
Sightings and recorded dates, grouped by day · UTC
How durations are calculated
Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation.
Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.
Loading timeline…
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.