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-21618

CVE-2026-21618: hexpm/hexpm XSS Vulnerability

CVE-2026-21618 is a cross-site scripting vulnerability in hexpm/hexpm affecting the SharedAuthorizationView module that allows attackers to inject malicious scripts. This article covers technical details, affected versions, and mitigation.

Published: January 23, 2026

CVE-2026-21618 Overview

CVE-2026-21618 is a Cross-Site Scripting (XSS) vulnerability discovered in hexpm, the package manager repository for the Elixir and Erlang ecosystems. The vulnerability exists in the HexpmWeb.SharedAuthorizationView module, specifically within the render_grouped_scopes/3 function located in lib/hexpm_web/views/shared_authorization_view.ex. This flaw allows attackers to inject malicious scripts through improperly neutralized user input during web page generation, potentially compromising user sessions and sensitive data.

Critical Impact

Attackers can execute arbitrary JavaScript in the context of authenticated hex.pm users, potentially stealing session tokens, API keys, or performing unauthorized actions on behalf of victims.

Affected Products

  • hexpm from commit 617e44c71f1dd9043870205f371d375c5c4d886d before commit c692438684ead90c3bcbfb9ccf4e63c768c668a8
  • hex.pm platform from 2025-10-01 before 2026-01-19

Discovery Timeline

  • 2026-01-19 - CVE CVE-2026-21618 published to NVD
  • 2026-01-19 - Last updated in NVD database

Technical Details for CVE-2026-21618

Vulnerability Analysis

The vulnerability resides in how hexpm handles user-agent strings when rendering dashboard views. The affected code uses Phoenix.HTML.html_escape/1 for escaping user input that is subsequently embedded within HTML data attributes. However, when this escaped content is rendered within popover elements that interpret the content as HTML, a double-encoding issue creates an XSS vector. The user-agent string, which is attacker-controlled, was not being properly escaped for the context in which it was being rendered, allowing malicious payloads to execute when users interact with dashboard elements displaying session or API key information.

Root Cause

The root cause is insufficient output encoding for context-specific rendering. The original implementation used Phoenix.HTML.html_escape/1 to escape user-agent strings before embedding them in data-content attributes. However, these attributes are processed by Bootstrap popovers which render the content as HTML. This means the single escape was decoded by the popover renderer, allowing any XSS payload within the user-agent to execute. The fix introduces a double_html_escape/1 function that applies HTML escaping twice, ensuring the content remains safe even after the popover's HTML rendering pass.

Attack Vector

An attacker can exploit this vulnerability by crafting a malicious user-agent string containing JavaScript payloads when making API requests to hex.pm. When an authenticated user views their dashboard (specifically the API keys or sessions pages) and interacts with elements showing "last use" information, the malicious script executes in their browser context. The attack requires user interaction (clicking on the popover element) but can be facilitated through social engineering.

text
// Security patch in lib/hexpm_web/templates/dashboard/_keys.html.eex
                     data-trigger="focus"
                     data-placement="bottom"
                     title="Last use"
-                    data-content="<strong>Used at:</strong> <%= ViewHelpers.pretty_datetime(last_use.used_at) %><br><strong>IP:</strong> <%= last_use.ip %><br><strong>User agent:</strong> <%= Phoenix.HTML.html_escape(last_use.user_agent) %>">
+                    data-content="<strong>Used at:</strong> <%= ViewHelpers.pretty_datetime(last_use.used_at) %><br><strong>IP:</strong> <%= last_use.ip %><br><strong>User agent:</strong> <%= double_html_escape(last_use.user_agent) %>">
                       <%= ViewHelpers.pretty_date(last_use.used_at) %> ...
                   </a>
                 <% end %>

Source: GitHub Commit c692438

Detection Methods for CVE-2026-21618

Indicators of Compromise

  • Unusual user-agent strings in access logs containing HTML/JavaScript syntax such as <script>, onerror=, or javascript: sequences
  • API key or session usage from unexpected IP addresses or with anomalous user-agent patterns
  • Reports from users of unexpected browser behavior when viewing their hex.pm dashboard

Detection Strategies

  • Implement Web Application Firewall (WAF) rules to detect and block requests with user-agent strings containing common XSS payloads
  • Monitor application logs for user-agent strings exceeding normal length or containing encoded characters typical of XSS attempts
  • Deploy Content Security Policy (CSP) headers to limit the impact of successful XSS exploitation

Monitoring Recommendations

  • Enable detailed logging for all API authentication events, including full user-agent strings
  • Set up alerts for user-agent strings matching XSS payload patterns
  • Monitor for session token reuse from different IP addresses, which may indicate session theft

How to Mitigate CVE-2026-21618

Immediate Actions Required

  • Update hexpm to commit c692438684ead90c3bcbfb9ccf4e63c768c668a8 or later immediately
  • Review API key and session activity for any suspicious patterns
  • Consider rotating API keys if unusual activity is detected
  • Implement CSP headers as an additional defense layer

Patch Information

The vulnerability has been patched in commit c692438684ead90c3bcbfb9ccf4e63c768c668a8. The fix introduces a double_html_escape/1 helper function in DashboardView that properly escapes user-controlled input for contexts where content is rendered as HTML within Bootstrap popovers. For detailed patch information, refer to the GitHub Security Advisory GHSA-6cw9-5gg4-rhpj and the commit change log.

Workarounds

  • If immediate patching is not possible, consider disabling the popover functionality that displays user-agent information
  • Implement strict Content Security Policy headers to prevent inline script execution
  • Use a reverse proxy or WAF to sanitize or reject requests with suspicious user-agent strings
bash
# Example CSP header configuration for nginx
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; object-src '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/TechHexpm

  • SeverityHIGH

  • CVSS Score8.5

  • EPSS Probability0.05%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:N/SC:L/SI:L/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityHigh
  • AvailabilityNone
  • CWE References
  • CWE-79
  • Technical References
  • GitHub Commit Change Log

  • GitHub Security Advisory GHSA-6cw9-5gg4-rhpj
  • Related CVEs
  • CVE-2026-23940: Hexpm Package Manager DoS Vulnerability

  • CVE-2026-21622: Hexpm Auth Bypass Vulnerability

  • CVE-2026-21621: Hexpm Privilege Escalation Vulnerability

  • CVE-2026-23939: Hexpm Path Traversal 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