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-2023-54345

CVE-2023-54345: Frappe ERPNext RCE Vulnerability

CVE-2023-54345 is a sandbox escape RCE flaw in Frappe ERPNext 13.4.0 that lets authenticated System Managers execute arbitrary code via frame introspection. This article covers technical details, impact, and mitigation.

Published: May 7, 2026

CVE-2023-54345 Overview

CVE-2023-54345 is a sandbox escape vulnerability in Frappe Framework ERPNext 13.4.0. The flaw resides in the RestrictedPython sandbox used by the server script feature. Authenticated users with the System Manager role can escape the sandbox by abusing Python frame introspection through the gi_frame attribute. By traversing the call stack, attackers reach unrestricted built-ins and invoke os.popen to run arbitrary system commands. The issue is classified under CWE-94: Improper Control of Generation of Code.

Critical Impact

Authenticated System Manager users can achieve remote code execution on the underlying ERPNext host, leading to full confidentiality, integrity, and availability compromise.

Affected Products

  • Frappe ERPNext 13.4.0
  • Frappe Framework safe_exec.py sandbox component
  • Server Script feature exposed via /app/server-script

Discovery Timeline

  • 2026-05-05 - CVE-2023-54345 published to NVD
  • 2026-05-05 - Last updated in NVD database

Technical Details for CVE-2023-54345

Vulnerability Analysis

Frappe Framework ships a Server Script feature that lets administrators execute Python inside a RestrictedPython sandbox. The sandbox is configured in frappe/utils/safe_exec.py and removes dangerous built-ins from the execution globals. However, generator and coroutine objects created within the sandbox expose the gi_frame attribute, which references the Python frame object used at runtime.

From the frame object, an attacker walks f_back references to reach an outer frame whose globals include unrestricted modules. Once an outer frame is reached, the attacker reads f_globals to access os or subprocess, then invokes os.popen to run shell commands. The result is arbitrary code execution under the privileges of the Frappe worker process.

Root Cause

The root cause is incomplete attribute filtering in the RestrictedPython configuration. The _getattr_ policy does not block frame-related attributes such as gi_frame, cr_frame, f_back, and f_globals. This allows sandboxed code to introspect the Python interpreter state and pivot from a restricted scope to an unrestricted one. The flaw maps to CWE-94, improper control of code generation in a sandboxed interpreter.

Attack Vector

Exploitation requires an authenticated account holding the System Manager role. The attacker submits a crafted Python payload to the /app/server-script endpoint, which stores and executes the script through the sandbox. The script defines a generator function, retrieves its frame via gi_frame, traverses f_back.f_back.f_globals to reach os, and calls os.popen("<command>").read(). The command runs on the ERPNext server with the permissions of the application service account.

A proof-of-concept payload and detailed write-up are available in the GitHub gist by lebr0nli, the UIUCTF Rattler write-up, Exploit-DB entry 51580, and the VulnCheck advisory.

Detection Methods for CVE-2023-54345

Indicators of Compromise

  • New or modified Server Script documents created via /app/server-script referencing gi_frame, cr_frame, f_back, or f_globals.
  • Frappe worker processes spawning shell interpreters such as sh, bash, or cmd.exe as direct child processes.
  • Outbound connections from the ERPNext host to attacker-controlled domains shortly after Server Script execution.
  • Unexpected files written to the Frappe sites/ directory or /tmp by the application user.

Detection Strategies

  • Monitor HTTP requests to /app/server-script and /api/method/frappe.client.insert that submit Server Script payloads, and inspect bodies for frame-introspection keywords.
  • Audit the tabServer Script table in the Frappe database for recently created or edited scripts containing gi_frame or __builtins__.
  • Use process telemetry to identify Python interpreters running Frappe code that fork shells or call os.popen equivalents.

Monitoring Recommendations

  • Centralize Frappe and web server logs and alert on Server Script create or update events outside change windows.
  • Track all accounts assigned the System Manager role and review role assignments at least weekly.
  • Baseline normal child processes of frappe, gunicorn, and python services so deviations trigger investigation.

How to Mitigate CVE-2023-54345

Immediate Actions Required

  • Upgrade Frappe Framework and ERPNext to a version released after 13.4.0 that hardens the RestrictedPython attribute policy.
  • Restrict the System Manager role to a minimal set of trusted administrators and enforce multi-factor authentication on those accounts.
  • Disable the Server Script feature in environments where it is not actively required.
  • Review the tabServer Script table for unauthorized entries and remove any scripts that reference frame attributes.

Patch Information

No specific vendor advisory URL is listed in the NVD entry. Refer to the Frappe GitHub repository for current releases and to the VulnCheck advisory for remediation guidance. Operators should move off the 13.4.0 branch and apply the latest stable patch level for their major version.

Workarounds

  • Set server_script_enabled to false in the Frappe site configuration to block Server Script execution.
  • Place the ERPNext administration interface behind a VPN or IP allowlist to limit reachability of /app/server-script.
  • Run the Frappe worker under a dedicated low-privilege user with no shell and restrict filesystem and network egress with AppArmor or SELinux.
bash
# Configuration example: disable server scripts in site_config.json
{
  "server_script_enabled": false,
  "developer_mode": 0,
  "allow_tests": 0
}

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechFrappe Erpnext

  • SeverityHIGH

  • CVSS Score8.7

  • EPSS Probability0.10%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/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
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-94
  • Technical References
  • ERPNext Official Website

  • Frappe Framework Documentation

  • GitHub Gist on Exploit

  • Frappe GitHub Repository

  • Frappe Code Analysis

  • UIUCTF Rattler Write-Up

  • Exploit-DB #51580

  • VulnCheck Advisory on Frappe
  • Related CVEs
  • CVE-2026-27471: Frappe ERPNext Auth Bypass Vulnerability

  • CVE-2025-58439: Frappe ERPNext SQL Injection Vulnerability

  • CVE-2025-52044: Frappe ERPNext SQL Injection 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