Directory traversal in the file selector widget in contao/core-bundle
Description
Contao is an Open Source CMS. In affected versions authenticated users in the back end can list files outside the document root in the file selector widget. Users are advised to update to Contao 4.13.49. There are no known workarounds for this vulnerability.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Authenticated back-end users in Contao CMS can exploit the file selector widget to list files outside the document root due to insufficient path validation.
Vulnerability
Contao CMS versions before 4.13.49 contain a directory traversal vulnerability in the file selector widget (FileSelector class). The renderFiletree method does not check whether the requested path is within the user's allowed file mounts, allowing authenticated back-end users to list files outside the document root [1][3].
Exploitation
An attacker with valid back-end credentials can craft a request to the file selector widget with a path traversal sequence (e.g., ../../etc) to list files in arbitrary directories. The vulnerability is exploitable without any special privileges beyond a standard back-end account [4]. The commit that fixes the issue adds an isMounted() check, which verifies that the path is within the user's file mounts or the default upload path [3].
Impact
Successful exploitation allows an attacker to enumerate files and directories outside the intended document root, potentially revealing sensitive configuration files, source code, or other data. This breach of confidentiality could aid in further attacks on the application or server [1][4].
Mitigation
The vulnerability is patched in Contao version 4.13.49. Users should update to this version or later. No known workarounds exist [1].
AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
contao/core-bundlePackagist | < 4.13.49 | 4.13.49 |
Affected products
2- contao/contaov5Range: < 4.13.49
Patches
163409c6bdfd9Merge commit from fork
1 file changed · +37 −0
core-bundle/src/Resources/contao/widgets/FileSelector.php+37 −0 modified@@ -362,6 +362,11 @@ public function generateAjax($strFolder, $strField, $level, $mount=false) */ protected function renderFiletree($path, $intMargin, $mount=false, $blnProtected=true, $arrFound=array()) { + if (!$this->isMounted($path)) + { + throw new \RuntimeException('Folder "' . $path . '" is not mounted or cannot be found.'); + } + // Invalid path if (!is_dir($path)) { @@ -665,6 +670,38 @@ protected function isProtectedPath($path) return true; } + + protected function isMounted($path) + { + if (Validator::isInsecurePath($path)) + { + throw new \RuntimeException('Insecure path ' . $path); + } + + $this->import(BackendUser::class, 'User'); + + $path = StringUtil::stripRootDir($path); + $filemounts = array(); + + if ($this->User->isAdmin) + { + $filemounts[] = System::getContainer()->getParameter('contao.upload_path'); + } + elseif (\is_array($this->User->filemounts)) + { + $filemounts = $this->User->filemounts; + } + + foreach ($filemounts as $filemount) + { + if (Path::isBasePath($filemount, $path)) + { + return true; + } + } + + return false; + } } class_alias(FileSelector::class, 'FileSelector');
Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5- github.com/advisories/GHSA-4p75-5p53-65m9ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2024-45604ghsaADVISORY
- contao.org/en/security-advisories/directory-traversal-in-the-fileselector-widgetghsax_refsource_MISCWEB
- github.com/contao/contao/commit/63409c6bdfd95197d9906e229d765b630d45742eghsaWEB
- github.com/contao/contao/security/advisories/GHSA-4p75-5p53-65m9ghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.