CVE-2026-52889: Verbb/formie Formie Hidden Field Defaults Vulnerable Vulnerability

CRITICAL
Advisory Identifier: GHSA-565m-g33j-jq96
CVSS 9.8
CWE-1336
Published
Advisory Summary

CVE-2026-52889 is a CRITICAL (CVSS 9.8) formie hidden field defaults vulnerable vulnerability (CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine) affecting Verbb/formie libraries in the Packagist ecosystem. The issue involves formie hidden field defaults vulnerable to server-side template injection. Remediation is available by upgrading affected packages to version 3.1.27.

CVE-2026-52889 at a Glance

CVE Identifier CVE-2026-52889
GHSA Identifier GHSA-565m-g33j-jq96
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine
Affected Product Verbb/formie
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 9.8

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:H/I:H/A:H).

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 High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-52889

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

verbb/formie fixed: 3.1.27
Upgrade verbb/formie to 3.1.27
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 verbb/formie

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-52889, inspect your project dependencies for Verbb/formie:

inspect dependencies for verbb/formie

Analyze the terminal output to locate any version of Verbb/formie in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.1.27), 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 Verbb/formie, 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 Formie Hidden fields could evaluate request-derived values as Twig during front-end form rendering. When a Hidden field used a dynamic default value such as HTTP User Agent, Referer URL, Current URL, Query Parameter, or Cookie Value, the value was copied from the incoming request and later passed to Craft’s Twig rendering layer. This allowed an unauthenticated attacker to provide Twig syntax in request-controlled input and have it evaluated server-side when the form was rendered. ## Affected Versions `verbb/formie` for Craft 5: - Affected: >= 3.0.0-beta.1, <= 3.1.26 - Patched: 3.1.27 ## Impact An unauthenticated attacker could trigger server-side template evaluation by visiting a public form containing a Hidden field configured with a request-derived default value. Because Craft’s normal Twig environment exposes application objects, this may lead to disclosure of sensitive information, modification of application state, or remote code execution depending on the site configuration and available Twig capabilities. ## Technical Details The issue exists in the Hidden field front-end render path. Request-derived Hidden field defaults were assigned to the field’s defaultValue, then rendered via Twig in `Hidden::getFrontEndInputOptions()`. The fix ensures Twig rendering is only performed for the custom default option, where the template source is admin-authored. Request-derived default options are now treated as plain strings. ## Patches Update to Formie 3.1.27 or later. ## Workarounds Until patched, avoid using request-derived Hidden field defaults on public forms, including: - HTTP User Agent - HTTP Refer URL - Current URL - Current URL without Query String - Query Parameter - Cookie Value Alternatively, remove affected Hidden fields from public forms until the update is applied. ## Credit Name: Yanchon918s Email: [ao9s@ao9s.net](mailto:ao9s@ao9s.net)

CVE-2026-52889 Affected Verbb/formie Versions

1 component(s)
Fixed Versions:
3.1.27
Product / Package Ecosystem Affected Versions Fixed Version
verbb/formie
Packagist
< 3.1.27
3.1.27

References

Frequently Asked Questions

What is CVE-2026-52889?
CVE-2026-52889 is a security vulnerability in Verbb/formie involving Formie Hidden field defaults vulnerable to Server-Side Template Injection under CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine.
Which Verbb/formie versions are affected?
Affected versions include releases prior to 3.1.27 across affected packages: verbb/formie.
What version fixes CVE-2026-52889?
Upgrading to 3.1.27 (or the latest patched release for your respective branch) resolves the vulnerability.
Is verbb/formie affected?
Yes, verbb/formie is affected in releases prior to 3.1.27. Upgrade your dependency to 3.1.27 or later.
What is the CVSS score of CVE-2026-52889?
CVE-2026-52889 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-52889?
CVE-2026-52889 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-52889?
Run the dependency tree command: 'inspect dependencies for verbb/formie'. 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-565m-g33j-jq96",
  "modified" : "2026-07-06T16:52:16Z",
  "published" : "2026-07-06T16:52:16Z",
  "aliases" : [ "CVE-2026-52889" ],
  "summary" : "Formie Hidden field defaults vulnerable to Server-Side Template Injection",
  "details" : "## Summary\nFormie Hidden fields could evaluate request-derived values as Twig during front-end form rendering.\n\nWhen a Hidden field used a dynamic default value such as HTTP User Agent, Referer URL, Current URL, Query Parameter, or Cookie Value, the value was copied from the incoming request and later passed to Craft’s Twig rendering layer. This allowed an unauthenticated attacker to provide Twig syntax in request-controlled input and have it evaluated server-side when the form was rendered.\n\n## Affected Versions\n`verbb/formie` for Craft 5:\n- Affected: >= 3.0.0-beta.1, <= 3.1.26\n- Patched: 3.1.27\n\n## Impact\nAn unauthenticated attacker could trigger server-side template evaluation by visiting a public form containing a Hidden field configured with a request-derived default value.\n\nBecause Craft’s normal Twig environment exposes application objects, this may lead to disclosure of sensitive information, modification of application state, or remote code execution depending on the site configuration and available Twig capabilities.\n\n## Technical Details\nThe issue exists in the Hidden field front-end render path. Request-derived Hidden field defaults were assigned to the field’s defaultValue, then rendered via Twig in `Hidden::getFrontEndInputOptions()`.\n\nThe fix ensures Twig rendering is only performed for the custom default option, where the template source is admin-authored. Request-derived default options are now treated as plain strings.\n\n## Patches\nUpdate to Formie 3.1.27 or later.\n\n## Workarounds\nUntil patched, avoid using request-derived Hidden field defaults on public forms, including:\n- HTTP User Agent\n- HTTP Refer URL\n- Current URL\n- Current URL without Query String\n- Query Parameter\n- Cookie Value\n\nAlternatively, remove affected Hidden fields from public forms until the update is applied.\n\n## Credit\nName: Yanchon918s\nEmail: [ao9s@ao9s.net](mailto:ao9s@ao9s.net)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "verbb/formie"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.1.27"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/verbb/formie/security/advisories/GHSA-565m-g33j-jq96"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/verbb/formie"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1336" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-06T16:52:16Z",
    "nvd_published_at" : null
  }
}