CVE-2026-73858: Solspace Freeform Limited Twig Template Injection Vulnerability

MODERATE
Advisory Identifier: GHSA-gxrg-x694-283w
CVSS 5.3
CWE-1336
Published
Advisory Summary

CVE-2026-73858 is a MODERATE (CVSS 5.3) limited twig template injection vulnerability (CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine) affecting Solspace Freeform libraries in the Packagist ecosystem. The issue involves limited twig template injection via submitted field values. Remediation is available by upgrading affected packages to version 5.10.14.

CVE-2026-73858 at a Glance

CVE Identifier CVE-2026-73858
GHSA Identifier GHSA-gxrg-x694-283w
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine
Affected Product Solspace Freeform
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-73858

To remediate this vulnerability, upgrade all affected Solspace Freeform dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

solspace/craft-freeform fixed: 5.10.14
Upgrade solspace/craft-freeform to 5.10.14
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for solspace/craft-freeform

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-73858, inspect your project dependencies for Solspace Freeform:

inspect dependencies for solspace/craft-freeform

Analyze the terminal output to locate any version of Solspace Freeform in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.10.14), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine, where the product uses a template engine to insert or process externally-influenced input, but it does not neutralize or incorrectly neutralizes special elements or syntax that can be interpreted as template expressions or other code directives when processed by the engine. In Solspace Freeform, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary A limited server-side Twig template injection issue was identified in Solspace Freeform for Craft CMS. In affected versions, submitted form field values could be evaluated as Twig in certain rendering contexts. Unauthenticated users could submit Twig expressions through public Freeform forms and have those expressions evaluated when the submitted values were rendered back into the form response. Confirmed impact includes disclosure of limited server/environment information, such as the PHP version and absolute filesystem paths. No evidence was found that this issue allowed access to Craft globals, environment variables, database credentials, mailer credentials, security keys, or remote code execution in the tested environment. ### Details **Plugin:** Solspace Freeform **Affected versions:** Freeform 5.0.0 through 5.10.13 **CMS:** Craft CMS **Authentication required:** None **Attack vector:** Public Freeform form submission Submitted field values were passed through Freeform’s isolated Twig renderer. As a result, Twig expressions included in submitted values could be evaluated server-side and reflected in the HTTP response. The isolated Twig context appears to limit the available functions and globals. Confirmed accessible values were limited to PHP/core constants and Craft bootstrap constants such as: ```twig {{ constant('PHP_VERSION') }} {{ constant('PHP_OS') }} {{ constant('CRAFT_BASE_PATH') }} {{ constant('CRAFT_VENDOR_PATH') }} ``` Testing did not confirm access to: ```text craft craft.app alias() getenv() database credentials mailer credentials Craft security key Craft license key environment variables ``` ### Proof of Concept 1. Submit a public Freeform form. 2. Inject the following payload into an email field: ```twig {{ constant('PHP_VERSION') }}@example.com ``` The response may reflect the evaluated PHP version, for example: ```html value="8.2.27@example.com" ``` 3. Inject the following payload into a text field: ```twig {{ constant('CRAFT_VENDOR_PATH') }} ``` The response may reflect the absolute vendor path, for example: ```text /var/www/example-site/production/vendor/ ``` ### Impact An unauthenticated attacker with access to a public Freeform form could cause limited Twig expressions to be evaluated server-side. Confirmed impact includes: ```text PHP version disclosure Operating system/platform disclosure Absolute filesystem path disclosure Potential form rendering errors from malformed Twig input ``` This could assist with environment fingerprinting or be used in combination with other vulnerabilities. However, no credential disclosure, Craft application access, arbitrary file read, or remote code execution was confirmed. ### Remediation Freeform should treat submitted field values as plain user input and should not evaluate them as Twig. Twig rendering should be limited to trusted/admin-authored templates and configuration values. This issue has been resolved by preventing submitted field values from being rendered as Twig in the affected context.

CVE-2026-73858 Affected Solspace Freeform Versions

1 component(s)
Fixed Versions:
5.10.14
Product / Package Ecosystem Affected Versions Fixed Version
solspace/craft-freeform
Packagist
≥ 5.0.0
< 5.10.14
5.10.14

References

Frequently Asked Questions

What is CVE-2026-73858?
CVE-2026-73858 is a security vulnerability in Solspace Freeform involving Limited Twig template injection via submitted field values under CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine.
Which Solspace Freeform versions are affected?
Affected versions include releases prior to 5.10.14 across affected packages: solspace/craft-freeform.
What version fixes CVE-2026-73858?
Upgrading to 5.10.14 (or the latest patched release for your respective branch) resolves the vulnerability.
Is solspace/craft-freeform affected?
Yes, solspace/craft-freeform is affected in releases prior to 5.10.14. Upgrade your dependency to 5.10.14 or later.
What is the CVSS score of CVE-2026-73858?
CVE-2026-73858 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2026-73858?
CVE-2026-73858 is classified under CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine (The product uses a template engine to insert or process externally-influenced input, but it does not neutralize or incorrectly neutralizes special elements or syntax that can be interpreted as template expressions or other code directives when processed by the engine.).
How can I check Packagist dependencies for CVE-2026-73858?
Run the dependency tree command: 'inspect dependencies for solspace/craft-freeform'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-gxrg-x694-283w",
  "modified" : "2026-09-23T14:31:10Z",
  "published" : "2026-09-23T14:31:10Z",
  "aliases" : [ "CVE-2026-73858" ],
  "summary" : "Solspace Freeform: Limited Twig template injection via submitted field values",
  "details" : "### Summary\n\nA limited server-side Twig template injection issue was identified in Solspace Freeform for Craft CMS. In affected versions, submitted form field values could be evaluated as Twig in certain rendering contexts.\n\nUnauthenticated users could submit Twig expressions through public Freeform forms and have those expressions evaluated when the submitted values were rendered back into the form response. Confirmed impact includes disclosure of limited server/environment information, such as the PHP version and absolute filesystem paths.\n\nNo evidence was found that this issue allowed access to Craft globals, environment variables, database credentials, mailer credentials, security keys, or remote code execution in the tested environment.\n\n### Details\n\n**Plugin:** Solspace Freeform\n**Affected versions:** Freeform 5.0.0 through 5.10.13\n**CMS:** Craft CMS\n**Authentication required:** None\n**Attack vector:** Public Freeform form submission\n\nSubmitted field values were passed through Freeform’s isolated Twig renderer. As a result, Twig expressions included in submitted values could be evaluated server-side and reflected in the HTTP response.\n\nThe isolated Twig context appears to limit the available functions and globals. Confirmed accessible values were limited to PHP/core constants and Craft bootstrap constants such as:\n\n```twig\n{{ constant('PHP_VERSION') }}\n{{ constant('PHP_OS') }}\n{{ constant('CRAFT_BASE_PATH') }}\n{{ constant('CRAFT_VENDOR_PATH') }}\n```\n\nTesting did not confirm access to:\n\n```text\ncraft\ncraft.app\nalias()\ngetenv()\ndatabase credentials\nmailer credentials\nCraft security key\nCraft license key\nenvironment variables\n```\n\n### Proof of Concept\n\n1. Submit a public Freeform form.\n\n2. Inject the following payload into an email field:\n\n```twig\n{{ constant('PHP_VERSION') }}@example.com\n```\n\nThe response may reflect the evaluated PHP version, for example:\n\n```html\nvalue=\"8.2.27@example.com\"\n```\n\n3. Inject the following payload into a text field:\n\n```twig\n{{ constant('CRAFT_VENDOR_PATH') }}\n```\n\nThe response may reflect the absolute vendor path, for example:\n\n```text\n/var/www/example-site/production/vendor/\n```\n\n### Impact\n\nAn unauthenticated attacker with access to a public Freeform form could cause limited Twig expressions to be evaluated server-side.\n\nConfirmed impact includes:\n\n```text\nPHP version disclosure\nOperating system/platform disclosure\nAbsolute filesystem path disclosure\nPotential form rendering errors from malformed Twig input\n```\n\nThis could assist with environment fingerprinting or be used in combination with other vulnerabilities. However, no credential disclosure, Craft application access, arbitrary file read, or remote code execution was confirmed.\n\n### Remediation\n\nFreeform should treat submitted field values as plain user input and should not evaluate them as Twig. Twig rendering should be limited to trusted/admin-authored templates and configuration values.\n\nThis issue has been resolved by preventing submitted field values from being rendered as Twig in the affected context.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "solspace/craft-freeform"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.10.14"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.10.13"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/solspace/craft-freeform/security/advisories/GHSA-gxrg-x694-283w"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/solspace/craft-freeform/pull/1986"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/solspace/craft-freeform/commit/5f7555320635f1cd3b4c478aa0b58e8c3144313b"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/solspace/craft-freeform"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/solspace/craft-freeform/releases/tag/v5.10.14"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1336" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-23T14:31:10Z",
    "nvd_published_at" : null
  }
}