Authenticated code execution via unrestricted template file overwrite
Published Apr 3, 2024 · Updated Aug 20, 2024
Arbitrary file write in BeeCMS 4.0 allows remote authenticated users to execute code by overwriting an existing PHP file. The save_template branch in admin_template.php joins the user-controlled file value to CMS_PATH, checks only that the path exists, opens it with w+, and writes supplied template content without path isolation or suffix validation. Access requires the tpl_manage permission in the administrative template editor, and successful use replaces an existing server-side file with attacker-controlled PHP that executes when requested.
Summary
What happened
Arbitrary file write in BeeCMS 4.0 allows remote authenticated users to execute code by overwriting an existing PHP file. The save_template branch in admin_template.php joins the user-controlled file value to CMS_PATH, checks only that the path exists, opens it with w+, and writes supplied template content without path isolation or suffix validation. Access requires the tpl_manage permission in the administrative template editor, and successful use replaces an existing server-side file with attacker-controlled PHP that executes when requested.
The record
- CVE
- CVE-2024-31011
- Published
- Apr 3, 2024
- Updated
- Aug 20, 2024
- Vendor
- BeeCMS
- Product
- BeeCMS
- Classifications
- CWE-94, T1505.003
- Attack vector
- network
- Privileges
- authenticated
Timeline
How it unfolded
- Apr 3, 2024CVE publishedPublication date reported by the CVE source.
- Aug 20, 2024Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=4.0
What conditions does exploitation require?
What is affected?
Published CVSS scores
CVSS describes severity. EPSS estimates exploitation probability.
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
- BEESCMS admin_template.php arbitrary file writing proof of conceptproof of concept · demonstrated
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo