privatebin/privatebin
Affected
- introduced
1.7.7, fixed2.0.3(ecosystem)
Fixed versions
2.0.3
Fix
The export has no generic command for this ecosystem.
Advisory
Also known as: CVE-2025-64711
PrivateBin vulnerable to malicious filename use for self-XSS / HTML injection locally for users
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
> character is treated in a file name on Windows.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:
const fileNames = loadedFiles.map((loadedFile => loadedFile.name));
printDragAndDropFileNames(fileNames);
printDragAndDropFileNames then renders those names:
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():
$dragAndDropFileName.text(loadedFile.name);
Reproduction Steps
touch '"><img src=x onerror=alert(document.domain)>.txt'.#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:
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
Low Basis: The source's own band: LOW
1.7.7, fixed 2.0.3 (ecosystem)2.0.3
The export has no generic command for this ecosystem.
Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0