CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-73858

CVE-2026-73858: Server-Side Twig Template Injection in Solspace Freeform for Craft CMS

Alon Barad
Alon Barad
Software Engineer

Sep 23, 2026·6 min read·5 visits

Executive Summary (TL;DR)

Unauthenticated remote attackers can inject Twig expressions into form inputs in Solspace Freeform versions 5.x < 5.10.14. When validation fails and the form re-renders, the input values are processed by an isolated Twig instance, allowing system configuration and path disclosure.

A technical analysis of CVE-2026-73858 / GHSA-gxrg-x694-283w, a server-side template injection vulnerability in the Solspace Freeform plugin for Craft CMS. The vulnerability permits unauthenticated users to trigger dynamic Twig evaluation of input fields during form validation re-rendering, causing local directory path disclosure and PHP runtime information exposure.

Vulnerability Overview

Solspace Freeform is an enterprise-grade form builder plugin designed for Craft CMS. It allows administrators to build, manage, and render complex multi-step forms directly inside the Craft CMS control panel. To handle diverse presentation layers, Freeform utilizes a dynamic serialization engine to parse field configuration data and output raw HTML attributes.

This dynamic serialization process creates a public-facing attack surface. When a client interacts with a form, submitted parameters are often maintained across requests to support multi-page forms or preserve inputs when validation rules are not met. If the system does not cleanly separate user-supplied input state from system-defined template parameters, the input can be executed within a trusted rendering context.

This vulnerability is classified under CWE-1336 (Improper Neutralization of Special Elements Used in a Template Engine). Unauthenticated remote attackers can execute arbitrary Twig template expressions within an isolated renderer. The resulting output is subsequently reflected back to the client inside the target input element's HTML markup.

Root Cause Analysis

The vulnerability resides in how Freeform serializes HTML attributes for form components. Specifically, the class Solspace\Freeform\Library\Attributes\Attributes handles the preparation of attributes before formatting them as HTML strings. This formatting is initiated through the toHtmlTagArray(?array $properties = null) method.

To support administrative overrides and dynamic rendering (such as evaluating control panel macros or dynamic placeholders), the plugin routes attribute values through an instance of the Twig renderer. In versions prior to 5.10.14, this processing did not check if the attribute key held user-supplied POST data versus statically configured server-side variables.

When a validation failure occurs during a form submission, the previously submitted user input is populated into the field array as the value attribute to allow re-entry. When the form re-renders to present validation errors, toHtmlTagArray() executes. The loop processes the value key, blindly passing the user-submitted string containing malicious Twig syntax into the $twig->render() execution context, triggering immediate template parsing.

Code Analysis & Patch Evaluation

Prior to the patch, the loop in Attributes.php executed $twig->render($value, $properties) on any non-empty value, regardless of whether the key represented a static configuration attribute or a dynamic user input. Below is the vulnerable segment:

// Vulnerable code in Attributes.php
public function toHtmlTagArray(?array $properties = null): array
{
    // ...
    $replacements = [];
    foreach ($array as $key => $value) {
        $key = $twig->render($key, $properties);
        $value = !empty($value) ? $twig->render($value, $properties) : $value;
 
        $replacements[$key] = $value;
    }
    // ...
}

The mitigation introduced in commit 5f7555320635f1cd3b4c478aa0b58e8c3144313b adds a restricted array of attributes to prevent evaluation:

private const EXCLUDED_TWIG_ATTRIBUTES = ['value', 'name', 'id'];

The loop was modified to prevent Twig rendering if the key is present in this denylist:

if (!empty($value) && !\in_array($key, self::EXCLUDED_TWIG_ATTRIBUTES, true)) {
    $value = $twig->render($value, $properties);
}

This mitigation relies on a denylist model. If an attacker can inject values that serialize into other HTML attributes (such as data-*, title, or placeholder) that are not explicitly defined in EXCLUDED_TWIG_ATTRIBUTES, those values will still be parsed by the template engine. A structural and secure remediation would utilize an allowlist or completely avoid processing attributes using the template engine when they contain user-supplied HTTP request context.

Exploitation & PoC Analysis

To exploit the vulnerability, an attacker must identify a public-facing Freeform form. The exploitation vector requires submitting the form with an intentional validation error (e.g., omitting a required field or providing an invalid email format) while injecting a Twig expression into a text-based or email-based input field.

A typical payload targeting environment variables takes the form of {{ constant('CRAFT_VENDOR_PATH') }}. When the server processes the validation failure, it preserves the payload to prepopulate the field for the user. During the rendering cycle, the Twig expression is evaluated. The server returns the final HTML response containing the evaluated variable within the input field's markup:

<input type="text" name="fields[first_name]" value="/var/www/vhosts/site/vendor/" />

This workflow is illustrated below:

Impact Assessment

The security impact of CVE-2026-73858 is scoped to local information disclosure. Due to the sandboxed nature of the specific Twig context instantiated by Freeform, the template engine is restricted. The rendering class blocks the instantiation of core Craft CMS system components such as craft.app or access to underlying environment configuration variables (.env files) and native PHP functions like system or exec.

Despite these restrictions, an attacker can extract system properties via PHP constants. Using the constant() function, attackers can retrieve system-level variables including the exact PHP version (PHP_VERSION), the server host operating system (PHP_OS), and critical server directory layouts (CRAFT_BASE_PATH and CRAFT_VENDOR_PATH).

These disclosures degrade the defense-in-depth posture of the host environment. Knowing the exact filesystem paths and PHP runtime environments allows malicious actors to customize subsequent attacks or match identified software combinations against known local file inclusion (LFI) or remote code execution (RCE) vectors.

Detection & Mitigation

Remediation of this vulnerability requires upgrading Freeform to version 5.10.14 or later. In environments where an immediate upgrade is not possible, security teams should implement defensive patterns. Modifying public template configurations to sanitize user input prior to output rendering can temporarily mitigate the vector.

Web Application Firewalls (WAFs) can detect exploitation attempts by evaluating incoming POST bodies for Twig block syntax containing standard functions or constants. Signature analysis should identify double-curly brackets accompanied by keywords such as constant, CRAFT_, or PHP_ within the context of form input fields.

Below is a standard Snort detection signature designed to detect potential template injection attempts directed at Freeform instances:

alert tcp $EXTERNAL_NET any -> $HTTP_SERVERS $HTTP_PORTS (msg:"COTS Exploit Solspace Freeform SSTI Attempt"; flow:established,to_server; content:"POST"; http_method; content:"fields["; http_client_body; content:"{{"; http_client_body; content:"constant("; http_client_body; content:"}}"; http_client_body; reference:cve,2026-73858; classtype:web-application-attack; sid:1000001; rev:1;)

Official Patches

SolspaceFix Commit
SolspaceRelease Notes

Fix Analysis (1)

Technical Appendix

CVSS Score
5.3/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

Affected Systems

Solspace Freeform 5.x instances running on Craft CMS 5.x

Affected Versions Detail

Product
Affected Versions
Fixed Version
Solspace Freeform
Solspace
>= 5.0.0, < 5.10.145.10.14
AttributeDetail
CWE IDCWE-1336
Attack VectorNetwork (AV:N)
CVSS Score5.3 (Medium)
Exploit StatusProof-of-Concept (PoC)
CISA KEV StatusNot Listed
ImpactInformation Disclosure / Local Path Leakage

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1505Server Software Component
Execution
CWE-1336
Improper Neutralization of Special Elements Used in a Template Engine

The application accepts user input and embeds it directly inside a template structure before rendering, permitting template injection.

References & Sources

  • [1]GitHub Security Advisory
  • [2]Fix Commit
  • [3]Developer Pull Request
  • [4]Official CVE Record

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•28 minutes ago•CVE-2026-88974
5.4

CVE-2026-88974: Incorrect Authorization in WPGraphQL updatePost Mutation

CVE-2026-88974 is an incorrect authorization vulnerability in the WPGraphQL plugin for WordPress. Due to a failure to perform object-level capability checks or validate status-transition requirements in the updatePost mutation handler, authenticated Contributor-level users can publish their own draft posts without editorial approval or modify their previously published posts.

Amit Schendel
Amit Schendel
3 views•7 min read
•about 2 hours ago•CVE-2026-54892
8.7

CVE-2026-54892: Algorithmic Complexity Denial of Service in Plug Query Decoder

An algorithmic complexity vulnerability (CWE-407) in the query decoder of the Elixir Plug library (CVE-2026-54892) allows unauthenticated remote attackers to trigger scheduler starvation and denial of service by transmitting deeply nested brackets in query parameters or URL-encoded post bodies.

Alon Barad
Alon Barad
7 views•6 min read
•about 3 hours ago•CVE-2026-83801
5.4

CVE-2026-83801: Stored Cross-Site Scripting via Form Help Text in Nautobot

CVE-2026-83801 is a stored Cross-Site Scripting (XSS) vulnerability in Nautobot. The vulnerability arises because the application interpolates user-controlled database properties—specifically Relationship descriptions and Module Family names—directly into the help_text parameter of Django form fields. These fields are rendered using Django's |safe filter, bypassing HTML escaping and enabling persistent injection. When an administrative user accesses the affected forms, the payload executes contextually in their browser. This allows attackers to hijack active sessions and perform unauthorized operations. Nautobot versions prior to v2.4.37 and v3.1.8 are affected by this vulnerability. The issue has been patched by implementing contextual HTML escaping and strict markdown sanitization.

Alon Barad
Alon Barad
5 views•5 min read
•about 4 hours ago•CVE-2026-83805
6.4

CVE-2026-83805: Authorization Bypass and Privilege Escalation in Nautobot Approval Workflows

An authorization bypass vulnerability exists in Nautobot's REST API endpoints handling approval workflows. Due to an architectural inconsistency, a standalone, generic REST API endpoint for creating approval responses was exposed without propagating the required business-logic validations. This allows low-privileged authenticated users to submit forged, self-approved votes, bypassing approval thresholds and triggering unauthorized server-side automated jobs.

Amit Schendel
Amit Schendel
5 views•7 min read
•about 5 hours ago•CVE-2026-85709
5.3

CVE-2026-85709: Sensitive Information Exposure in LightRAG API Server

CVE-2026-85709 is a sensitive information exposure vulnerability in HKUDS LightRAG prior to version 1.5.5. The vulnerability allows remote, unauthenticated clients to trigger server-side errors and receive raw Python exception details, including local filesystem paths, database connection strings, credentials, and internal system configurations.

Amit Schendel
Amit Schendel
5 views•6 min read
•about 6 hours ago•CVE-2026-85725
5.9

CVE-2026-85725: Observable Timing Side-Channel Vulnerability in HKUDS LightRAG

HKUDS LightRAG prior to version 1.5.5 is vulnerable to multiple timing side-channels (CWE-208) in its API authentication layer. The password verification logic in `lightrag/api/passwords.py` compares plaintext administrative credentials using Python's short-circuiting equality operator (`==`). Additionally, `lightrag/api/auth.py` terminates authentication early on non-existent usernames, creating an observable latency difference compared to computationally expensive bcrypt comparisons on valid accounts. Together, these allow remote unauthenticated attackers with low-latency network access to enumerate valid usernames and extract plaintext passwords character by character.

Amit Schendel
Amit Schendel
4 views•5 min read