{"schemaVersion":3,"id":"CVE-2022-39261","aliases":["UBUNTU-CVE-2022-39261","DEBIAN-CVE-2022-39261","DLA-3147-1","DSA-5248-1"],"status":"published","duplicateOf":null,"title":null,"description":"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.","dates":{"published":"2022-09-28T00:00:00.000Z","modified":"2025-04-23T16:54:59.321Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":7.5,"severity":"high","version":"3.1","versionLabel":"v3.1","source":"CVE.org","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","computed":false,"selection":"backend-summary"},"metrics":[{"version":"3.1","versionLabel":"v3.1","source":"CVE.org","score":7.5,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","exploitability":null,"impact":null,"computed":false},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Ubuntu","score":7.5,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","exploitability":10,"impact":6,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Debian","score":7.5,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","exploitability":10,"impact":6,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"NVD","score":7.5,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.03174,"percentile":0.87873,"severity":"low","asOf":"2026-10-20T00:00:00.000Z","change":{"pp":0.6119999999999997,"baselineDate":"2026-09-20T00:00:00.000Z","baselineScore":0.02562},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.02562,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.02562,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.02562,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.02562,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.02562,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.02562,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.02562,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.02562,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.02562,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.02562,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.02562,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.03174,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.03174,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.03174,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.03174,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.03174,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.03174,"percentile":0.87873}],"last30":[{"date":"2026-09-20T00:00:00.000Z","score":0.02562,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.02562,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.02562,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.02562,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.02562,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.03152,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.03174,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.03174,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.03174,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.03174,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.03174,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.03174,"percentile":0.87873}]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[],"exploitCount":0,"weaknesses":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')","description":"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.","type":"weakness","status":"Stable","abstraction":"Base","likelihoodOfExploit":"High","url":"https://cwe.mitre.org/data/definitions/22.html"}],"affected":[{"vendor":"debian","product":"php-twig","name":"php-twig","label":"php-twig","ecosystem":"Debian","cpePart":null,"purl":"pkg:deb/debian/php-twig","purlType":"deb","versions":[{"text":"< 2.14.3-1+deb11u2","noFixRecorded":false,"fixedIn":null},{"text":"< 3.4.3-1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 2.14.3-1+deb11u2 | < 3.4.3-1","eol":null,"hubHref":null},{"vendor":"debian","product":"twig","name":"twig","label":"twig","ecosystem":"Debian","cpePart":null,"purl":"pkg:deb/debian/twig","purlType":"deb","versions":[{"text":"< 2.6.2-2+deb10u1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 2.6.2-2+deb10u1","eol":{"isEol":null,"eolDate":null,"matchMethod":"name_exact","cycle":null,"product":{"name":"twig","label":"Twig","category":"framework"}},"hubHref":null},{"vendor":"ubuntu","product":"php-twig","name":"php-twig","label":"php-twig","ecosystem":"Ubuntu","cpePart":null,"purl":"pkg:deb/ubuntu/php-twig","purlType":"deb","versions":[{"text":"< 2.12.5-1ubuntu0.1~esm1","noFixRecorded":false,"fixedIn":null},{"text":"< 3.3.8-2ubuntu4+esm1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 2.12.5-1ubuntu0.1~esm1 | < 3.3.8-2ubuntu4+esm1","eol":null,"hubHref":null},{"vendor":"ubuntu","product":"twig","name":"twig","label":"twig","ecosystem":"Ubuntu","cpePart":null,"purl":"pkg:deb/ubuntu/twig","purlType":"deb","versions":[{"text":"< 1.23.1-1ubuntu4+esm1","noFixRecorded":false,"fixedIn":null},{"text":"< 2.4.6-1ubuntu0.1~esm1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 1.23.1-1ubuntu4+esm1 | < 2.4.6-1ubuntu0.1~esm1","eol":{"isEol":null,"eolDate":null,"matchMethod":"name_exact","cycle":null,"product":{"name":"twig","label":"Twig","category":"framework"}},"hubHref":null},{"vendor":"debian","product":"debian_linux","name":"debian linux","label":"debian_linux","ecosystem":null,"cpePart":"o","purl":null,"purlType":null,"versions":[{"text":"10.0","noFixRecorded":false,"fixedIn":null},{"text":"11.0","noFixRecorded":false,"fixedIn":null}],"versionsText":"10.0 | 11.0","eol":{"isEol":true,"eolDate":"2024-06-30T00:00:00.000Z","matchMethod":"cpe","cycle":{"name":"10","label":"10 (Buster)","eolFrom":"2024-06-30T00:00:00.000Z","isLts":false,"isMaintained":true,"latestVersion":"10.13"},"product":{"name":"debian","label":"Debian","category":"os"}},"hubHref":"/vendor/debian/debian_linux"},{"vendor":"drupal","product":"drupal","name":"drupal","label":"drupal","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"≥ 8.0.0, < 9.3.22","noFixRecorded":false,"fixedIn":null},{"text":"≥ 9.4.0, < 9.4.7","noFixRecorded":false,"fixedIn":null}],"versionsText":"≥ 8.0.0, < 9.3.22 | ≥ 9.4.0, < 9.4.7","eol":{"isEol":null,"eolDate":null,"matchMethod":"cpe","cycle":null,"product":{"name":"drupal","label":"Drupal","category":"server-app"}},"hubHref":"/vendor/drupal/drupal"},{"vendor":"fedoraproject","product":"fedora","name":"fedora","label":"fedora","ecosystem":null,"cpePart":"o","purl":null,"purlType":null,"versions":[{"text":"35","noFixRecorded":false,"fixedIn":null},{"text":"36","noFixRecorded":false,"fixedIn":null},{"text":"37","noFixRecorded":false,"fixedIn":null}],"versionsText":"35 | 36 | 37","eol":{"isEol":true,"eolDate":"2022-12-13T00:00:00.000Z","matchMethod":"cpe","cycle":{"name":"35","label":"35","eolFrom":"2022-12-13T00:00:00.000Z","isLts":false,"isMaintained":false,"latestVersion":null},"product":{"name":"fedora","label":"Fedora Linux","category":"os"}},"hubHref":"/vendor/fedoraproject/fedora"},{"vendor":"symfony","product":"twig","name":"twig","label":"twig","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"≥ 1.0.0, < 1.44.7","noFixRecorded":false,"fixedIn":null},{"text":"≥ 2.0.0, < 2.15.3","noFixRecorded":false,"fixedIn":null},{"text":"≥ 3.0.0, < 3.4.3","noFixRecorded":false,"fixedIn":null}],"versionsText":"≥ 1.0.0, < 1.44.7 | ≥ 2.0.0, < 2.15.3 | ≥ 3.0.0, < 3.4.3","eol":{"isEol":null,"eolDate":null,"matchMethod":"name_exact","cycle":null,"product":{"name":"twig","label":"Twig","category":"framework"}},"hubHref":"/vendor/symfony/twig"},{"vendor":"twigphp","product":"twig","name":"Twig","label":"twig","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"=> 1.0.0, < 1.44.7","noFixRecorded":false,"fixedIn":null},{"text":"≥ 2.0.0, < 2.15.3","noFixRecorded":false,"fixedIn":null},{"text":"≥ 3.0.0, < 3.4.3","noFixRecorded":false,"fixedIn":null}],"versionsText":"=> 1.0.0, < 1.44.7 | ≥ 2.0.0, < 2.15.3 | ≥ 3.0.0, < 3.4.3","eol":{"isEol":null,"eolDate":null,"matchMethod":"name_exact","cycle":null,"product":{"name":"twig","label":"Twig","category":"framework"}},"hubHref":"/vendor/twigphp/twig"}],"affectedCount":9,"eol":{"hasEol":true,"count":2},"references":[{"url":"https://github.com/twigphp/Twig/security/advisories/GHSA-52m2-vc4m-jj33","label":"github.com/twigphp/Twig/security/advisories/GHSA-52m2-vc4m-jj33","hostname":"github.com","tags":["REPORT","Third Party Advisory"]},{"url":"https://github.com/twigphp/Twig/commit/35f3035c5deb0041da7b84daf02dea074ddc7a0b","label":"github.com/twigphp/Twig/commit/35f3035c5deb0041da7b84daf02dea074ddc7a0b","hostname":"github.com","tags":["REPORT","Patch","Third Party Advisory"]},{"url":"https://www.drupal.org/sa-core-2022-016","label":"www.drupal.org/sa-core-2022-016","hostname":"www.drupal.org","tags":["REPORT","Patch","Third Party Advisory"]},{"url":"https://www.debian.org/security/2022/dsa-5248","label":"www.debian.org/security/2022/dsa-5248","hostname":"www.debian.org","tags":["Vendor Advisory","Third Party Advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/AUVTXMNPSZAHS3DWZEM56V5W4NPVR6L7/","label":"lists.fedoraproject.org/archives/…","hostname":"lists.fedoraproject.org","tags":["Vendor Advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/2OKRUHPVLIQVFPPJ2UWC3WV3WQO763NR/","label":"lists.fedoraproject.org/archives/…","hostname":"lists.fedoraproject.org","tags":["Vendor Advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/YU4ZYX62H2NUAKKGUES4RZIM4KMTKZ7F/","label":"lists.fedoraproject.org/archives/…","hostname":"lists.fedoraproject.org","tags":["Vendor Advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NWRFPZSR74SYVJKBTKTMYUK36IJ3SQJP/","label":"lists.fedoraproject.org/archives/…","hostname":"lists.fedoraproject.org","tags":["Vendor Advisory"]},{"url":"https://lists.debian.org/debian-lts-announce/2022/10/msg00016.html","label":"lists.debian.org/debian-lts-announce/2022/10/msg00016.html","hostname":"lists.debian.org","tags":["Mailing List","Third Party Advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TW53TFJ6WWNXMUHOFACKATJTS7NIHVQE/","label":"lists.fedoraproject.org/archives/…","hostname":"lists.fedoraproject.org","tags":["Vendor Advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/WV5TNNJLGG536TJH6DLCIAAZZIPV2GUD/","label":"lists.fedoraproject.org/archives/…","hostname":"lists.fedoraproject.org","tags":["Vendor Advisory"]},{"url":"https://ubuntu.com/security/CVE-2022-39261","label":"ubuntu.com/security/CVE-2022-39261","hostname":"ubuntu.com","tags":["REPORT"]},{"url":"https://ubuntu.com/security/notices/USN-5947-1","label":"ubuntu.com/security/notices/USN-5947-1","hostname":"ubuntu.com","tags":["Advisory"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2022-39261","label":"www.cve.org/CVERecord?id=CVE-2022-39261","hostname":"www.cve.org","tags":["REPORT"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2022-39261","label":"security-tracker.debian.org/tracker/CVE-2022-39261","hostname":"security-tracker.debian.org","tags":["Advisory"]}],"lineage":{"upstream":[],"downstream":["USN-5947-1"],"duplicates":[],"related":["USN-5947-1"]},"timeline":[{"kind":"published","date":"2022-09-28T00:00:00.000Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2025-04-23T16:54:59.321Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"risk":{"score":31,"level":"medium","profile":"Default","thresholds":{"critical":75,"high":50,"medium":25,"low":10}},"meta":{"dataAsOf":"2026-10-21T05:37:43.817Z","stale":false,"partial":false}}