VYPR
Unrated severityNVD Advisory· Published Sep 29, 2022· Updated May 20, 2025

CVE-2022-40048

CVE-2022-40048

Description

Flatpress v1.2.1 has an RCE vulnerability in the Upload File function via file upload bypass, allowing executing arbitrary PHP code.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Flatpress v1.2.1 has an RCE vulnerability in the Upload File function via file upload bypass, allowing executing arbitrary PHP code.

Vulnerability

Flatpress v1.2.1 contains a remote code execution (RCE) vulnerability in the Upload File function. The application fails to properly validate uploaded file types, allowing an attacker to upload a PHP file disguised as a GIF (by prepending GIF89a;). This bypasses the intended image-only restriction and leads to arbitrary code execution. [1]

Exploitation

To exploit this vulnerability, an attacker must have a privileged account (logged-in). Steps: 1) Log in to the application. 2) Navigate to the uploader section. 3) Create a PHP file with the content GIF89a; followed by PHP code. 4) Upload the file. 5) Access the uploaded file via the media manager and append a command parameter (e.g., ?cmd=cat /etc/passwd) to execute arbitrary commands. [1]

Impact

Successful exploitation allows an authenticated attacker to execute arbitrary system commands on the server, leading to complete compromise of the affected Flatpress instance. This can result in data disclosure, further attacks, or full server takeover. [1]

Mitigation

As of the publication date (2022-09-29), no official patch has been released by the vendor. Suggested mitigations include: restricting file types to only accepted extensions, checking file extensions server-side, renaming uploaded files randomly, and disabling the upload functionality if not required. [1]

AI Insight generated on May 25, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected products

2

Patches

0

No patches discovered yet.

Vulnerability mechanics

Root cause

"Missing file-type validation in the upload function allows an attacker to upload a PHP file disguised as an image, leading to remote code execution."

Attack vector

A privileged attacker logs into Flatpress and navigates to the uploader section [ref_id=1]. The attacker creates a file with a PHP payload prefixed with "GIF89a;" to trick the webserver into treating it as an image, then uploads it [ref_id=1]. After uploading, the attacker navigates to the file via the media manager and appends a command parameter (e.g., ?cmd=cat+/etc/passwd) to the file URL, causing the PHP code to execute on the server [ref_id=1].

Affected code

The advisory does not specify the exact file or function responsible for the upload vulnerability [ref_id=1]. The upload functionality in Flatpress v1.2.1 lacks sandboxing and proper security controls on file types [ref_id=1].

What the fix does

No patch is published in the bundle. The advisory recommends restricting accepted file types, validating file extensions, and renaming uploaded files randomly or using a hash to prevent execution of dangerous file types [ref_id=1].

Preconditions

  • authAttacker must have a privileged account (logged in) to access the uploader section
  • configThe webserver must be configured to execute PHP files in the upload directory

Reproduction

1. Log in to the Flatpress application. 2. Navigate to the uploader section. 3. Create a PHP file with the payload `GIF89a;` at the beginning. 4. Upload the created PHP file. 5. Navigate to the file from the media manager and open it. 6. Append `?cmd=cat+/etc/passwd` to the file URL to execute commands [ref_id=1].

Generated on May 26, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

2

News mentions

0

No linked articles in our index yet.