Critical XSS in hackage-server via Malicious .cabal Metadata

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.
🛡️ Am I exposed to this? Get detection rules for CVE-2026-40472 — Splunk, Sentinel, Elastic, QRadar & more

Related ATT&CK Techniques

🛡️ Detection Rules

3 rules · 6 SIEM formats

3 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.

critical T1190 Initial Access

CVE-2026-40472 - Malicious .cabal Metadata XSS in hackage-server

Sigma YAML — free preview
✓ Sigma · Splunk SPL Sentinel KQL Elastic QRadar AQL Wazuh Get rules for your SIEM →

Indicators of Compromise

IDTypeIndicator
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 PlatformNVD
ChannelNational Vulnerability Database
PublishedApril 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.

Related Posts

CVE-2026-41239 — Cross-Site Scripting (XSS)

CVE-2026-41239 — DOMPurify is a DOM-only cross-site scripting sanitizer for HTML, MathML, and SVG. Starting in version 1.0.10 and prior to version 3.4.0, `SAFE_FOR_TEMPLATES` strips...

vulnerabilityCVEmedium-severitycross-site-scripting-xsscwe-79cwe-1289
/SCW Vulnerability Desk /MEDIUM /6.8 /⚑ 3 IOCs /⚙ 3 Sigma

CVE-2026-41238 — Cross-Site Scripting (XSS)

CVE-2026-41238 — DOMPurify is a DOM-only cross-site scripting sanitizer for HTML, MathML, and SVG. Versions 3.0.1 through 3.3.3 are vulnerable to a prototype pollution-based XSS...

vulnerabilityCVEmedium-severitycross-site-scripting-xsscwe-79cwe-1321
/SCW Vulnerability Desk /MEDIUM /6.9 /⚑ 3 IOCs /⚙ 3 Sigma

Critical CSRF Flaw in hackage-server Poses Supply Chain Risk

CVE-2026-40471 — 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...

vulnerabilityCVEcriticalhigh-severitycwe-352
/SCW Vulnerability Desk /CRITICAL /9.6 /⚑ 3 IOCs /⚙ 3 Sigma