CWE-23
AllowedRelative Path Traversal
Abstraction: Base · Status: Draft
The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as ".." that can resolve to a location that is outside of that directory.
778 vulnerabilities reference this CWE, most recent first.
GHSA-FQ77-7P7R-83RJ
Vulnerability from github – Published: 2020-03-30 20:40 – Updated: 2025-09-26 17:49Impact
- Not affected: Deployments on ZEIT Now v2 (https://zeit.co) are not affected
- Not affected: Deployments using the
serverlesstarget - Not affected: Deployments using
next export - Affected: Users of Next.js below 9.3.2
We recommend everyone to upgrade regardless of whether you can reproduce the issue or not.
Patches
https://github.com/zeit/next.js/releases/tag/v9.3.2
References
https://github.com/zeit/next.js/releases/tag/v9.3.2
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "next"
},
"ranges": [
{
"events": [
{
"introduced": "0.9.9"
},
{
"fixed": "9.3.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2020-5284"
],
"database_specific": {
"cwe_ids": [
"CWE-23"
],
"github_reviewed": true,
"github_reviewed_at": "2020-03-30T20:40:39Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "### Impact\n\n- **Not affected**: Deployments on ZEIT Now v2 ([https://zeit.co](https://zeit.co/)) are not affected\n- **Not affected**: Deployments using the `serverless` target\n- **Not affected**: Deployments using `next export`\n- **Affected**: Users of Next.js below 9.3.2\n\nWe recommend everyone to upgrade regardless of whether you can reproduce the issue or not.\n\n### Patches\n\nhttps://github.com/zeit/next.js/releases/tag/v9.3.2\n\n### References\n\nhttps://github.com/zeit/next.js/releases/tag/v9.3.2",
"id": "GHSA-fq77-7p7r-83rj",
"modified": "2025-09-26T17:49:56Z",
"published": "2020-03-30T20:40:50Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/zeit/next.js/security/advisories/GHSA-fq77-7p7r-83rj"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2020-5284"
},
{
"type": "WEB",
"url": "https://github.com/zeit/next.js/releases/tag/v9.3.2"
},
{
"type": "WEB",
"url": "https://www.npmjs.com/advisories/1503"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N",
"type": "CVSS_V3"
}
],
"summary": "Directory Traversal in Next.js"
}
GHSA-FRPG-JH29-93CV
Vulnerability from github – Published: 2025-09-04 15:30 – Updated: 2025-09-04 15:30IBM Jazz Foundation 7.0.2 through 7.0.2 iFix033, 7.0.3 through 7.0.3 iFix012, and 7.1.0 through 7.1.0 iFix002 could allow an authenticated user to upload files to the system due to improper neutralization of sequences that can resolve to a restricted directory.
{
"affected": [],
"aliases": [
"CVE-2025-25048"
],
"database_specific": {
"cwe_ids": [
"CWE-23"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-09-04T15:15:46Z",
"severity": "MODERATE"
},
"details": "IBM Jazz Foundation 7.0.2 through 7.0.2 iFix033, 7.0.3 through 7.0.3 iFix012, and 7.1.0 through 7.1.0 iFix002 could allow an authenticated user to upload files to the system due to improper neutralization of sequences that can resolve to a restricted directory.",
"id": "GHSA-frpg-jh29-93cv",
"modified": "2025-09-04T15:30:28Z",
"published": "2025-09-04T15:30:28Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-25048"
},
{
"type": "WEB",
"url": "https://www.ibm.com/support/pages/node/7244014"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-FV5G-WF76-67G3
Vulnerability from github – Published: 2025-12-05 06:31 – Updated: 2025-12-05 18:31In CKSource CKFinder before 2.5.0.1 for ASP.NET, authenticated users could download any file from the server if the correct path to a file was provided.
{
"affected": [],
"aliases": [
"CVE-2016-20023"
],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-23"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-12-05T06:16:03Z",
"severity": "MODERATE"
},
"details": "In CKSource CKFinder before 2.5.0.1 for ASP.NET, authenticated users could download any file from the server if the correct path to a file was provided.",
"id": "GHSA-fv5g-wf76-67g3",
"modified": "2025-12-05T18:31:09Z",
"published": "2025-12-05T06:31:30Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2016-20023"
},
{
"type": "WEB",
"url": "https://ckeditor.com/ckfinder/release-notes"
},
{
"type": "WEB",
"url": "https://download.cksource.com/CKFinder/CKFinder%20for%20ASP.NET/2.5.0.1"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:N/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-FV7G-CG7M-QJRP
Vulnerability from github – Published: 2024-09-10 18:30 – Updated: 2024-09-10 18:30Windows Remote Desktop Licensing Service Remote Code Execution Vulnerability
{
"affected": [],
"aliases": [
"CVE-2024-43454"
],
"database_specific": {
"cwe_ids": [
"CWE-23"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-09-10T17:15:32Z",
"severity": "HIGH"
},
"details": "Windows Remote Desktop Licensing Service Remote Code Execution Vulnerability",
"id": "GHSA-fv7g-cg7m-qjrp",
"modified": "2024-09-10T18:30:46Z",
"published": "2024-09-10T18:30:46Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-43454"
},
{
"type": "WEB",
"url": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2024-43454"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L",
"type": "CVSS_V3"
}
]
}
GHSA-FW82-87P8-V6HP
Vulnerability from github – Published: 2025-05-13 20:02 – Updated: 2025-05-13 20:02TL;DR
This vulnerability affects all Kirby sites that use the snippet() helper or $kirby->snippet() method with a dynamic snippet name (such as a snippet name that depends on request or user data).
Sites that only use fixed calls to the snippet() helper/$kirby->snippet() method (i.e. calls with a simple string for the snippet name) are not affected.
Introduction
Kirby's snippet() helper and $kirby->snippet() method (in the following abbreviated to the snippet() helper) allow to load PHP snippet files that are normally stored in the site/snippets folder or registered by plugins through the snippets plugin extension.
If the snippet() helper is called with an arbitrary snippet name, Kirby first checks if a file with this name exists in the snippets root (which defaults to site/snippets).
This logic was vulnerable against path traversal attacks. By using special elements such as .. and / separators, attackers can escape outside of the restricted location to access files or directories that are elsewhere on the system. One of the most common special elements is the ../ sequence, which in most modern operating systems is interpreted as the parent directory of the current location.
Because Kirby's snippet() helper did not protect against path traversal, the provided snippet name could include special sequences that would cause Kirby to look outside of the configured snippets root and access arbitrary files.
Impact
The 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 snippets 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 snippet names, such as snippet('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, for example:
- it could allow the attacker to build a map of the server's file system for subsequent attacks,
- it could allow access to configuration files that may contain sensitive information like security tokens or
- it could cause the unintended execution of PHP scripts.
Patches
The problem has been patched in Kirby 3.9.8.3, Kirby 3.10.1.2 and Kirby 4.7.1. Please update to one of these or a later version to fix the vulnerability.
In all of the mentioned releases, we have added a check for the snippet path that ensures that the resulting path is contained within the configured snippets root. Snippet paths that point outside of the snippets root will not be loaded.
Effects on site code
If you deliberately use path traversal in your projects, these uses will break after updating to one of the patched versions.
Examples of such uses include:
- Aliasing a template by loading another template with
snippet('../templates/other-template'). Robust alternatives are to userequire __DIR__ . '/other-template.php'or to override the$page->template()method in the page model:php class AnotherPage extends Page { public function template(): Template { return $this->kirby()->template('other-template'); } } - Loading a snippet from a shared directory in a multisite setup. A robust alternative is to restructure the project so that all sites share a single snippets root that then branches off into subdirectories for each site. If you prefer to keep the original structure, you can use symbolic links (symlinks) in the file system to include the shared directory in the site-specific snippets roots.
Credits
Thanks to Bruno Meilick (@bnomei) for reporting the identified issue. Thanks to Bruno Meilick and Tobias Möritz (@tobimori) for their input on the effects on site code.
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "getkirby/kirby"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.9.8.3"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Packagist",
"name": "getkirby/kirby"
},
"ranges": [
{
"events": [
{
"introduced": "3.10.0"
},
{
"fixed": "3.10.1.2"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Packagist",
"name": "getkirby/kirby"
},
"ranges": [
{
"events": [
{
"introduced": "4.0.0"
},
{
"fixed": "4.7.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2025-30159"
],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-23"
],
"github_reviewed": true,
"github_reviewed_at": "2025-05-13T20:02:23Z",
"nvd_published_at": "2025-05-13T15:15:56Z",
"severity": "MODERATE"
},
"details": "### TL;DR\n\nThis vulnerability affects all Kirby sites that use the `snippet()` helper or `$kirby-\u003esnippet()` method with a dynamic snippet name (such as a snippet name that depends on request or user data).\n\nSites that only use fixed calls to the `snippet()` helper/`$kirby-\u003esnippet()` method (i.e. calls with a simple string for the snippet name) are *not* affected.\n\n----\n\n### Introduction\n\nKirby\u0027s `snippet()` helper and `$kirby-\u003esnippet()` method (in the following abbreviated to the `snippet()` helper) allow to load PHP snippet files that are normally stored in the `site/snippets` folder or registered by plugins through the `snippets` plugin extension.\n\nIf the `snippet()` helper is called with an arbitrary snippet name, Kirby first checks if a file with this name exists in the snippets root (which defaults to `site/snippets`).\n\nThis logic was vulnerable against path traversal attacks. By using special elements such as `..` and `/` separators, attackers can escape outside of the restricted location to access files or directories that are elsewhere on the system. One of the most common special elements is the `../` sequence, which in most modern operating systems is interpreted as the parent directory of the current location.\n\nBecause Kirby\u0027s `snippet()` helper did not protect against path traversal, the provided snippet name could include special sequences that would cause Kirby to look outside of the configured snippets root and access arbitrary files.\n\n### Impact\n\nThe 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 snippets root or even outside of the Kirby installation. PHP code within such files was executed.\n\nSuch attacks first require an attack vector in the site code that is caused by dynamic snippet names, such as `snippet(\u0027tags-\u0027 . get(\u0027tags\u0027))`. It generally also requires knowledge of the site structure and the server\u0027s file system by the attacker, although it can be possible to find vulnerable setups through automated methods such as fuzzing.\n\nIn a vulnerable setup, this could cause damage to the confidentiality and integrity of the server, for example:\n\n- it could allow the attacker to build a map of the server\u0027s file system for subsequent attacks,\n- it could allow access to configuration files that may contain sensitive information like security tokens or\n- it could cause the unintended execution of PHP scripts.\n\n### Patches\n\nThe problem has been patched in [Kirby 3.9.8.3](https://github.com/getkirby/kirby/releases/tag/3.9.8.3), [Kirby 3.10.1.2](https://github.com/getkirby/kirby/releases/tag/3.10.1.2) and [Kirby 4.7.1](https://github.com/getkirby/kirby/releases/tag/4.7.1). Please update to one of these or a [later version](https://github.com/getkirby/kirby/releases) to fix the vulnerability.\n\nIn all of the mentioned releases, we have added a check for the snippet path that ensures that the resulting path is contained within the configured snippets root. Snippet paths that point outside of the snippets root will not be loaded.\n\n### Effects on site code\n\nIf you deliberately use path traversal in your projects, these uses will break after updating to one of the patched versions.\n\nExamples of such uses include:\n\n- Aliasing a template by loading another template with `snippet(\u0027../templates/other-template\u0027)`. Robust alternatives are to use `require __DIR__ . \u0027/other-template.php\u0027` or to override the `$page-\u003etemplate()` method in the page model:\n ```php\n class AnotherPage extends Page\n {\n public function template(): Template\n {\n return $this-\u003ekirby()-\u003etemplate(\u0027other-template\u0027);\n }\n }\n ```\n- Loading a snippet from a shared directory in a multisite setup. A robust alternative is to restructure the project so that all sites share a single snippets root that then branches off into subdirectories for each site. If you prefer to keep the original structure, you can use symbolic links (symlinks) in the file system to include the shared directory in the site-specific snippets roots.\n\n### Credits\n\nThanks to Bruno Meilick (@bnomei) for reporting the identified issue.\nThanks to Bruno Meilick and Tobias M\u00f6ritz (@tobimori) for their input on the effects on site code.",
"id": "GHSA-fw82-87p8-v6hp",
"modified": "2025-05-13T20:02:24Z",
"published": "2025-05-13T20:02:23Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/getkirby/kirby/security/advisories/GHSA-fw82-87p8-v6hp"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-30159"
},
{
"type": "WEB",
"url": "https://github.com/getkirby/kirby/commit/90acf7ed6d8d9d0697f938edc0940b4a563ddbe7"
},
{
"type": "PACKAGE",
"url": "https://github.com/getkirby/kirby"
},
{
"type": "WEB",
"url": "https://github.com/getkirby/kirby/releases/tag/3.10.1.2"
},
{
"type": "WEB",
"url": "https://github.com/getkirby/kirby/releases/tag/3.9.8.3"
},
{
"type": "WEB",
"url": "https://github.com/getkirby/kirby/releases/tag/4.7.1"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "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",
"type": "CVSS_V4"
}
],
"summary": "Kirby vulnerable to path traversal of snippet names in the `snippet()` helper"
}
GHSA-FWVG-XHVH-CWFV
Vulnerability from github – Published: 2022-05-24 19:05 – Updated: 2022-07-03 00:00Advantech WebAccess/SCADA Versions 9.0.1 and prior is vulnerable to a directory traversal, which may allow an attacker to remotely read arbitrary files on the file system.
{
"affected": [],
"aliases": [
"CVE-2021-32954"
],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-23"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2021-06-18T14:15:00Z",
"severity": "MODERATE"
},
"details": "Advantech WebAccess/SCADA Versions 9.0.1 and prior is vulnerable to a directory traversal, which may allow an attacker to remotely read arbitrary files on the file system.",
"id": "GHSA-fwvg-xhvh-cwfv",
"modified": "2022-07-03T00:00:24Z",
"published": "2022-05-24T19:05:39Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-32954"
},
{
"type": "WEB",
"url": "https://us-cert.cisa.gov/ics/advisories/icsa-21-168-03"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-FWX2-7CX7-P6J5
Vulnerability from github – Published: 2022-05-24 16:55 – Updated: 2024-04-04 01:50A relative path traversal vulnerability found in Advan VD-1 firmware versions up to 230. It allows attackers to download arbitrary files via url cgibin/ExportSettings.cgi?Download=filepath, without any authentication.
{
"affected": [],
"aliases": [
"CVE-2019-13408"
],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-23"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2019-08-29T01:15:00Z",
"severity": "HIGH"
},
"details": "A relative path traversal vulnerability found in Advan VD-1 firmware versions up to 230. It allows attackers to download arbitrary files via url cgibin/ExportSettings.cgi?Download=filepath, without any authentication.",
"id": "GHSA-fwx2-7cx7-p6j5",
"modified": "2024-04-04T01:50:36Z",
"published": "2022-05-24T16:55:06Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2019-13408"
},
{
"type": "WEB",
"url": "https://gist.github.com/keniver/f5155b42eb278ec0273b83565b64235b#file-androvideo-advan-vd-1-multiple-vulnerabilities-md"
},
{
"type": "WEB",
"url": "https://tvn.twcert.org.tw/taiwanvn/TVN-201906009"
},
{
"type": "WEB",
"url": "http://surl.twcert.org.tw/2bvXq"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-FWX6-6883-XR45
Vulnerability from github – Published: 2026-04-17 21:31 – Updated: 2026-07-11 00:31Anviz CX7 Firmware is vulnerable to an authenticated CSV upload which allows path traversal to overwrite arbitrary files (e.g., /etc/shadow), enabling unauthorized SSH access when combined with debug‑setting changes
{
"affected": [],
"aliases": [
"CVE-2026-31927"
],
"database_specific": {
"cwe_ids": [
"CWE-23"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-04-17T20:16:33Z",
"severity": "MODERATE"
},
"details": "Anviz CX7 Firmware\u00a0is vulnerable to an authenticated CSV upload which allows path traversal \nto overwrite arbitrary files (e.g., /etc/shadow), enabling unauthorized \nSSH access when combined with debug\u2011setting changes",
"id": "GHSA-fwx6-6883-xr45",
"modified": "2026-07-11T00:31:45Z",
"published": "2026-04-17T21:31:46Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-31927"
},
{
"type": "WEB",
"url": "https://github.com/cisagov/CSAF/blob/develop/csaf_files/OT/white/2026/icsa-26-106-03.json"
},
{
"type": "WEB",
"url": "https://www.anviz.com/contact-us.html"
},
{
"type": "WEB",
"url": "https://www.cisa.gov/news-events/ics-advisories/icsa-26-106-03"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-G2J9-G8R5-RG82
Vulnerability from github – Published: 2025-11-14 20:33 – Updated: 2025-11-14 20:33Summary
An unauthenticated Local File Inclusion exists in the template-switching feature: if templateselection is enabled in the configuration, the server trusts the template cookie and includes the referenced PHP file. An attacker can read sensitive data or, if they manage to drop a PHP file elsewhere, gain RCE.
Affected versions
PrivateBin versions since 1.7.7.
Conditions
templateselectiongot enabled incfg/conf.php- Visitor sets a cookie
templatepointing to an existing PHP file without it's suffix, using a path relative to thetplfolder. Absolute paths do not work.
Impact
The constructed path of the template file is checked for existence, then included. For PrivateBin project files this does not leak any secrets due to data files being created with PHP code that prevents execution, but if a configuration file without that line got created or the visitor figures out the relative path to a PHP script that directly performs an action without appropriate privilege checking, those might execute or leak information.
Impact analysis
In detail, we have analyzed different ways of exploiting this vulnerability and found no way to cause a full remote code execution (RCE) vulnerability or denial of service (DoS) as recursive includes, e.g., are not possible.
Generally, it is again notably to remember only PHP files of the local filesystem can be included. That's why potentially at risk PrivateBin PHP files have been analyzed.
- the PrivateBin config file is by default protected as it prevents access itself resulting in a 403 HTTP status code. This is called the “(PHP) protection line”.
- Likewise, the paste data cannot be accessed due to that “protection line”. Each created file contains the same line protecting it against PHP execution/inclusion.
- As for the
salt,purge_andtraffic_limiterfiles, they get included, but no data is displayed (variables or comments only), and a webserver specific error message is returned. - When one tries to include
index.php, you get a PHP error (possibly visible, depending on the webserver setup), due to define being called twice. - With any of the files in lib and likely those in vendor (we have not verified each dependency), code is only declared and not executed and the result is again a webserver specific error message.
- With the scripts in bin, the result is an error message, but code is executed to some extent, but you cannot pass arguments to any administrative scripts as they are read via
$_SERVER['argc'].
That said, the vulnerability could be used to chain more attacks or execute other non-PrivateBin related PHP files on the host system, if such other files exist and the (relative) path to them can be guessed. Also, should for some reason the PHP “protection line” be missing on your deployment the impact could be much worse and e.g. data like the URL shortener token or the database configuration from the configuration file could possibly be exfiltrated.
Real-life impact
PrivateBin has checked all instances versioned 1.7.7 and above listed in the PrivateBin directory and did find 11 instances that had the template switcher enabled. The following script was used to detect this:
for URL in $(
curl --silent --header 'Accept: application/json' 'https://privatebin.info/directory/api?top=100&version=1.7.7' | jq --raw-output '.[].url'
) $(
curl --silent --header 'Accept: application/json' 'https://privatebin.info/directory/api?top=100&version=1.7.8' | jq --raw-output '.[].url'
) $(
curl --silent --header 'Accept: application/json' 'https://privatebin.info/directory/api?top=100&version=2' | jq --raw-output '.[].url'
)
do
curl --silent "$URL" | grep -q 'id="template"' && echo "$URL uses template switcher"
done
None of these instances had an unprotected PrivateBin configuration file in use. The following script was used and may be adapted to check any single instance:
curl --silent --cookie 'template=../cfg/conf' https://privatebin.net
Technical Description
Users can select their preferred template via the template cookie, as seen in TemplateSwitcher::getSelectedByUserTemplate:
private static function getSelectedByUserTemplate(): ?string
{
$selectedTemplate = null;
$templateCookieValue = $_COOKIE['template'] ?? '';
if (self::isTemplateAvailable($templateCookieValue)) {
$selectedTemplate = $templateCookieValue;
}
return $selectedTemplate;
}
In this commit, introduced in 1.7.7, the TemplateSwitcher::isTemplateAvailable method went from this:
public static function isTemplateAvailable(string $template): bool
{
return in_array($template, self::getAvailableTemplates());
}
to this:
public static function isTemplateAvailable(string $template): bool
{
$available = in_array($template, self::getAvailableTemplates());
if (!$available && !View::isBootstrapTemplate($template)) {
$path = View::getTemplateFilePath($template);
$available = file_exists($path);
}
return $available;
}
The new code will now blindly trust $template, unless it starts with the string bootstrap-.
View::getTemplateFilePath will return PATH . 'tpl' . DIRECTORY_SEPARATOR . $file . '.php', allowing directory traversal, but preventing non-PHP files to be included.
View::draw will then include the user-submitted template:
public function draw($template)
{
$path = self::getTemplateFilePath($template);
if (!file_exists($path)) {
throw new Exception('Template ' . $template . ' not found!', 80);
}
extract($this->_variables);
include $path;
}
Note: this is only possible if templateselection configuration is enabled, or if no template has been set. The template will be rewritten if this condition isn't met:
private function _setDefaultTemplate()
{
$templates = $this->_conf->getKey('availabletemplates');
$template = $this->_conf->getKey('template');
TemplateSwitcher::setAvailableTemplates($templates);
TemplateSwitcher::setTemplateFallback($template);
// force default template, if template selection is disabled and a default is set
if (!$this->_conf->getKey('templateselection') && !empty($template)) {
$_COOKIE['template'] = $template;
setcookie('template', $template, array('SameSite' => 'Lax', 'Secure' => true));
}
}
Reproduction Steps
- Configure PrivateBin with templateselection = true (default template list is fine).
- Send a request with a malicious template cookie like
template=../cfg/conf, where the relative path points to a PHP file without its file suffix - The script now includes the select PHP file (leading to a 500 in that specific case).
Mitigation
Patches
The issue has been patched in version 2.0.3.
Workarounds
Set templateselection = false in cfg/conf.php or remove it, it's default is false.
Credits
PrivateBin would like to thank Benoit Esnard, who reported this vulnerability.
In general, PrivateBin would like to thank everyone reporting issues and potential vulnerabilities to us.
If a user suspects they have found a vulnerability or potential security risk, PrivateBin kindly asks them to follow the security policy and report it to PrivateBin. After submssion the report is assessed and necessary actions will be taken to address it.
Timeline
- 2025-11-09 Received report via GitHub Security Advisory
- 2025-11-10 Discussed and reproduced issue, wrote a unit test case based on this, started work on a patch
- 2025-11-11 Further work on patch, refactored related code
- 2025-11-12 Released patch with PrivateBin 2.0.3
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "privatebin/privatebin"
},
"ranges": [
{
"events": [
{
"introduced": "1.7.7"
},
{
"fixed": "2.0.3"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2025-64714"
],
"database_specific": {
"cwe_ids": [
"CWE-23",
"CWE-73",
"CWE-98"
],
"github_reviewed": true,
"github_reviewed_at": "2025-11-14T20:33:35Z",
"nvd_published_at": "2025-11-13T16:15:56Z",
"severity": "MODERATE"
},
"details": "## Summary\n\nAn unauthenticated Local File Inclusion exists in the template-switching feature: if `templateselection` is enabled in the configuration, the server trusts the `template` cookie and includes the referenced PHP file. An attacker can read sensitive data or, if they manage to drop a PHP file elsewhere, gain RCE.\n\n## Affected versions\n\nPrivateBin versions since 1.7.7.\n\n## Conditions\n\n- `templateselection` got enabled in `cfg/conf.php`\n- Visitor sets a cookie `template` pointing to an existing PHP file without it\u0027s suffix, using a path relative to the `tpl` folder. Absolute paths do not work.\n\n## Impact\n\nThe constructed path of the template file is checked for existence, then included. For PrivateBin project files this does not leak any secrets due to data files being created with PHP code that prevents execution, but if a configuration file without that line got created or the visitor figures out the relative path to a PHP script that directly performs an action without appropriate privilege checking, those might execute or leak information.\n\n### Impact analysis\nIn detail, we have analyzed different ways of exploiting this vulnerability and found no way to cause a full remote code execution (RCE) vulnerability or denial of service (DoS) as recursive includes, e.g., are not possible.\n\nGenerally, it is again notably to remember only PHP files of the local filesystem can be included. That\u0027s why potentially at risk PrivateBin PHP files have been analyzed.\n\n* the PrivateBin config file is by default [protected as it prevents access itself](https://github.com/PrivateBin/PrivateBin/blob/591d2d40e16a196aa628e3962a1c21bdf9793db2/cfg/conf.sample.php#L1) resulting in a 403 HTTP status code. This is called the \u201c(PHP) protection line\u201d.\n* Likewise, the paste data cannot be accessed due to that \u201cprotection line\u201d. [Each created file contains the same line protecting it against](https://github.com/PrivateBin/PrivateBin/blob/591d2d40e16a196aa628e3962a1c21bdf9793db2/lib/Data/Filesystem.php#L46) PHP execution/inclusion.\n* As for the `salt`, `purge_` and `traffic_limiter` files, they get included, but no data is displayed (variables or comments only), and a webserver specific error message is returned.\n* When one tries to include `index.php`, you get a PHP error (possibly visible, depending on the webserver setup), due to define being called twice.\n* With any of the files in lib and likely those in vendor (we have not verified each dependency), code is only declared and not executed and the result is again a webserver specific error message.\n* With the scripts in bin, the result is an error message, but code is executed to some extent, but you cannot pass arguments to any administrative scripts [as they are read via `$_SERVER[\u0027argc\u0027]`](https://github.com/PrivateBin/PrivateBin/blob/d32ac29925066c668241a165264c76de051398e3/bin/administration#L357C37-L357C54).\n\nThat said, the vulnerability could be used to chain more attacks or execute other non-PrivateBin related PHP files on the host system, if such other files exist and the (relative) path to them can be guessed.\nAlso, should for some reason the PHP \u201cprotection line\u201d be missing on your deployment the impact could be much worse and e.g. data like the URL shortener token or the database configuration from the configuration file could possibly be exfiltrated.\n\n### Real-life impact\n\nPrivateBin has checked all instances versioned 1.7.7 and above listed in the [PrivateBin directory](https://privatebin.info/directory/) and did find 11 instances that had the template switcher enabled. The following script was used to detect this:\n\n```shell\nfor URL in $(\n curl --silent --header \u0027Accept: application/json\u0027 \u0027https://privatebin.info/directory/api?top=100\u0026version=1.7.7\u0027 | jq --raw-output \u0027.[].url\u0027\n) $(\n curl --silent --header \u0027Accept: application/json\u0027 \u0027https://privatebin.info/directory/api?top=100\u0026version=1.7.8\u0027 | jq --raw-output \u0027.[].url\u0027\n) $(\n curl --silent --header \u0027Accept: application/json\u0027 \u0027https://privatebin.info/directory/api?top=100\u0026version=2\u0027 | jq --raw-output \u0027.[].url\u0027\n)\ndo\n curl --silent \"$URL\" | grep -q \u0027id=\"template\"\u0027 \u0026\u0026 echo \"$URL uses template switcher\"\ndone\n```\n\nNone of these instances had an unprotected PrivateBin configuration file in use. The following script was used and may be adapted to check any single instance:\n\n```shell\ncurl --silent --cookie \u0027template=../cfg/conf\u0027 https://privatebin.net\n```\n\n## Technical Description\n\nUsers can select their preferred template via the `template` cookie, as seen in `TemplateSwitcher::getSelectedByUserTemplate`:\n\n```php\n private static function getSelectedByUserTemplate(): ?string\n {\n $selectedTemplate = null;\n $templateCookieValue = $_COOKIE[\u0027template\u0027] ?? \u0027\u0027;\n\n if (self::isTemplateAvailable($templateCookieValue)) {\n $selectedTemplate = $templateCookieValue;\n }\n\n return $selectedTemplate;\n }\n```\n\nIn [this commit](44f8cfbfb8df4b4bec1cbf79aa8ce51abdb18be3), introduced in 1.7.7, the `TemplateSwitcher::isTemplateAvailable` method went from this:\n\n```php\n public static function isTemplateAvailable(string $template): bool\n {\n return in_array($template, self::getAvailableTemplates());\n }\n```\n\nto this:\n\n```php\n public static function isTemplateAvailable(string $template): bool\n {\n $available = in_array($template, self::getAvailableTemplates());\n\n if (!$available \u0026\u0026 !View::isBootstrapTemplate($template)) {\n $path = View::getTemplateFilePath($template);\n $available = file_exists($path);\n }\n\n return $available;\n }\n```\n\nThe new code will now blindly trust `$template`, unless it starts with the string `bootstrap-`.\n\n`View::getTemplateFilePath` will return `PATH . \u0027tpl\u0027 . DIRECTORY_SEPARATOR . $file . \u0027.php\u0027`, allowing directory traversal, but preventing non-PHP files to be included.\n\n`View::draw` will then include the user-submitted template:\n\n```php\n public function draw($template)\n {\n $path = self::getTemplateFilePath($template);\n if (!file_exists($path)) {\n throw new Exception(\u0027Template \u0027 . $template . \u0027 not found!\u0027, 80);\n }\n extract($this-\u003e_variables);\n include $path;\n }\n```\n\n**Note:** this is only possible if `templateselection` configuration is enabled, or if no template has been set. The `template` will be rewritten if this condition isn\u0027t met:\n\n```php\n private function _setDefaultTemplate()\n {\n $templates = $this-\u003e_conf-\u003egetKey(\u0027availabletemplates\u0027);\n $template = $this-\u003e_conf-\u003egetKey(\u0027template\u0027);\n TemplateSwitcher::setAvailableTemplates($templates);\n TemplateSwitcher::setTemplateFallback($template);\n\n // force default template, if template selection is disabled and a default is set\n if (!$this-\u003e_conf-\u003egetKey(\u0027templateselection\u0027) \u0026\u0026 !empty($template)) {\n $_COOKIE[\u0027template\u0027] = $template;\n setcookie(\u0027template\u0027, $template, array(\u0027SameSite\u0027 =\u003e \u0027Lax\u0027, \u0027Secure\u0027 =\u003e true));\n }\n }\n```\n\n### Reproduction Steps\n\n1. Configure PrivateBin with templateselection = true (default template list is fine).\n2. Send a request with a malicious template cookie like `template=../cfg/conf`, where the relative path points to a PHP file without its file suffix\n3. The script now includes the select PHP file (leading to a 500 in that specific case).\n\n## Mitigation\n\n### Patches\n\nThe issue has been patched in version 2.0.3.\n\n### Workarounds\n\nSet `templateselection = false` in `cfg/conf.php` or remove it, it\u0027s default is `false`.\n\n## Credits\n\nPrivateBin would like to thank [Benoit Esnard](https://github.com/esnard), who reported this vulnerability.\n\nIn general, PrivateBin would like to thank everyone reporting issues and potential vulnerabilities to us.\n\nIf a user suspects they have found a vulnerability or potential security risk, [PrivateBin kindly asks them to follow the security policy](https://github.com/PrivateBin/PrivateBin/blob/master/SECURITY.md) and report it to PrivateBin. After submssion the report is assessed and necessary actions will be taken to address it.\n\n## Timeline\n\n- 2025-11-09 Received report via GitHub Security Advisory\n- 2025-11-10 Discussed and reproduced issue, wrote a unit test case based on this, started work on a patch\n- 2025-11-11 Further work on patch, refactored related code\n- 2025-11-12 Released patch with PrivateBin 2.0.3",
"id": "GHSA-g2j9-g8r5-rg82",
"modified": "2025-11-14T20:33:36Z",
"published": "2025-11-14T20:33:35Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/PrivateBin/PrivateBin/security/advisories/GHSA-g2j9-g8r5-rg82"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-64714"
},
{
"type": "WEB",
"url": "https://github.com/PrivateBin/PrivateBin/commit/4434dbf73ac53217fda0f90d8cf9b6110f8acc4f"
},
{
"type": "PACKAGE",
"url": "https://github.com/PrivateBin/PrivateBin"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "PrivateBin\u0027s template-switching feature allows arbitrary local file inclusion through path traversal"
}
GHSA-G3PM-PXCJ-98PH
Vulnerability from github – Published: 2023-03-01 12:30 – Updated: 2023-03-09 15:30A vulnerability was found in Drag and Drop Multiple File Upload Contact Form 7 5.0.6.1. It has been classified as critical. Affected is an unknown function of the file admin-ajax.php. The manipulation of the argument upload_name leads to relative path traversal. It is possible to launch the attack remotely. The exploit has been disclosed to the public and may be used. The identifier of this vulnerability is VDB-222072.
{
"affected": [],
"aliases": [
"CVE-2023-1112"
],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-23"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-03-01T10:15:00Z",
"severity": "CRITICAL"
},
"details": "A vulnerability was found in Drag and Drop Multiple File Upload Contact Form 7 5.0.6.1. It has been classified as critical. Affected is an unknown function of the file admin-ajax.php. The manipulation of the argument upload_name leads to relative path traversal. It is possible to launch the attack remotely. The exploit has been disclosed to the public and may be used. The identifier of this vulnerability is VDB-222072.",
"id": "GHSA-g3pm-pxcj-98ph",
"modified": "2023-03-09T15:30:50Z",
"published": "2023-03-01T12:30:15Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-1112"
},
{
"type": "WEB",
"url": "https://github.com/Nickguitar/Drag-and-Drop-Multiple-File-Uploader-PRO-Path-Traversal"
},
{
"type": "WEB",
"url": "https://vuldb.com/?ctiid.222072"
},
{
"type": "WEB",
"url": "https://vuldb.com/?id.222072"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
Mitigation MIT-5.1
Strategy: Input Validation
- Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
- When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."
- Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
- When validating filenames, use stringent allowlists that limit the character set to be used. If feasible, only allow a single "." character in the filename to avoid weaknesses such as CWE-23, and exclude directory separators such as "/" to avoid CWE-36. Use a list of allowable file extensions, which will help to avoid CWE-434.
- Do not rely exclusively on a filtering mechanism that removes potentially dangerous characters. This is equivalent to a denylist, which may be incomplete (CWE-184). For example, filtering "/" is insufficient protection if the filesystem also supports the use of "\" as a directory separator. Another possible error could occur when the filtering is applied in a way that still produces dangerous data (CWE-182). For example, if "../" sequences are removed from the ".../...//" string in a sequential fashion, two instances of "../" would be removed from the original string, but the remaining characters would still form the "../" string.
Mitigation MIT-20.1
Strategy: Input Validation
- Inputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked.
- Use a built-in path canonicalization function (such as realpath() in C) that produces the canonical version of the pathname, which effectively removes ".." sequences and symbolic links (CWE-23, CWE-59). This includes:
- realpath() in C
- getCanonicalPath() in Java
- GetFullPath() in ASP.NET
- realpath() or abs_path() in Perl
- realpath() in PHP
Mitigation MIT-29
Strategy: Firewall
Use an application firewall that can detect attacks against this weakness. It can be beneficial in cases in which the code cannot be fixed (because it is controlled by a third party), as an emergency prevention measure while more comprehensive software assurance measures are applied, or to provide defense in depth [REF-1481].
CAPEC-139: Relative Path Traversal
An attacker exploits a weakness in input validation on the target by supplying a specially constructed path utilizing dot and slash characters for the purpose of obtaining access to arbitrary files or resources. An attacker modifies a known path on the target in order to reach material that is not available through intended channels. These attacks normally involve adding additional path separators (/ or \) and/or dots (.), or encodings thereof, in various combinations in order to reach parent directories or entirely separate trees of the target's directory structure.
CAPEC-76: Manipulating Web Input to File System Calls
An attacker manipulates inputs to the target software which the target software passes to file system calls in the OS. The goal is to gain access to, and perhaps modify, areas of the file system that the target software did not intend to be accessible.