GHSA-gxrg-x694-283w

Suggest an improvement
Source
https://github.com/advisories/GHSA-gxrg-x694-283w
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/09/GHSA-gxrg-x694-283w/GHSA-gxrg-x694-283w.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-gxrg-x694-283w
Aliases
Published
2026-09-23T14:31:10Z
Modified
2026-09-23T14:45:06Z
Severity
  • 5.3 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N CVSS Calculator
Summary
Solspace Freeform: Limited Twig template injection via submitted field values
Details

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.

Database specific
{
    "cwe_ids":  [
        "CWE-1336"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-09-23T14:31:10Z",
    "nvd_published_at":  null,
    "severity":  "MODERATE"
}
References

Affected packages

Packagist / solspace/craft-freeform

Package

Name
solspace/craft-freeform
Purl
pkg:composer/solspace/craft-freeform

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.0.0
Fixed
5.10.14

Affected versions

5.*
5.0.0
5.0.1
5.0.2
5.0.3
5.0.4
5.0.5
5.0.6
5.0.6.1
5.0.7
5.0.8
5.0.9
5.0.10
5.0.11
5.0.12
5.0.13
5.0.14
5.0.14.1
5.0.15
5.0.16
5.1.0
5.1.1
5.1.2
5.1.3
5.1.4
5.1.5
5.1.5.1
5.1.6
5.1.7
5.1.8
5.1.9
5.1.10
5.1.11
5.1.12
5.1.13
5.1.13.1
5.1.14
5.1.15
5.1.16
5.1.16.1
5.1.17
5.1.18
5.1.18.1
5.1.19
5.1.19.1
5.2.0
5.2.1
5.2.2
5.3.0
5.3.1
5.3.2
5.3.3
5.3.3.1
5.3.4
5.3.5
5.4.0
5.4.1
5.4.2
5.5.0
5.5.1
5.5.2
5.5.3
5.5.4
5.5.5
5.5.6
5.5.7
5.5.8
5.5.9
5.5.10
5.6.0
5.6.1
5.6.2
5.6.3
5.6.4
5.6.5
5.6.6
5.6.7
5.6.8
5.7.0
5.7.0.1
5.7.1
5.7.2
5.7.3
5.7.4
5.8.0
5.8.1
5.8.2
5.8.3
5.8.4
5.8.5
5.8.6
5.8.7
5.9.0
5.9.1
5.9.1.1
5.9.1.2
5.9.2
5.9.3
5.9.4
5.9.5
5.9.6
5.9.7
5.9.8
5.9.9
5.9.10
5.9.11
5.9.12
5.9.13
5.9.14
5.9.15
5.9.16
5.9.16.1
5.10.0
5.10.1
5.10.2
5.10.3
5.10.4
5.10.5
5.10.6
5.10.7
5.10.8
5.10.9
5.10.10
5.10.11
5.10.12
5.10.13

Database specific

last_known_affected_version_range
"<= 5.10.13"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/09/GHSA-gxrg-x694-283w/GHSA-gxrg-x694-283w.json"