{"id":"CVE-2025-31493","published":"2025-05-13T15:24:40Z","modified":"2025-05-13T19:08:37Z","title":"Path traversal of collection names during file system lookup","vendor":"getkirby","product":"kirby","tier":"tail","description":{"text":"Kirby is an open-source content management system. A vulnerability in versions prior to 3.9.8.3, 3.10.1.2, and 4.7.1 affects all Kirby sites that use the `collection()` helper or `$kirby->collection()` method with a dynamic collection name (such as a collection name that depends on request or user data). Sites that only use fixed calls to the `collection()` helper/`$kirby->collection()` method (i.e. calls with a simple string for the collection name) are *not* affected. A missing path traversal check allowed attackers to navigate and access all files on the server that were accessible to the PHP process, including files outside of the collections root or even outside of the Kirby installation. PHP code within such files was executed. Such attacks first require an attack vector in the site code that is caused by dynamic collection names, such as `collection('tags-' . get('tags'))`. It generally also requires knowledge of the site structure and the server's file system by the attacker, although it can be possible to find vulnerable setups through automated methods such as fuzzing. In a vulnerable setup, this could cause damage to the confidentiality and integrity of the server. The problem has been patched in Kirby 3.9.8.3, Kirby 3.10.1.2, and Kirby 4.7.1. In all of the mentioned releases, the maintainers of Kirby have added a check for the collection path that ensures that the resulting path is contained within the configured collections root. Collection paths that point outside of the collections root will not be loaded.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.3,"severity":"MEDIUM","version":"4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.006,"percentile":0.49682,"provenance":"source"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"},{"id":"CWE-23","name":"Relative Path Traversal"}],"references":[{"url":"https://github.com/getkirby/kirby/security/advisories/GHSA-x275-h9j4-7p4h","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/getkirby/kirby/releases/tag/3.10.1.2","tags":["x_refsource_MISC"]},{"url":"https://github.com/getkirby/kirby/releases/tag/3.9.8.3","tags":["x_refsource_MISC"]},{"url":"https://github.com/getkirby/kirby/releases/tag/4.7.1","tags":["x_refsource_MISC"]}],"priority":{"score":14.3,"factors":[{"name":"EPSS percentile","points":9.94},{"name":"CVSS severity","points":4.41}]},"vendorSlug":"getkirby","affectedVersions":[{"vendor":"getkirby","product":"kirby","versions":["< 3.9.8.3",">= 3.10.0, < 3.10.1.2",">= 4.0.0, < 4.7.1"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2025-05-13T19:08:28.624462Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Packagist","package":"getkirby/cms","vulnerableRanges":["<3.9.8.3",">=3.10.0, <3.10.1.2",">=4.0.0, <4.7.1"],"patched":["3.9.8.3","3.10.1.2","4.7.1"],"from":["GHSA-x275-h9j4-7p4h"],"provenance":"source"}],"summary":{"text":"Kirby, an open-source content management system, has a path traversal flaw in how it resolves collection names during file system lookup, caused by a missing check that keeps collection paths inside the collections root. An attacker can reach files on the server readable by the PHP process, including files outside the Kirby installation, and execute PHP code within them, but only on sites that pass dynamic values (such as request or user data) into the collection() helper or $kirby->collection() method, and with some knowledge of the site structure and file system.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:38:20Z"},"euvd":{"id":"EUVD-2025-14510","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2024-27087","published":"2024-02-26","fixed":"4.1.1","kev":false},{"cve":"CVE-2024-41964","published":"2024-08-29","fixed":"4.3.1","kev":false,"link":{"from":"CVE-2024-41964","to":"CVE-2025-31493","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Packagist:getkirby/cms","fromFixed":"3.9.8.2","toFixed":"3.9.8.3","daysApart":257},{"kind":"version-step","provenance":"source","package":"Packagist:getkirby/cms","fromFixed":"4.3.1","toFixed":"4.7.1","daysApart":257}]}},{"cve":"CVE-2025-30207","published":"2025-05-13","fixed":"4.7.1","kev":false},{"cve":"CVE-2025-31493","published":"2025-05-13","fixed":"4.7.1","kev":false},{"cve":"CVE-2025-65012","published":"2025-11-18","fixed":"5.1.4","kev":false},{"cve":"CVE-2026-21896","published":"2026-01-08","fixed":"5.2.2","kev":false},{"cve":"CVE-2026-32870","published":"2026-04-24","fixed":"5.4.0","kev":false}],"package":"Packagist:getkirby/cms"}}