Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessRegister maintainer account
-
DeliveryUpload package with malicious HTML/JS
-
ExploitPayload served from hackage.haskell.org origin
-
ExecutionAuthenticated victim browses the page
-
PersistScript hijacks victim's session
-
ImpactAdd maintainer or upload trojanized package
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires the attacker to hold a valid Hackage account with permission to upload a source package or use the documentation upload facility (PR:L / authenticated maintainer) and to embed HTML or JavaScript in that upload, which is then served as-is on the main hackage.haskell.org domain. The attack only succeeds when a victim who has latent/active HTTP credentials for hackage.haskell.org browses to the attacker-controlled package or documentation page - so it is limited by the need for an authenticated victim to visit the malicious content (effectively user interaction) and by the payload being served from the vulnerable same-origin configuration. The impact is bounded by whatever actions the victim is authorized to perform (higher for admins/maintainers). |
| Impact | The signals here are notably split. CVSS 3.1 rates this 9.9 (AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:L) driven by the scope change and high confidentiality/integrity impact, and SSVC marks Technical Impact as 'total' - consistent with full account/session takeover. However, SSVC also records Exploitation: none and Automatable: no, and EPSS is only 0.05% (14th percentile), indicating this is not a mass-scannable, worm-style flaw. Exploitation is not automatable because it requires an attacker to hold a maintainer account, plant a payload, and then wait for a specifically-authenticated victim to browse the malicious page - a targeted, social-graph-dependent path rather than opportunistic mass exploitation. Note also a tension in the CVSS vector: it uses UI:N, yet the description explicitly requires a victim to browse to the malicious page, which is genuinely user interaction - I would score this UI:R. Bottom line: high impact if triggered, but realistic likelihood is targeted and low-volume; this is a serious flaw for the Hackage service operator to patch centrally, less of a fleet-wide emergency for typical enterprises. |
| Exploit ScenarioDerived | A malicious maintainer registers a Hackage account and uploads a package (or documentation bundle) containing a crafted HTML/JS payload, which hackage.haskell.org serves unsanitized from its own origin. When a signed-in maintainer or admin browses that package or documentation page, the script executes in their session and silently issues authenticated requests - e.g., adding the attacker as a co-maintainer or uploading a trojanized package. No public exploit code is identified at time of analysis, and exploitation requires the victim to visit the attacker's page (AC:L but dependent on victim browsing). |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 24, 2026
Stored cross-site scripting in hackage-server (the software powering hackage.haskell.org) allowed HTML and JavaScript embedded in source packages or documentation uploads to be served unsanitized from the primary hackage.haskell.org origin. A low-privileged, authenticated package maintainer could plant a malicious payload so that any authenticated user visiting the affected package or documentation pages would have their active session hijacked, letting the attacker upload packages/docs, alter maintainer lists and metadata, or perform any action the victim is authorized to do. There is no public exploit identified at time of analysis, and EPSS is very low (0.05%), but the CVSS 9.9 rating reflects the total technical impact of a same-origin XSS on a central package-signing authority.
RemediationAI
No vendor-released patch version is identified in the provided data; consult the Haskell Security Advisory HSEC-2024-0004 (https://osv.dev/vulnerability/HSEC-2024-0004) for the fixed hackage-server release and apply it - the central hackage.haskell.org instance is operator-controlled and would have been remediated server-side. The core fix is to stop serving user-uploaded HTML/JS from the primary origin: serve documentation and package-provided HTML from a separate sandbox domain, and/or force a non-rendering content type (e.g., text/plain or Content-Disposition: attachment) plus a restrictive Content-Security-Policy that disallows inline script on the main domain. As interim compensating controls for private instances, disable or restrict the documentation-upload facility (trade-off: maintainers lose hosted Haddock docs) and block browser rendering of package-supplied .html/.js by overriding the served content type (trade-off: legitimate in-tarball HTML no longer renders inline). Advisory/reference URLs: https://osv.dev/vulnerability/HSEC-2024-0004, https://nvd.nist.gov/vuln/detail/CVE-2026-40470, https://vuldb.com/vuln/359152.
Affected ProductsAI
The vulnerability affects hackage-server, the Haskell package-repository server software, and the production deployment at hackage.haskell.org (the central Haskell package archive). No specific version range or CPE string was provided in the source data; affected versions should be confirmed via the Haskell Security Advisories entry referenced at https://osv.dev/vulnerability/HSEC-2024-0004 and the aggregated advisories at https://nvd.nist.gov/vuln/detail/CVE-2026-40470 and https://vuldb.com/vuln/359152. Private or mirrored hackage-server instances built from affected code would share the same exposure.
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The affected component is hackage-server, the Haskell open-source software behind the central package archive hackage.haskell.org. The root cause is CWE-79 (Improper Neutralization of Input During Web Page Generation): attacker-supplied HTML/JS contained in uploaded source tarballs or documentation bundles was returned with an active content type on the main application domain rather than being sanitized, sandboxed, or served from an isolated origin. Because the scripts execute in the security context of hackage.haskell.org itself, they gain access to the victim's authenticated session for that origin - the classic danger of serving user-controlled documentation/artifacts from the same origin that also handles privileged upload and metadata-management actions.
Know when the next one hits your stack
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:L
Requires a low-privileged maintainer account (PR:L) and a victim browsing the malicious page (UI:R); same-origin stored XSS crosses trust boundary (S:C) enabling session theft and package tampering (C:H/I:H), with no real availability loss (A:N).
Primary rating from NVD.
CVSS VectorNVD
DescriptionCVE.org
A critical XSS vulnerability affected hackage-server and hackage.haskell.org. HTML and JavaScript files provided in source packages or via the documentation upload facility were served as-is on the main hackage.haskell.org domain. As a consequence, when a user with latent HTTP credentials browses to the package pages or documentation uploaded by a malicious package maintainer, their session can be hijacked to upload packages or documentation, amend maintainers or other package metadata, or perform any other action the user is authorised to do.
Executive ViewAI
CVE-2026-40470 affects hackage-server, the central package repository for the Haskell ecosystem, enabling authenticated package maintainers to inject malicious code that compromises any other authenticated user visiting affected packages. An attacker with low-privilege repository access could hijack sessions and perform unauthorized package uploads or metadata modifications, directly threatening the integrity of the Haskell supply chain. Although no public exploit has been identified and exploitation probability remains low (0.0% EPSS), the CVSS 9.9 rating reflects critical impact on a foundational ecosystem component.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) enforce Content Security Policy headers (default-src 'self', script-src 'self') to restrict inline script execution; (2) implement strict input sanitization and HTML escaping in any local package repository mirrors; (3) require multi-factor authentication for all accounts with package upload permissions; (4) enable detailed audit logging of package uploads, metadata changes, and authenticated user sessions; (5) establish a package verification process using cryptographic checksums and pgp signature validation independent of hackage.haskell.org HTML rendering; (6) restrict package resolver access to known-safe versions via lockfiles and dependency pinning.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
EUVD-2026-25233
GHSA-hxp4-rf8g-9mwq
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB