Summary
Aero CMS 0.0.1 contains a PHP code injection flaw in the admin post creation workflow, where uploaded files provided via the image parameter can contain executable PHP code.
An authenticated attacker can upload a malicious PHP file through posts.php?source=add_post, which the server then executes, leading to full remote code execution under the web server's privileges.
Affected context
The vulnerability appears in the Aero CMS administrative interface when adding new posts via posts.php with source=add_post.
In affected setups, the application treats the image upload parameter as a trusted file and stores it in a web-accessible location without enforcing strict file type validation or ensuring non-executable storage.
The issue manifests when the environment executes uploaded files as PHP scripts (e.g., within the document root on a PHP-enabled web server), allowing the embedded code to run when the file is requested.
Exploit preconditions
- Attack surface: Web-based admin interface, specifically
admin/posts.php?source=add_post. - Required access: Valid authenticated account with permission to create or edit posts and upload images.
- Trigger point: Submitting a post creation request that includes a file upload via the
imageparameter containing PHP code, followed by requesting the uploaded file through the web server. - Why exploitation is possible: The server accepts arbitrary file content as an "image," stores it in a location interpreted by PHP, and does not enforce robust content-type checks, file extension whitelisting, or execution barriers on uploaded files.
Why this happens
This vulnerability is rooted in CWE-94: Improper Control of Generation of Code, specifically allowing user-supplied content to become executable code on the server.
The application treats uploaded files as benign images but fails to:
- Restrict allowed file types to non-executable formats,
- Store uploads outside of executable web paths, or
- Sanitize and validate file names and contents.
As a result, a user can upload a PHP file containing arbitrary code that is later executed by the PHP interpreter when accessed through the web server, effectively turning untrusted input into server-side code.
Potential impact
- Execution of arbitrary PHP code under the web server account.
- Full compromise of the Aero CMS instance, including reading or modifying database content through application context.
- Deployment of web shells for persistent access and further lateral movement.
- Exfiltration or tampering of user data and configuration.
- Use of the compromised server as a pivot point for attacking internal infrastructure.
General mitigation guidance
Effective mitigation generally focuses on preventing uploaded content from becoming executable and tightening trust boundaries around file handling:
- Enforce strict whitelisting of file extensions and MIME types for uploads (e.g., only JPEG/PNG), and reject any potentially executable formats.
- Store uploaded files outside of the web root or in directories configured to disallow script execution (e.g., using web server configuration to disable
phpexecution in upload paths). - Normalize and sanitize file names, and avoid using user-provided extensions directly.
- Apply least-privilege to the web server user and the upload directories to limit damage if a file is misclassified.
- Introduce centralized upload handling and validation routines rather than ad-hoc file handling in multiple endpoints.
How teams detect issues like this
Organizations can detect and monitor for this class of vulnerabilities using a combination of review and tooling:
- Static analysis: Scan PHP code for direct calls to file upload handlers that save files in executable locations, or for scripts referencing upload directories under the document root without execution safeguards.
- Code review: Flag patterns where:
$_FILESinput is stored without extension/content checks,- Upload directories are inside the web root,
- There is no server configuration to disable script execution in upload paths.
- Runtime monitoring: Track access to newly created files in upload directories, particularly
.phpor other executable extensions, and alert on suspicious patterns. - Security testing: Use automated web scanners or manual penetration testing to probe file upload endpoints for handling of unexpected file types and extensions.

