The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-40470

CVE-2026-40470: Hackage Server XSS Vulnerability

CVE-2026-40470 is a critical cross-site scripting vulnerability in hackage-server that enables session hijacking through malicious HTML/JavaScript files. This article covers technical details, impact, and mitigation.

Published: April 23, 2026

CVE-2026-40470 Overview

A critical Cross-Site Scripting (XSS) vulnerability has been identified in hackage-server and hackage.haskell.org, the central package repository for Haskell libraries and programs. This vulnerability stems from improper handling of HTML and JavaScript files included in source packages or uploaded via the documentation facility. These files were served without sanitization on the main hackage.haskell.org domain, creating a significant attack surface.

When users with active HTTP credentials browse package pages or documentation uploaded by a malicious package maintainer, their sessions can be hijacked. This allows attackers to upload packages or documentation, modify maintainers, alter package metadata, or perform any other action the compromised user is authorized to execute.

Critical Impact

Session hijacking through stored XSS can lead to complete account compromise, allowing attackers to manipulate packages and metadata on the Haskell package repository.

Affected Products

  • hackage-server (all versions prior to patch)
  • hackage.haskell.org (production instance)
  • Any self-hosted hackage-server deployments serving untrusted content

Discovery Timeline

  • 2026-04-23 - CVE CVE-2026-40470 published to NVD
  • 2026-04-23 - Last updated in NVD database

Technical Details for CVE-2026-40470

Vulnerability Analysis

This vulnerability is classified as CWE-79 (Improper Neutralization of Input During Web Page Generation), commonly known as Cross-Site Scripting (XSS). The root issue lies in the hackage-server's content serving mechanism, which fails to properly sanitize or isolate user-uploaded content.

The vulnerability represents a stored XSS attack vector, where malicious JavaScript or HTML content persists on the server within package documentation or source files. When other users access these resources, the malicious code executes within the context of the main hackage.haskell.org domain, inheriting the victim's session and authentication state.

The network-based attack vector with low attack complexity makes this particularly dangerous. An authenticated package maintainer with even minimal privileges can inject malicious content that affects any user who views their package pages or documentation, potentially including repository administrators and other high-privilege accounts.

Root Cause

The root cause is the lack of content isolation and sanitization for user-uploaded files. HTML and JavaScript files included in package source distributions or uploaded through the documentation facility were served directly from the main domain without:

  1. Content-Type validation or enforcement
  2. Sandboxing via separate domains or Content Security Policy headers
  3. Input sanitization to strip or escape potentially malicious content
  4. Isolation of user-generated content from authenticated sessions

Attack Vector

The attack exploits the trust relationship between the hackage.haskell.org domain and authenticated users. A malicious package maintainer uploads crafted HTML or JavaScript files either as part of their package source or through the documentation upload feature. When a victim with an active session browses to the compromised content, the malicious scripts execute with full access to the victim's cookies and session tokens.

The attacker can then leverage this access to perform actions on behalf of the victim, including uploading new packages, modifying existing package metadata, changing maintainer lists, or even compromising other packages the victim maintains. This creates a potential supply chain attack vector affecting the entire Haskell ecosystem.

Detection Methods for CVE-2026-40470

Indicators of Compromise

  • Unusual documentation or source file uploads containing embedded JavaScript or suspicious HTML tags
  • Unexpected changes to package maintainer lists or metadata without legitimate justification
  • Session cookies being accessed from unusual IP addresses or user agents following visits to specific package pages
  • Package uploads or modifications occurring shortly after users browse untrusted package documentation

Detection Strategies

  • Monitor web server logs for requests to documentation files containing suspicious query parameters or fragment identifiers
  • Implement Content Security Policy (CSP) reporting to identify script execution from unexpected sources
  • Review recent package uploads and documentation changes for HTML files containing <script> tags or inline event handlers
  • Deploy client-side XSS detection mechanisms that alert on suspicious DOM modifications

Monitoring Recommendations

  • Enable detailed logging for all authenticated actions on the hackage-server instance
  • Set up alerts for bulk or automated changes to package metadata or maintainer lists
  • Monitor for unusual patterns in documentation upload frequency or content size anomalies
  • Implement session monitoring to detect concurrent sessions from geographically disparate locations

How to Mitigate CVE-2026-40470

Immediate Actions Required

  • Apply the latest security patches to hackage-server deployments immediately
  • Audit recent package uploads and documentation changes for suspicious HTML or JavaScript content
  • Consider temporarily restricting documentation upload capabilities until patches are applied
  • Review and potentially invalidate active user sessions if compromise is suspected
  • Notify users who may have accessed suspicious package documentation to rotate their credentials

Patch Information

Organizations running hackage-server should consult the official security advisory for patch details. For additional technical information about this vulnerability, refer to the OSV Vulnerability HSEC-2024-0004 advisory.

Users of the public hackage.haskell.org service should ensure they are not accessing cached versions of documentation and should clear browser data after the fix is deployed.

Workarounds

  • Serve user-uploaded content from a separate domain that does not share cookies with the main hackage domain
  • Implement strict Content Security Policy headers that prevent inline script execution
  • Use the sandbox attribute on iframes when displaying user-uploaded documentation
  • Configure the server to serve user-uploaded HTML with Content-Type: text/plain to prevent browser rendering
  • Disable JavaScript execution in documentation by stripping script tags during the upload process
bash
# Example CSP header configuration for nginx
# Add to server block to mitigate XSS until patched

add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; frame-ancestors 'none';" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "DENY" always;

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechHaskell

  • SeverityCRITICAL

  • CVSS Score9.9

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:L
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityLow
  • CWE References
  • CWE-79
  • Technical References
  • OSV Vulnerability HSEC-2024-0004
  • Latest CVEs
  • CVE-2026-8468: Elixir Plug Library DoS Vulnerability

  • CVE-2026-8295: simdjson Information Disclosure Vulnerability

  • CVE-2025-68421: Comarch ERP Optima Auth Bypass Vulnerability

  • CVE-2025-68420: Comarch ERP Optima Privilege Escalation
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English