CVE-2025-64711: PrivateBin vulnerable to malicious filename use for self-XSS / HTML injection locally for users

Published Nov 13, 2025
·
Updated

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 (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 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. 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, 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 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

Other sources

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.

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 (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 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. 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, 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 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

— GitHub

PrivateBin is an online pastebin where the server has zero knowledge of pasted data. Starting in version 1.7.7 and prior to version 2.0.3, 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. Certain conditions must exist for the vulnerability to be exploitable. Only macOS 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. 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, HTML injection attacks may be possible - like redirecting to a foreign website, phishing etc. 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. Version 2.0.3 patches the issue.

— MITRE

PrivateBin vulnerable to malicious filename use for self-XSS / HTML injection locally for users

— Packagist

Affected Software

4 affected componentsFixes available
PrivateBin PrivateBin>=1.7.7<2.0.3
composer/privatebin/privatebin>=1.7.7<2.0.3
2.0.3
PrivateBin PrivateBin>=1.7.7<2.0.3
composer/privatebin/privatebin>=1.7.7, <2.0.3
2.0.3

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade composer/privatebin/privatebin to a version that resolves this vulnerability.

    Fixed in 2.0.3
  2. Upgrade

    Upgrade PrivateBin to a version that resolves this vulnerability.

    Fixed in 2.0.3
  3. Configuration

    Disable attachments/file upload to prevent exploitation.

    PrivateBin file upload = disabled
  4. Compensating control

    Deploy PrivateBin on a separate domain to limit the vulnerability's scope to PrivateBin itself.

Event History

Nov 13, 2025
CVE Published
via MITRE·01:50 AM
Data Sourced
via MITRE·01:50 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·03:16 AM
RemedyDescriptionSeverityWeaknessAffected Software
Nov 14, 2025
Advisory Published
via GitHub·08:33 PM
Data Sourced
via GitHub·08:33 PM
DescriptionSeverityWeaknessAffected Software
Data Sourced
via Packagist·08:33 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2025-64711?

CVE-2025-64711 has been identified as a vulnerability that may allow for cross-site scripting through crafted file names.

2

How do I fix CVE-2025-64711?

To mitigate CVE-2025-64711, upgrade to PrivateBin version 2.0.3 or later.

3

What versions of PrivateBin are affected by CVE-2025-64711?

CVE-2025-64711 affects PrivateBin versions starting from 1.7.7 up to, but not including, 2.0.3.

4

Can CVE-2025-64711 be exploited remotely?

Yes, CVE-2025-64711 can be exploited remotely by users dropping crafted files containing HTML.

5

What type of data can be targeted in CVE-2025-64711?

CVE-2025-64711 targets data in the form of filenames that are reflected into the web page through the drag-and-drop functionality.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203