PatchClock

PHP security digest · 23 Sep 2026

Solspace Freeform: Limited Twig template injection via submitted field values

Medium CVE-2026-73858

Package
solspace/craft-freeform
Fixed in
5.10.14
Published
Wed 23 Sep 2026, 15:31 LisbonUpdated Mon 26 Oct 2026, 01:26 Lisbon
Installs on Packagist
705K

In plain words

An unauthenticated attacker can submit Twig expressions through a public Freeform form and have them evaluated on the server when submitted values are rendered back into the form response. Confirmed effects include disclosure of the PHP version, operating system and absolute filesystem paths, plus possible form rendering errors. Testing did not confirm credential disclosure, Craft application access, arbitrary file reads or remote code execution.

Affected versions

PackageAffectedFixed in
solspace/craft-freeform>= 5.0.0, <= 5.10.135.10.14

Am I affected?

Check composer.lock for solspace/craft-freeform versions 5.0.0 through 5.10.13 inclusive. If present, check whether your Craft CMS site exposes public Freeform forms whose responses render submitted field values back to the user. Version 5.10.14 contains the fix.

What to do

Check which version you have, then update to a fixed release for your branch (5.10.14):

composer show solspace/craft-freeform | grep versions
composer update solspace/craft-freeform

If your version constraint in composer.json keeps you below a fixed release, raise it first. Whether your configuration is affected, and the exact version ranges, are in the advisory itself.

The advisory's description

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:

{{ constant('PHP_VERSION') }}
{{ constant('PHP_OS') }}
{{ constant('CRAFT_BASE_PATH') }}
{{ constant('CRAFT_VENDOR_PATH') }}

Testing did not confirm access to:

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:

{{ constant('PHP_VERSION') }}@example.com

The response may reflect the evaluated PHP version, for example:

value="8.2.27@example.com"
  1. Inject the following payload into a text field:
{{ constant('CRAFT_VENDOR_PATH') }}

The response may reflect the absolute vendor path, for example:

/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:

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.

Weakness: CWE-1336 Improper Neutralization of Special Elements Used in a Template Engine. Reported by wakedxy.

The advisory

From OSV.dev, which gathers the GitHub Advisory Database, FriendsOfPHP and Drupal security advisories; the summary is theirs. The description, affected versions, weakness and credits are from the GitHub Advisory Database (CC BY 4.0). "In plain words", "Am I affected?" and "If you cannot update yet" are based on that advisory, and checked to name no version it does not.