EspoCRM Authenticated RCE via Formula ACL Bypass + Attachment Path Traversal — CVE-2026-33656
by Jiva (jivasecurity.com) · 2026-07-05
- Severity
- Critical
- CVE
- CVE-2026-33656
- Category
- web
- Affected product
- EspoCRM <= 9.3.3
- Affected versions
- All versions up to and including 9.3.3
- Disclosed
- 2026-07-05
- Patch status
- unpatched
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-05 |
| Last Updated | 2026-03 |
| Author / Researcher | Jiva (jivasecurity.com) |
| CVE / Advisory | CVE-2026-33656 |
| Category | web |
| Severity | Critical |
| CVSS Score | Not specified in source |
| Status | Weaponized |
| Tags | espocrm, rce, path-traversal, webshell, htaccess-poisoning, formula-engine, authenticated, crm |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | EspoCRM <= 9.3.3 |
| Versions Affected | All versions up to and including 9.3.3 |
| Language / Platform | Bash (curl) targeting PHP web application |
| Authentication Required | Yes (admin credentials) |
| Network Access Required | Yes |
Summary
EspoCRM’s Formula scripting engine (Formula/action/run) can be abused by an admin-authenticated user to bypass access controls and directly rewrite the sourceId field of an Attachment record, redirecting where uploaded chunk data is written on disk via path traversal (../../). Combined with EspoCRM’s chunked attachment upload endpoint, this lets an attacker first plant a PHP webshell inside the web-accessible client/ directory, then poison the application’s .htaccess file to register .txt-named files for PHP execution via SetHandler application/x-httpd-php. The bundled shell script PoC automates the full six-step chain end-to-end: create a placeholder attachment, redirect its sourceId to ../../client/x via a Formula expression, upload a base64-encoded PHP webshell payload via the chunk endpoint, repeat the process to redirect a second attachment to ../../.htaccess, append the PHP handler directive, and finally invoke the resulting webshell at /client/x?c=<command> to achieve OS command execution.
Vulnerability Details
Root Cause
The Formula engine’s record\update() function does not enforce the same access-control/sanitization restrictions on the Attachment.sourceId field as the normal attachment API, allowing an authenticated user to set it to an arbitrary path-traversal value. The chunked-upload endpoint then writes attacker-supplied bytes to whatever filesystem path sourceId resolves to, including files inside the web root and the application’s own .htaccess.
Attack Vector
- Authenticate to EspoCRM with any account holding Formula execution and Attachment/Document access.
- Create a placeholder
Attachmentrecord and useFormula/action/runto overwrite itssourceIdwith a traversal path pointing into the web-accessibleclient/directory. - Upload a base64-encoded PHP webshell (
<?php system($_GET["c"]); ?>) through the/api/v1/Attachment/chunk/{id}endpoint, which writes it to the redirected path. - Repeat steps 2-3 for a second attachment, redirecting
sourceIdto../../.htaccessand appending a<FilesMatch>/SetHandler application/x-httpd-phpdirective that makes the arbitrary-extension webshell file execute as PHP. - Request the planted webshell (
/client/x?c=<command>) to execute arbitrary OS commands with the web server’s privileges.
Impact
A user with legitimate EspoCRM login credentials (not necessarily a super-admin) can achieve full remote code execution on the underlying server, leading to complete compromise of the host and any data it can access.
Environment / Lab Setup
Target: EspoCRM <= 9.3.3 (e.g. http://192.168.5.16:8090)
Attacker: bash, curl, optionally jq (falls back to grep/cut for JSON parsing)
Proof of Concept
PoC Script
See
ESPOCRM-RCE-POC-CVE-2026-33656.shin this folder.
| |
The script performs the full six-step chain automatically: creates the webshell attachment, uses the Formula ACL bypass to redirect its sourceId via path traversal into client/, uploads the base64-encoded PHP payload, repeats the process against .htaccess to register PHP execution for the arbitrary-extension file, and finally executes the supplied OS command through the resulting webshell, printing “RCE CONFIRMED” if the output matches a uid= pattern.
Detection & Indicators of Compromise
Signs of compromise:
- Formula execution requests containing
record\updatecalls targeting theAttachmententity’ssourceIdfield. - Unexpected new PHP-executable files inside the
client/directory or a modified.htaccesscontainingSetHandler application/x-httpd-phpfor non-standard filenames. - Outbound requests to
/client/x?c=or similarly named unexpected paths returning command output.
Remediation
| Action | Detail |
|---|---|
| Primary fix | No vendor patch confirmed as of 2026-07-05 — monitor for advisory; restrict Formula engine access to trusted admins only and validate/sanitize sourceId writes against path traversal. |
| Interim mitigation | Disable or tightly restrict the Formula module for non-admin roles, and lock down .htaccess and client/ directory permissions so the application process cannot write executable content there. |
References
Notes
Mirrored from https://github.com/JivaSecurity/ESPOCRM-RCE-POC-CVE-2026-33656 on 2026-07-05.
| |