A Leader in the 2026 Gartner® Magic Quadrant™ for Endpoint Protection. Six years running.Six years. Gartner® Magic Quadrant™ Leader.Find Out Why
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-42840

CVE-2026-42840: ERPNext POS Interface XSS Vulnerability

CVE-2026-42840 is a cross-site scripting flaw in ERPNext Point of Sale interface affecting version 16.16.0. Attackers can inject malicious scripts through customer records. This article covers technical details, impact, and mitigation.

Published: June 4, 2026

CVE-2026-42840 Overview

CVE-2026-42840 is a stored Cross-Site Scripting (XSS) vulnerability in ERPNext 16.16.0. An authenticated user can persist arbitrary HTML or JavaScript in the email_id or mobile_no fields of a Customer record. The Point of Sale (POS) interface renders these fields without escaping, executing attacker-controlled script in the browser of every operator who selects the customer.

The flaw is categorized under [CWE-79] — Improper Neutralization of Input During Web Page Generation. Exploitation requires only low-privileged authenticated access and user interaction from a POS operator.

Critical Impact

Stored payloads execute in any operator session that loads the affected customer record, enabling session theft, action forgery, or pivoting within the ERPNext tenant.

Affected Products

  • ERPNext 16.16.0
  • Frappe ERPNext Customer module
  • Frappe ERPNext Point of Sale (POS) interface

Discovery Timeline

  • 2026-06-03 - CVE-2026-42840 published to NVD
  • 2026-06-03 - Last updated in NVD database

Technical Details for CVE-2026-42840

Vulnerability Analysis

The vulnerability is a stored XSS in the ERPNext Customer document type. The email_id and mobile_no fields accept arbitrary content during customer create or update operations. The server persists the input without neutralizing HTML control characters.

When a POS operator selects the customer, the POS interface reads these fields and writes them into the Document Object Model (DOM) without escaping. The browser parses the injected markup and executes any embedded <script> tags or event handlers.

The issue affects every POS operator who views the poisoned customer record. This converts a single write by a low-privileged user into script execution across multiple cashier or sales sessions. Refer to the FluidAttacks Security Advisory for additional technical context.

Root Cause

The root cause is missing output encoding in the POS rendering path. ERPNext applies field-level validation for format on some Customer fields but does not sanitize HTML in email_id or mobile_no before storage or before rendering in the POS view. The render path treats the value as trusted markup instead of untrusted text.

Attack Vector

An attacker with authenticated access and Customer write permission creates or edits a Customer document. The attacker places an HTML or JavaScript payload in email_id or mobile_no. The payload remains dormant in the database. When any POS operator opens the cart and selects that customer, the POS view loads the fields and the payload executes in the operator's browser within the ERPNext origin.

Because execution occurs in the operator's authenticated session, the payload can call ERPNext REST endpoints, exfiltrate session cookies that are not HttpOnly, or modify transactions in progress.

No verified public exploit code is available. The vulnerability mechanism is described in the FluidAttacks Security Advisory and the GitHub ERPNext Repository.

Detection Methods for CVE-2026-42840

Indicators of Compromise

  • Customer records where email_id or mobile_no contain <, >, script, onerror, onload, or javascript: substrings.
  • Outbound HTTP requests from POS operator browsers to unexpected external hosts shortly after a customer is selected in the POS view.
  • Frappe audit log entries showing Customer document updates from accounts that do not normally manage customer master data.

Detection Strategies

  • Query the tabCustomer table for email_id or mobile_no values that fail strict regex validation for email or phone format.
  • Inspect browser console errors and Content Security Policy violation reports generated by POS sessions.
  • Review web server access logs for POS endpoints returning customer payloads containing HTML metacharacters.

Monitoring Recommendations

  • Alert on Customer document writes that contain angle brackets or javascript: schemes in contact fields.
  • Monitor POS user sessions for anomalous API calls issued from the browser after customer selection events.
  • Track Customer record edits performed by accounts outside the sales or master-data roles.

How to Mitigate CVE-2026-42840

Immediate Actions Required

  • Restrict Customer create and update permissions to trusted roles until a patched ERPNext release is deployed.
  • Audit existing Customer records for HTML or script content in email_id and mobile_no and sanitize affected rows.
  • Force re-authentication for POS operators and invalidate existing sessions if poisoned records were viewed.

Patch Information

The advisory identifies ERPNext 16.16.0 as affected. Monitor the GitHub ERPNext Repository for releases that introduce output encoding in the POS customer rendering path and input validation on email_id and mobile_no. Apply the fixed version as soon as it is published by the Frappe project.

Workarounds

  • Apply server-side validation that rejects Customer field values containing HTML metacharacters before save.
  • Deploy a Content Security Policy that blocks inline script execution in the POS interface to reduce payload viability.
  • Limit Customer write permissions through Frappe role-based access control to reduce the attacker population.
bash
# Example regex validation for Customer contact fields (server-side hook)
# Reject any value containing HTML control characters
VALIDATE_EMAIL='^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$'
VALIDATE_PHONE='^[+0-9 ()-]{4,20}$'

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

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechErpnext

  • SeverityMEDIUM

  • CVSS Score5.1

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:L/VI:L/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
  • IntegrityLow
  • AvailabilityNone
  • CWE References
  • CWE-79
  • Technical References
  • FluidAttacks Security Advisory

  • GitHub ERPNext Repository
  • Related CVEs
  • CVE-2026-42839: ERPNext Point of Sale XSS Vulnerability

  • CVE-2026-38432: ERPNext Email Template XSS Vulnerability

  • CVE-2025-65924: ERPNext XSS Vulnerability

  • CVE-2025-65923: ERPNext CSV Import XSS Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today 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