CVE-2025-64711: Privatebin/privatebin Cross-Site Scripting Vulnerability

LOW
Advisory Identifier: GHSA-r9x7-7ggj-fx9f
CVSS 3.9
CWE-79
Published
Advisory Summary

CVE-2025-64711 is a LOW (CVSS 3.9) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Privatebin/privatebin libraries in the Packagist ecosystem. The issue involves privatebin vulnerable to malicious filename use for self-xss / html injection locally for users. Remediation is available by upgrading affected packages to version 2.0.3.

CVE-2025-64711 at a Glance

CVE Identifier CVE-2025-64711
GHSA Identifier GHSA-r9x7-7ggj-fx9f
Severity LOW
CVSS v3.1 Base Score 3.9
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Privatebin/privatebin
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 3.9

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2025-64711

To remediate this vulnerability, upgrade all affected Privatebin/privatebin dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

privatebin/privatebin fixed: 2.0.3
Upgrade privatebin/privatebin to 2.0.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for privatebin/privatebin

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-64711, inspect your project dependencies for Privatebin/privatebin:

inspect dependencies for privatebin/privatebin

Analyze the terminal output to locate any version of Privatebin/privatebin in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.3), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Privatebin/privatebin, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary Dragging a file whose filename contains HTML is reflected verbatim into the page via the drag-and-drop helper, so any user who drops a crafted file on PrivateBin will execute arbitrary JavaScript within their own session (self-XSS). This allows an attacker who can entice a victim to drag or otherwise attach such a file to exfiltrate plaintext, encryption keys, or stored pastes before they are encrypted or sent. **Note 1:** as the malicious filename must contain the `>` character, the victim must not be using Windows for this to work, since this OS simply forbids this character in filenames. **Note 2:** most PrivateBin instances use the Content-Security-Policy header to prevent most use-cases of this vulnerability. This report will describe the impact as if this header had been disabled by the PrivateBin instance owner. ## Affected versions PrivateBin versions since 1.7.7 and before 2.0.3. ## Conditions * Only macIOS or Linux users are affected, due to the way the `>` character is treated in a file name on Windows. * The PrivateBIn instance needs to have file upload enabled. * An attacker needs to have access to the local file system or somehow convince the user to create (or download) a malicious file (name). * An attacker needs to convince the user to attach that malicious file to PrivateBin. ## Impact Any Mac / Linux user who can be tricked into dragging a maliciously named file into the editor is impacted; code runs in the origin of the PrivateBin instance they are using. Attackers can steal plaintext, passphrases, or manipulate the UI before data is encrypted, defeating the zero-knowledge guarantees for that victim session, assuming counter-measures like Content-Security-Policy (CSP) have been disabled. If CSP is not disabled, similar HTML injection attacks as described in CVE-2025-62796 may be possible - like redirecting to a foreign website, phishing etc. ### Real-life impact As the whole exploit needs to be included in the file name of the attached file and only affects the local session of the user (aka it is neither persistent nor remotely executable) _and_ that user needs to interact and actively attach that file to the paste, the impact is considered to be practically low. ## Technical Description When a file is dropped, `readFileData` collects all filenames and calls `printDragAndDropFileNames`: ```js const fileNames = loadedFiles.map((loadedFile => loadedFile.name)); printDragAndDropFileNames(fileNames); ``` `printDragAndDropFileNames` then renders those names: ```js function printDragAndDropFileNames(fileNames) { $dragAndDropFileNames.html(fileNames.join('<br>')); } ``` This will insecurely render the user-submitted filenames as HTML. This vulnerability has been introduced in [this commit](https://github.com/PrivateBin/PrivateBin/commit/095a5be0b6390a6e47b97d3668a23f6edec95c15) (introduced in 1.7.7). The previous render method was using `.text()`: ```js $dragAndDropFileName.text(loadedFile.name); ``` ## Reproduction Steps 1. On a Unix-like system, create a file with an HTML/JS payload in its name, e.g. by running `touch '"><img src=x onerror=alert(document.domain)>.txt'`. 2. Deploy or use any PrivateBin instance with attachments enabled (including https://privatebin.net/). 3. Open the UI in a browser and start a new paste. 4. Drag the crafted file anywhere on the page 5. As soon as it is dropped, the filename is inserted into `#dragAndDropFileName` as HTML and the onerror handler fires (assuming CSP is disabled), showing the alert. ## Mitigation PrivateBin strongly recommends users to **upgrade to the latest release**. However, here are some workarounds that may help users to mitigate this vulnerability without upgrade: * Update the [CSP in your configuration file](https://github.com/PrivateBin/PrivateBin/wiki/Configuration#cspheader) to the latest recommended settings and check that it isn't getting reverted or overwritten by the web server, reverse proxy or CDN, i.e. using [PrivateBin's offered check service](https://privatebin.info/directory/check). **Note:** Users should check the CSP independently, even if they've upgrade to a fixed version. * Deploying PrivateBin on a separate domain may limit the scope of the vulnerability to PrivateBin itself and thus, as described in the “Impact” section, effectively prevent any damage by the vulnerability to other resources users are hosting. * As explained in the impact assessment, disabling attachments also prevents this issue. ### Patches The issue has been patched in version 2.0.3. ## Credits PrivateBin would like to thank [Benoit Esnard](https://github.com/esnard), who reported this vulnerability. In general, PrivateBin would like to thank everyone reporting issues and potential vulnerabilities. If a user thinks they have found a vulnerability or potential security risk, [PrivateBin would kindly ask you to follow our security policy](https://github.com/PrivateBin/PrivateBin/blob/master/SECURITY.md) and report it. PrivateBin will then assess the report and will take the necessary actions to address it. ## Timeline - 2025-11-09 Received report via GitHub Security Advisory - 2025-11-10 Discussed and reproduced issue, created a patch - 2025-11-11 Further work on patch - 2025-11-12 Released patch with PrivateBin 2.0.3

CVE-2025-64711 Affected Privatebin/privatebin Versions

1 component(s)
Fixed Versions:
2.0.3
Product / Package Ecosystem Affected Versions Fixed Version
privatebin/privatebin
Packagist
≥ 1.7.7
< 2.0.3
2.0.3

References

Frequently Asked Questions

What is CVE-2025-64711?
CVE-2025-64711 is a security vulnerability in Privatebin/privatebin involving PrivateBin vulnerable to malicious filename use for self-XSS / HTML injection locally for users under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Privatebin/privatebin versions are affected?
Affected versions include releases prior to 2.0.3 across affected packages: privatebin/privatebin.
What version fixes CVE-2025-64711?
Upgrading to 2.0.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is privatebin/privatebin affected?
Yes, privatebin/privatebin is affected in releases prior to 2.0.3. Upgrade your dependency to 2.0.3 or later.
What is the CVSS score of CVE-2025-64711?
CVE-2025-64711 has a CVSS v3.1 base score of 3.9 (LOW) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2025-64711?
CVE-2025-64711 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check Packagist dependencies for CVE-2025-64711?
Run the dependency tree command: 'inspect dependencies for privatebin/privatebin'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-r9x7-7ggj-fx9f",
  "modified" : "2025-11-27T08:46:22Z",
  "published" : "2025-11-14T20:33:52Z",
  "aliases" : [ "CVE-2025-64711" ],
  "summary" : "PrivateBin vulnerable to malicious filename use for self-XSS / HTML injection locally for users",
  "details" : "## Summary\n\nDragging a file whose filename contains HTML is reflected verbatim into the page via the drag-and-drop helper, so any user who drops a crafted file on PrivateBin will execute arbitrary JavaScript within their own session (self-XSS). This allows an attacker who can entice a victim to drag or otherwise attach such a file to exfiltrate plaintext, encryption keys, or stored pastes before they are encrypted or sent.\n\n**Note 1:** as the malicious filename must contain the `>` character, the victim must not be using Windows for this to work, since this OS simply forbids this character in filenames.\n\n**Note 2:** most PrivateBin instances use the Content-Security-Policy header to prevent most use-cases of this vulnerability. This report will describe the impact as if this header had been disabled by the PrivateBin instance owner.\n\n## Affected versions\n\nPrivateBin versions since 1.7.7 and before 2.0.3.\n\n## Conditions\n\n* Only macIOS or Linux users are affected, due to the way the `>` character is treated in a file name on Windows.\n* The PrivateBIn instance needs to have file upload enabled.\n* An attacker needs to have access to the local file system or somehow convince the user to create (or download) a malicious file (name).\n* An attacker needs to convince the user to attach that malicious file to PrivateBin.\n\n## Impact\n\nAny Mac / Linux user who can be tricked into dragging a maliciously named file into the editor is impacted; code runs in the origin of the PrivateBin instance they are using. Attackers can steal plaintext, passphrases, or manipulate the UI before data is encrypted, defeating the zero-knowledge guarantees for that victim session, assuming counter-measures like Content-Security-Policy (CSP) have been disabled.\n\nIf CSP is not disabled, similar HTML injection attacks as described in CVE-2025-62796 may be possible - like redirecting to a foreign website, phishing etc.\n\n### Real-life impact\n\nAs the whole exploit needs to be included in the file name of the attached file and only affects the local session of the user (aka it is neither persistent nor remotely executable) _and_ that user needs to interact and actively attach that file to the paste, the impact is considered to be practically low.\n\n## Technical Description\n\nWhen a file is dropped, `readFileData` collects all filenames and calls `printDragAndDropFileNames`:\n\n```js\nconst fileNames = loadedFiles.map((loadedFile => loadedFile.name));\nprintDragAndDropFileNames(fileNames);\n```\n\n`printDragAndDropFileNames` then renders those names:\n\n```js\n        function printDragAndDropFileNames(fileNames) {\n            $dragAndDropFileNames.html(fileNames.join('<br>'));\n        }\n```\n\nThis will insecurely render the user-submitted filenames as HTML.\n\nThis vulnerability has been introduced in [this commit](https://github.com/PrivateBin/PrivateBin/commit/095a5be0b6390a6e47b97d3668a23f6edec95c15) (introduced in 1.7.7).\n\nThe previous render method was using `.text()`:\n\n```js\n$dragAndDropFileName.text(loadedFile.name);\n```\n\n## Reproduction Steps\n\n1. On a Unix-like system, create a file with an HTML/JS payload in its name, e.g. by running `touch '\"><img src=x onerror=alert(document.domain)>.txt'`.\n2. Deploy or use any PrivateBin instance with attachments enabled (including https://privatebin.net/).\n3. Open the UI in a browser and start a new paste.\n4. Drag the crafted file anywhere on the page\n5. As soon as it is dropped, the filename is inserted into `#dragAndDropFileName` as HTML and the onerror handler fires (assuming CSP is disabled), showing the alert.\n\n## Mitigation\n\nPrivateBin strongly recommends users to **upgrade to the latest release**. However, here are some workarounds that may help users to mitigate this vulnerability without upgrade:\n\n* Update the [CSP in your configuration file](https://github.com/PrivateBin/PrivateBin/wiki/Configuration#cspheader) to the latest recommended settings and check that it isn't getting reverted or overwritten by the web server, reverse proxy or CDN, i.e. using [PrivateBin's offered check service](https://privatebin.info/directory/check).\n   **Note:** Users should check the CSP independently, even if they've upgrade to a fixed version.\n* Deploying PrivateBin on a separate domain may limit the scope of the vulnerability to PrivateBin itself and thus, as described in the “Impact” section, effectively prevent any damage by the vulnerability to other resources users are hosting.\n* As explained in the impact assessment, disabling attachments also prevents this issue.\n\n### Patches\n\nThe issue has been patched in version 2.0.3.\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.\n\nIf a user thinks they have found a vulnerability or potential security risk, [PrivateBin would kindly ask you to follow our security policy](https://github.com/PrivateBin/PrivateBin/blob/master/SECURITY.md) and report it. PrivateBin will then assess the report and will take the necessary actions 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, created a patch\n- 2025-11-11 Further work on patch\n- 2025-11-12 Released patch with PrivateBin 2.0.3",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "privatebin/privatebin"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.7.7"
      }, {
        "fixed" : "2.0.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/PrivateBin/PrivateBin/security/advisories/GHSA-r9x7-7ggj-fx9f"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-64711"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/PrivateBin/PrivateBin/commit/f9550e513381208b36595ee2404e968144bba78b"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/PrivateBin/PrivateBin"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-11-14T20:33:52Z",
    "nvd_published_at" : "2025-11-13T03:16:29Z"
  }
}