Critical XSS in hackage-server via Malicious .cabal Metadata
The National Vulnerability Database has disclosed CVE-2026-40472, a critical stored Cross-Site Scripting (XSS) vulnerability impacting hackage-server. This flaw, rated 9.9 CVSS, allows attackers to inject malicious code into HTML href attributes by manipulating user-controlled metadata within .cabal files. The lack of proper sanitization means that when these .cabal files are processed and rendered, the embedded scripts execute in the context of other users’ browsers.
This isn’t just a theoretical bug; it’s a direct avenue for highly impactful attacks. A successful exploitation could lead to session hijacking, data theft, or defacement of the hackage-server interface for anyone viewing the malicious package. The attacker’s calculus here is simple: craft a poisoned .cabal file, publish it, and wait for unsuspecting developers or users to browse the package details. Given the nature of package repositories, this vector is particularly insidious because it leverages trust in the ecosystem itself.
For defenders, the message is clear: if your development pipeline or internal systems interact with or host hackage-server, prioritize patching. This is a supply chain risk through and through. Attackers frequently target development infrastructure to pivot into broader environments. Ensure all inputs, especially user-controlled metadata, are rigorously sanitized before rendering to prevent such injection flaws.
What This Means For You
- If your organization uses or hosts `hackage-server` for Haskell package management, you are exposed. This critical XSS (CVE-2026-40472) means a malicious package could compromise anyone browsing your repository. Immediately verify your `hackage-server` version and apply any available patches or workarounds to prevent stored XSS attacks via `.cabal` file metadata.
Related ATT&CK Techniques
🛡️ Detection Rules
3 rules · 6 SIEM formats3 detection rules auto-generated for this incident, mapped to MITRE ATT&CK. Sigma YAML is free — export to any SIEM format via the Intel Bot.
CVE-2026-40472 - Malicious .cabal Metadata XSS in hackage-server
Indicators of Compromise
| ID | Type | Indicator |
|---|---|---|
| CVE-2026-40472 | XSS | hackage-server |
| CVE-2026-40472 | XSS | Stored Cross-Site Scripting via .cabal files metadata |
| CVE-2026-40472 | XSS | HTML href attributes without proper sanitization |
Source & Attribution
| Source Platform | NVD |
| Channel | National Vulnerability Database |
| Published | April 23, 2026 at 19:16 UTC |
This content was AI-rewritten and enriched by Shimi's Cyber World based on the original source. All intellectual property rights remain with the original author.
Believe this infringes your rights? Submit a takedown request.