CVE-2026-45697: Formie Pre-authenticated Server-side Template Injection Vulnerability

CRITICAL
Advisory Identifier: GHSA-x7m9-mwc2-g6w2
CVSS 9.8
CWE-693 CWE-94 CWE-1336
Published
Advisory Summary

CVE-2026-45697 is a CRITICAL (CVSS 9.8) pre-authenticated server-side template injection vulnerability (CWE-693: Protection Mechanism Failure) affecting Formie libraries in the Packagist ecosystem. The issue involves pre-authenticated server-side template injection in hidden fields. Remediation is available by upgrading affected packages to version 3.1.24, 2.2.20.

CVE-2026-45697 at a Glance

CVE Identifier CVE-2026-45697
GHSA Identifier GHSA-x7m9-mwc2-g6w2
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-693: Protection Mechanism Failure
Affected Product 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-45697

To remediate this vulnerability, upgrade all affected 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.24
Upgrade verbb/formie to 3.1.24
verbb/formie fixed: 2.2.20
Upgrade verbb/formie to 2.2.20
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-45697, inspect your project dependencies for Formie:

inspect dependencies for verbb/formie

Analyze the terminal output to locate any version of 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.24), 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-693: Protection Mechanism Failure, where the product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product. In 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

### Impact - Unauthenticated users could submit crafted values into Hidden fields (with Default value → Custom) that were evaluated as Twig during submission handling, which could lead to serious compromise of the Craft site (depending on template/sandbox behavior). - Sites with public Formie forms that include at least one Hidden field with that configuration. - No CP login for the reported chain. ### Patches - [2.2.20](https://github.com/verbb/formie/releases/tag/2.2.20), [3.1.24](https://github.com/verbb/formie/releases/tag/3.1.24) ### Workarounds - Temporarily remove Hidden fields from public forms or switch Hidden default away from Custom where feasible - Otherwise, upgrade to patched versions

CVE-2026-45697 Affected Formie Versions

2 component(s)
Fixed Versions:
3.1.242.2.20
Product / Package Ecosystem Affected Versions Fixed Version
verbb/formie
Packagist
≥ 3.0.0-beta.1
< 3.1.24
3.1.24
verbb/formie
Packagist
< 2.2.20
2.2.20

References

Frequently Asked Questions

What is CVE-2026-45697?
CVE-2026-45697 is a security vulnerability in Formie involving Pre-authenticated server-side template injection in Hidden fields under CWE-693: Protection Mechanism Failure.
Which Formie versions are affected?
Affected versions include releases prior to 3.1.24, 2.2.20 across affected packages: verbb/formie.
What version fixes CVE-2026-45697?
Upgrading to 3.1.24, 2.2.20 (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.24, 2.2.20. Upgrade your dependency to 3.1.24, 2.2.20 or later.
What is the CVSS score of CVE-2026-45697?
CVE-2026-45697 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-45697?
CVE-2026-45697 is classified under CWE-693: Protection Mechanism Failure (The product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product.).
How can I check Packagist dependencies for CVE-2026-45697?
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-x7m9-mwc2-g6w2",
  "modified" : "2026-06-09T10:32:38Z",
  "published" : "2026-05-18T17:23:39Z",
  "aliases" : [ "CVE-2026-45697" ],
  "summary" : "Formie: Pre-authenticated server-side template injection in Hidden fields",
  "details" : "### Impact\n- Unauthenticated users could submit crafted values into Hidden fields (with Default value → Custom) that were evaluated as Twig during submission handling, which could lead to serious compromise of the Craft site (depending on template/sandbox behavior).\n- Sites with public Formie forms that include at least one Hidden field with that configuration.\n- No CP login for the reported chain.\n\n### Patches\n- [2.2.20](https://github.com/verbb/formie/releases/tag/2.2.20), [3.1.24](https://github.com/verbb/formie/releases/tag/3.1.24)\n\n### Workarounds\n- Temporarily remove Hidden fields from public forms or switch Hidden default away from Custom where feasible\n- Otherwise, upgrade to patched versions",
  "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" : "3.0.0-beta.1"
      }, {
        "fixed" : "3.1.24"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "verbb/formie"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.2.20"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/verbb/formie/security/advisories/GHSA-x7m9-mwc2-g6w2"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-45697"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/verbb/formie/commit/f690d5623163ce2a95da305238d6367575486ee3"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/verbb/formie"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/verbb/formie/releases/tag/2.2.20"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/verbb/formie/releases/tag/3.1.24"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1336", "CWE-693", "CWE-94" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-18T17:23:39Z",
    "nvd_published_at" : "2026-05-29T20:16:27Z"
  }
}