CVE-2022-39261
Twig may load a template outside a configured directory when using the filesystem loader
Twig is a template language for PHP. Versions 1.x prior to 1.44.7, 2.x prior to 2.15.3, and 3.x prior to 3.4.3 encounter an issue when the filesystem loader loads templates for which the name is a user input. It is possible to use the `source` or `include` statement to read arbitrary files from outside the templates' directory when using a namespace like `@somewhere/../some.file`. In such a case, validation is bypassed. Versions 1.44.7, 2.15.3, and 3.4.3 contain a fix for validation of such template names. There are no known workarounds aside from upgrading.
Exposure status: unknown. This page does not establish whether an installed system is affected or corrected.
Severity and exploitation evidence
EPSS: 3.174% · score date 2026-11-19. EPSS is an estimated probability over the next 30 days, not proof of exploitation.
CISA KEV: not included in the checked catalog; exploitation may still occur. Last checked: 2026-11-19T15:55:09.885Z. Public exploit availability is not used to set this status.
CVSS 3.1 · 7.5 · published by GitHub_MCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Assessment source · checked 2026-11-19T12:56:40.418Z
Verification by field
| Field | Status | Checked at (UTC) | Source |
|---|---|---|---|
| kev | verified | 2026-11-19T15:55:09.885Z | CISA KEV |
| cvss | verified | 2026-11-19T12:56:40.418Z | CVE Program |
| epss | verified | 2026-11-19T16:04:35.064Z | FIRST EPSS |
| patches | verified | 2026-11-19T12:52:00.377Z | OSV |
| affected | verified | 2026-11-19T12:56:40.418Z | CVE Program |
| lifecycle | verified | 2026-11-19T12:56:40.418Z | CVE Program |
Affected versions and configuration
twigphp Twig; default status: unknown: => 1.0.0, < 1.44.7 [affected; scheme: unspecified]; >= 2.0.0, < 2.15.3 [affected; scheme: unspecified]; >= 3.0.0, < 3.4.3 [affected; scheme: unspecified]
Defaults, conditional configuration, package status and version schemes are retained below. A version range alone is not an exposure verdict.
CVE Program · cve-json · full conditions
{
"affected": [
{
"vendor": "twigphp",
"product": "Twig",
"versions": [
{
"status": "affected",
"version": "=> 1.0.0, < 1.44.7"
},
{
"status": "affected",
"version": ">= 2.0.0, < 2.15.3"
},
{
"status": "affected",
"version": ">= 3.0.0, < 3.4.3"
}
]
}
],
"additionalContainers": [
{
"title": "CVE Program Container",
"references": [
{
"url": "https://github.com/twigphp/Twig/security/advisories/GHSA-52m2-vc4m-jj33",
"tags": [
"x_transferred"
]
},
{
"url": "https://github.com/twigphp/Twig/commit/35f3035c5deb0041da7b84daf02dea074ddc7a0b",
"tags": [
"x_transferred"
]
},
{
"url": "https://www.drupal.org/sa-core-2022-016",
"tags": [
"x_transferred"
]
},
{
"url": "https://www.debian.org/security/2022/dsa-5248",
"name": "DSA-5248",
"tags": [
"vendor-advisory",
"x_transferred"
]
},
{
"url": "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/AUVTXMNPSZAHS3DWZEM56V5W4NPVR6L7/",
"name": "FEDORA-2022-4490a4772d",
"tags": [
"vendor-advisory",
"x_transferred"
]
},
{
"url": "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/2OKRUHPVLIQVFPPJ2UWC3WV3WQO763NR/",
"name": "FEDORA-2022-d39b2a755b",
"tags": [
"vendor-advisory",
"x_transferred"
]
},
{
"url": "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/YU4ZYX62H2NUAKKGUES4RZIM4KMTKZ7F/",
"name": "FEDORA-2022-1695454935",
"tags": [
"vendor-advisory",
"x_transferred"
]
},
{
"url": "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NWRFPZSR74SYVJKBTKTMYUK36IJ3SQJP/",
"name": "FEDORA-2022-9d8ee4a6de",
"tags": [
"vendor-advisory",
"x_transferred"
]
},
{
"url": "https://lists.debian.org/debian-lts-announce/2022/10/msg00016.html",
"name": "[debian-lts-announce] 20221011 [SECURITY] [DLA 3147-1] twig security update",
"tags": [
"mailing-list",
"x_transferred"
]
},
{
"url": "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TW53TFJ6WWNXMUHOFACKATJTS7NIHVQE/",
"name": "FEDORA-2022-c6fe3ebd94",
"tags": [
"vendor-advisory",
"x_transferred"
]
},
{
"url": "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/WV5TNNJLGG536TJH6DLCIAAZZIPV2GUD/",
"name": "FEDORA-2022-73b9fb7a77",
"tags": [
"vendor-advisory",
"x_transferred"
]
}
],
"providerMetadata": {
"orgId": "af854a3a-2127-422b-91ae-364da2661108",
"shortName": "CVE",
"dateUpdated": "2024-08-03T12:00:43.686Z"
}
},
{
"title": "CISA ADP Vulnrichment",
"metrics": [
{
"other": {
"type": "ssvc",
"content": {
"id": "CVE-2022-39261",
"role": "CISA Coordinator",
"options": [
{
"Exploitation": "none"
},
{
"Automatable": "yes"
},
{
"Technical Impact": "partial"
}
],
"version": "2.0.3",
"timestamp": "2025-04-23T15:50:56.522548Z"
}
}
}
],
"providerMetadata": {
"orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"shortName": "CISA-ADP",
"dateUpdated": "2025-04-23T16:54:59.321Z"
}
}
]
}Archived source JSONOSV · osv · full conditions
{
"id": "GHSA-52m2-vc4m-jj33",
"aliases": [
"BIT-drupal-2022-39261",
"CVE-2022-39261",
"DRUPAL-CORE-2022-016"
],
"affected": [
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "1.0.0"
},
{
"fixed": "1.44.7"
}
]
}
],
"package": {
"name": "twig/twig",
"purl": "pkg:composer/twig/twig",
"ecosystem": "Packagist"
},
"versions": [
"1.3.0",
"1.4.0",
"1.5.0",
"1.5.1",
"1.6.0",
"1.6.1",
"1.6.2",
"1.6.3",
"1.6.4",
"1.6.5",
"v1.10.0",
"v1.10.1",
"v1.10.2",
"v1.10.3",
"v1.11.0",
"v1.11.1",
"v1.12.0",
"v1.12.0-RC1",
"v1.12.1",
"v1.12.2",
"v1.12.3",
"v1.13.0",
"v1.13.1",
"v1.13.2",
"v1.14.0",
"v1.14.1",
"v1.14.2",
"v1.15.0",
"v1.15.1",
"v1.16.0",
"v1.16.1",
"v1.16.2",
"v1.16.3",
"v1.17.0",
"v1.18.0",
"v1.18.1",
"v1.18.2",
"v1.19.0",
"v1.20.0",
"v1.21.0",
"v1.21.1",
"v1.21.2",
"v1.22.0",
"v1.22.1",
"v1.22.2",
"v1.22.3",
"v1.23.0",
"v1.23.1",
"v1.23.2",
"v1.23.3",
"v1.24.0",
"v1.24.1",
"v1.24.2",
"v1.25.0",
"v1.26.0",
"v1.26.1",
"v1.27.0",
"v1.28.0",
"v1.28.1",
"v1.28.2",
"v1.29.0",
"v1.30.0",
"v1.31.0",
"v1.32.0",
"v1.33.0",
"v1.33.1",
"v1.33.2",
"v1.34.0",
"v1.34.1",
"v1.34.2",
"v1.34.3",
"v1.34.4",
"v1.35.0",
"v1.35.1",
"v1.35.2",
"v1.35.3",
"v1.35.4",
"v1.36.0",
"v1.37.0",
"v1.37.1",
"v1.38.0",
"v1.38.1",
"v1.38.2",
"v1.38.3",
"v1.38.4",
"v1.39.0",
"v1.39.1",
"v1.40.0",
"v1.40.1",
"v1.41.0",
"v1.42.0",
"v1.42.1",
"v1.42.2",
"v1.42.3",
"v1.42.4",
"v1.42.5",
"v1.43.0",
"v1.43.1",
"v1.44.0",
"v1.44.1",
"v1.44.2",
"v1.44.3",
"v1.44.4",
"v1.44.5",
"v1.44.6",
"v1.7.0",
"v1.8.0",
"v1.8.1",
"v1.8.2",
"v1.8.3",
"v1.9.0",
"v1.9.1",
"v1.9.2"
],
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/09/GHSA-52m2-vc4m-jj33/GHSA-52m2-vc4m-jj33.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "2.0.0"
},
{
"fixed": "2.15.3"
}
]
}
],
"package": {
"name": "twig/twig",
"purl": "pkg:composer/twig/twig",
"ecosystem": "Packagist"
},
"versions": [
"v2.0.0",
"v2.1.0",
"v2.10.0",
"v2.11.0",
"v2.11.1",
"v2.11.2",
"v2.11.3",
"v2.12.0",
"v2.12.1",
"v2.12.2",
"v2.12.3",
"v2.12.4",
"v2.12.5",
"v2.13.0",
"v2.13.1",
"v2.14.0",
"v2.14.1",
"v2.14.10",
"v2.14.11",
"v2.14.12",
"v2.14.13",
"v2.14.2",
"v2.14.3",
"v2.14.4",
"v2.14.5",
"v2.14.6",
"v2.14.7",
"v2.14.8",
"v2.14.9",
"v2.15.0",
"v2.15.1",
"v2.15.2",
"v2.2.0",
"v2.3.0",
"v2.3.1",
"v2.3.2",
"v2.4.0",
"v2.4.1",
"v2.4.2",
"v2.4.3",
"v2.4.4",
"v2.4.5",
"v2.4.6",
"v2.4.7",
"v2.4.8",
"v2.5.0",
"v2.6.0",
"v2.6.1",
"v2.6.2",
"v2.7.0",
"v2.7.1",
"v2.7.2",
"v2.7.3",
"v2.7.4",
"v2.8.0",
"v2.8.1",
"v2.9.0"
],
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/09/GHSA-52m2-vc4m-jj33/GHSA-52m2-vc4m-jj33.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "3.0.0"
},
{
"fixed": "3.4.3"
}
]
}
],
"package": {
"name": "twig/twig",
"purl": "pkg:composer/twig/twig",
"ecosystem": "Packagist"
},
"versions": [
"v3.0.0",
"v3.0.1",
"v3.0.2",
"v3.0.3",
"v3.0.4",
"v3.0.5",
"v3.1.0",
"v3.1.1",
"v3.2.1",
"v3.3.0",
"v3.3.1",
"v3.3.10",
"v3.3.2",
"v3.3.3",
"v3.3.4",
"v3.3.5",
"v3.3.6",
"v3.3.7",
"v3.3.8",
"v3.3.9",
"v3.4.0",
"v3.4.1",
"v3.4.2"
],
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/09/GHSA-52m2-vc4m-jj33/GHSA-52m2-vc4m-jj33.json"
}
}
],
"severity": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
}
],
"upstream": [],
"withdrawn": null,
"references": [
{
"url": "https://github.com/twigphp/Twig/security/advisories/GHSA-52m2-vc4m-jj33",
"type": "WEB"
},
{
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-39261",
"type": "ADVISORY"
},
{
"url": "https://github.com/twigphp/Twig/commit/35f3035c5deb0041da7b84daf02dea074ddc7a0b",
"type": "WEB"
},
{
"url": "https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2022-39261.yaml",
"type": "WEB"
},
{
"url": "https://github.com/twigphp/Twig",
"type": "PACKAGE"
},
{
"url": "https://lists.debian.org/debian-lts-announce/2022/10/msg00016.html",
"type": "WEB"
},
{
"url": "https://lists.fedoraproject.org/archives/list/[email protected]/message/2OKRUHPVLIQVFPPJ2UWC3WV3WQO763NR",
"type": "WEB"
},
{
"url": "https://lists.fedoraproject.org/archives/list/[email protected]/message/AUVTXMNPSZAHS3DWZEM56V5W4NPVR6L7",
"type": "WEB"
},
{
"url": "https://lists.fedoraproject.org/archives/list/[email protected]/message/NWRFPZSR74SYVJKBTKTMYUK36IJ3SQJP",
"type": "WEB"
},
{
"url": "https://lists.fedoraproject.org/archives/list/[email protected]/message/TW53TFJ6WWNXMUHOFACKATJTS7NIHVQE",
"type": "WEB"
},
{
"url": "https://lists.fedoraproject.org/archives/list/[email protected]/message/WV5TNNJLGG536TJH6DLCIAAZZIPV2GUD",
"type": "WEB"
},
{
"url": "https://lists.fedoraproject.org/archives/list/[email protected]/message/YU4ZYX62H2NUAKKGUES4RZIM4KMTKZ7F",
"type": "WEB"
},
{
"url": "https://symfony.com/blog/twig-security-release-possibility-to-load-a-template-outside-a-configured-directory-when-using-the-filesystem-loader",
"type": "WEB"
},
{
"url": "https://www.debian.org/security/2022/dsa-5248",
"type": "WEB"
},
{
"url": "https://www.drupal.org/sa-core-2022-016",
"type": "WEB"
}
],
"relatedGitRanges": [],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"severity": "HIGH",
"github_reviewed": true,
"nvd_published_at": "2022-09-28T14:15:00Z",
"github_reviewed_at": "2022-09-30T05:29:36Z"
}
}Archived source JSONCorrection evidence
Distribution packages and upstream releases are distinct. ESM channels may require the corresponding Ubuntu entitlement. Notes and branch ranges are not installable package versions. OSV fixed boundaries are ecosystem-specific version thresholds, not proof that a package is currently available or installed.
| Evidence type | Distribution / release | Package | Channel | Version or source note | Source |
|---|---|---|---|---|---|
| ecosystem-boundary | Packagist / package | twig/twig | Not a distribution channel | 1.44.7 | Official record |
| ecosystem-boundary | Packagist / package | twig/twig | Not a distribution channel | 2.15.3 | Official record |
| ecosystem-boundary | Packagist / package | twig/twig | Not a distribution channel | 3.4.3 | Official record |
Vendor notices and operational guidance
No connected vendor notice is available for this record.
Original sources and dates
- OSVConsulted: 2026-11-19T12:52:00.377ZArchived source JSON
Source publication: 2022-09-30T05:29:36.000Z
Source modification: 2025-12-10T23:41:22.048ZDocument fingerprint
9d87e41124382950f450b202fcbb05735441198a5cd145f7a5b8d54e448b5017 - CVE ProgramConsulted: 2026-11-19T12:56:40.418ZArchived source JSON
Source publication: 2022-09-28T00:00:00.000Z
Source modification: 2025-04-23T16:54:59.321ZDocument fingerprint
543b13bbabf2a983ca77ffa8f136a9d13a331e783b3a2adf384cf6a1f9990f75 - CISA KEVConsulted: 2026-11-19T15:55:09.885ZArchived source JSON
Source publication: not supplied
Source modification: 2026-11-18T19:17:41.0354ZDocument fingerprint
a35fdc67c7d9802988dcfc1d3ff1198da327948d1db122ab7692ac201055ac56 - FIRST EPSSConsulted: 2026-11-19T16:04:35.064ZArchived source JSON
Source publication: not supplied
Source modification: not suppliedDocument fingerprint
c13e0c6529336cd1e12663be20e318c9cd67e09307dd85d396d1c3a6f2ee454d
Official status history
- UNKNOWN → PUBLISHED · · evidence