Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
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-40472

CVE-2026-40472: Hackage Server XSS Vulnerability

CVE-2026-40472 is a stored Cross-Site Scripting flaw in hackage-server where unsanitized .cabal file metadata enables XSS attacks. This article covers technical details, affected versions, impact, and mitigation.

Published: April 23, 2026

CVE-2026-40472 Overview

A stored Cross-Site Scripting (XSS) vulnerability has been identified in hackage-server, the software that powers the Haskell package repository. User-controlled metadata from .cabal files is rendered into HTML href attributes without proper sanitization, allowing attackers to inject malicious scripts that execute in the context of other users' browsers when they view affected package pages.

Critical Impact

Attackers can upload malicious Haskell packages with crafted .cabal metadata to execute arbitrary JavaScript in victims' browsers, potentially leading to session hijacking, credential theft, and supply chain attacks against the Haskell development community.

Affected Products

  • hackage-server (versions prior to security patch)

Discovery Timeline

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

Technical Details for CVE-2026-40472

Vulnerability Analysis

This vulnerability is classified as CWE-79 (Improper Neutralization of Input During Web Page Generation), commonly known as Cross-Site Scripting. The flaw exists in how hackage-server processes and renders metadata fields from .cabal package description files.

When a Haskell developer uploads a package to Hackage, the server parses the accompanying .cabal file which contains metadata such as package URLs, homepage links, bug tracker addresses, and author information. These metadata fields are subsequently rendered into HTML pages that display package information to visitors.

The vulnerability arises because the server fails to properly sanitize or encode user-supplied values before inserting them into href attributes within anchor tags. This allows an attacker to break out of the attribute context and inject arbitrary JavaScript code using various techniques such as javascript: URI schemes or event handlers.

Root Cause

The root cause is insufficient input validation and output encoding when rendering .cabal metadata fields into HTML. The application trusts user-supplied data from package uploads and directly embeds it into HTML attributes without applying proper context-aware encoding. Fields such as homepage, bug-reports, source-repository, and similar URL-type fields in .cabal files are particularly susceptible to this injection.

Attack Vector

This is a network-based attack requiring low privileges (an authenticated Hackage account capable of uploading packages) and no user interaction beyond the victim viewing the malicious package page. The attack is stored (persistent), meaning the malicious payload remains on the server and affects all users who view the compromised package listing.

An attacker would craft a .cabal file with malicious content in URL fields, such as injecting javascript:alert(document.cookie) or breaking out of the href attribute to add onmouseover event handlers. Once the package is uploaded, any user browsing to that package's page would have the malicious script executed in their browser session.

The stored nature of this XSS vulnerability combined with Hackage's role as a central package repository makes this particularly dangerous, as it could be leveraged for supply chain attacks or to compromise developer accounts with package publishing privileges.

Detection Methods for CVE-2026-40472

Indicators of Compromise

  • Review uploaded .cabal files for suspicious URL patterns containing javascript:, data:, or HTML event handler syntax
  • Monitor for packages with unusual characters in metadata URL fields such as <, >, ", ', or encoded variants
  • Check browser console logs or WAF alerts for XSS-related payload signatures in package metadata contexts

Detection Strategies

  • Implement Content Security Policy (CSP) headers to detect and report inline script execution attempts
  • Deploy Web Application Firewall (WAF) rules to flag packages containing potential XSS payloads in .cabal metadata
  • Enable logging and alerting for package uploads containing non-standard URL schemes in URL-type fields

Monitoring Recommendations

  • Monitor server logs for unusual package upload patterns or high-frequency submissions from single accounts
  • Set up alerts for user-reported suspicious behavior or unexpected script execution on package pages
  • Regularly audit recently uploaded packages for compliance with expected URL format patterns

How to Mitigate CVE-2026-40472

Immediate Actions Required

  • Review recently uploaded packages for potential malicious .cabal metadata payloads
  • Implement strict Content Security Policy headers that prevent inline JavaScript execution
  • Consider temporarily restricting package uploads while remediation is implemented
  • Apply available security patches for hackage-server immediately

Patch Information

Users should refer to the OSV Vulnerability Report HSEC-2026-0004 for detailed patch information and updated versions of hackage-server that address this vulnerability. Administrators should upgrade to the latest patched version as soon as it becomes available.

Workarounds

  • Implement server-side validation to reject .cabal files containing javascript:, data:, or vbscript: URI schemes in URL fields
  • Apply HTML entity encoding to all user-supplied metadata before rendering in HTML contexts
  • Deploy a strict Content Security Policy that blocks inline scripts and restricts script sources to trusted origins
  • Consider using a whitelist approach that only permits http:// and https:// schemes in URL-type .cabal fields
bash
# Example CSP header configuration for nginx
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; frame-ancestors 'none';" always;

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

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechHackage Server

  • 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 Report HSEC-2026-0004
  • Related CVEs
  • CVE-2026-40471: Hackage Server CSRF Vulnerability
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