CVE-2026-59191: Cakephp/twig view TwigView FileLoader May Allow Arbitrary Vulnerability

MODERATE
Advisory Identifier: GHSA-hq9r-72jq-2pxp
CWE-22
Published
Advisory Summary

CVE-2026-59191 is a MODERATE twigview fileloader may allow arbitrary vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Cakephp/twig view libraries in the Packagist ecosystem. The issue involves twigview fileloader may allow arbitrary file reads through user-controlled template paths. Remediation is available by upgrading affected packages to version 1.3.3, 2.1.2.

CVE-2026-59191 at a Glance

CVE Identifier CVE-2026-59191
GHSA Identifier GHSA-hq9r-72jq-2pxp
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Cakephp/twig view
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2026-59191

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

cakephp/twig-view fixed: 1.3.3
Upgrade cakephp/twig-view to 1.3.3
cakephp/twig-view fixed: 2.1.2
Upgrade cakephp/twig-view to 2.1.2
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 cakephp/twig-view

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-59191, inspect your project dependencies for Cakephp/twig view:

inspect dependencies for cakephp/twig-view

Analyze the terminal output to locate any version of Cakephp/twig view in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.3.3), 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-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Cakephp/twig view, 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 If `FileLoader::findTemplate()` is supplied un-validated user controlled data, arbitrary files can be read. ### Patches 1.3.3 and 2.1.2 contain a fix for this issue. ### Workarounds Don't supply user controlled data to `include` and `extends` tags.

CVE-2026-59191 Affected Cakephp/twig view Versions

2 component(s)
Fixed Versions:
1.3.32.1.2
Product / Package Ecosystem Affected Versions Fixed Version
cakephp/twig-view
Packagist
< 1.3.3
1.3.3
cakephp/twig-view
Packagist
≥ 2.0.0
< 2.1.2
2.1.2

References

Frequently Asked Questions

What is CVE-2026-59191?
CVE-2026-59191 is a security vulnerability in Cakephp/twig view involving TwigView FileLoader may allow arbitrary file reads through user-controlled template paths under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Cakephp/twig view versions are affected?
Affected versions include releases prior to 1.3.3, 2.1.2 across affected packages: cakephp/twig-view.
What version fixes CVE-2026-59191?
Upgrading to 1.3.3, 2.1.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is cakephp/twig-view affected?
Yes, cakephp/twig-view is affected in releases prior to 1.3.3, 2.1.2. Upgrade your dependency to 1.3.3, 2.1.2 or later.
What CWE is associated with CVE-2026-59191?
CVE-2026-59191 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check Packagist dependencies for CVE-2026-59191?
Run the dependency tree command: 'inspect dependencies for cakephp/twig-view'. 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-hq9r-72jq-2pxp",
  "modified" : "2026-11-24T22:39:23Z",
  "published" : "2026-11-24T22:39:23Z",
  "aliases" : [ "CVE-2026-59191" ],
  "summary" : "TwigView FileLoader may allow arbitrary file reads through user-controlled template paths",
  "details" : "### Impact\nIf `FileLoader::findTemplate()` is supplied un-validated user controlled data, arbitrary files can be read.\n\n### Patches\n1.3.3 and 2.1.2 contain a fix for this issue.\n\n### Workarounds\nDon't supply user controlled data to `include` and `extends` tags.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "cakephp/twig-view"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.3.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "cakephp/twig-view"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.1.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/cakephp/twig-view/security/advisories/GHSA-hq9r-72jq-2pxp"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-59191"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cakephp/twig-view/commit/1c5107c9f562ab285273ceafd1c28bf314faa6d5"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cakephp/twig-view/commit/65f5035ee65e76925242fdca2dc2bb0d732b6c1d"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/cakephp/twig-view"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cakephp/twig-view/releases/tag/1.3.3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cakephp/twig-view/releases/tag/2.1.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-11-24T22:39:23Z",
    "nvd_published_at" : "2026-11-11T05:19:49Z"
  }
}