🛡️ CVE-2025-64714 — privatebin

🟡 CVSS 5.8 — Medium ✅ No Known Exploit CWE-23 NVD
5.8
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

PrivateBin's template-switching feature allows arbitrary local file inclusion through path traversal

Summary

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

  • templateselection got enabled in cfg/conf.php
  • Visitor sets a cookie template pointing to an existing PHP file without it's suffix, using a path relative to the tpl folder. 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](https://github.com/PrivateBin/PrivateBin/blob/591d2d40e16a196aa628e3962a1c21bdf9793db2/cfg/conf.sample.php#L1) 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](https://github.com/PrivateBin/PrivateBin/blob/591d2d40e16a196aa628e3962a1c21bdf9793db2/lib/Data/Filesystem.php#L46) PHP execution/inclusion.
  • 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.
  • 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']](https://github.com/PrivateBin/PrivateBin/blob/d32ac29925066c668241a165264c76de051398e3/bin/administration#L357C37-L357C54).

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](https://privatebin.info/directory/) and did find 11 instances that had the template switcher enabled. The following script was used to detect this:

```shell

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:

```shell

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:

```php

private static function getSelectedByUserTemplate(): ?string

{

$selectedTemplate = null;

$templateCookieValue = $_COOKIE['template'] ?? '';

if (self::isTemplateAvailable($templateCookieValue)) {

$selectedTemplate = $templateCookieValue;

}

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is changed, meaning a successful attack can affect components beyond the vulnerable one. Rated impact: confidentiality low, integrity none, availability none.

Weakness class

CVE-2025-64714 is classified as CWE-23: Relative Path Traversal. Relative path sequences in user input are not neutralised, so requests can climb out of the intended directory.

Affected software

CVE-2025-64714 is recorded against 2 packages.

  • privatebin/privatebin (from 1.7.7 up to 2.0.3)
  • unknown

Timeline and source

Published on 14 November 2025. No public exploit is currently recorded for this entry. Record sourced from NVD.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Web)
github.com (Package)

Details

Severity Medium
CVSS Score 5.8
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N
CWE CWE-23
Public Exploit ✅ No
Source NVD
Published 2025-11-14
Updated 2026-08-12
Modified 2025-11-14
Fix URL N/A

Affected Packages

Software From version Fixed in
privatebin/privatebin 1.7.7 2.0.3
unknown

Similar Threats

Vulnerability Monitoring

Track new vulnerabilities in privatebin

CVE-2025-64714 is rated CVSS 5.8 Medium. BotEraser monitors your WordPress installation and notifies you when software you use appears in our vulnerability database.

Set Up Free Alerts →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2025