{"id":"CVE-2025-64711","aliases":["CVE-2025-64711","GHSA-r9x7-7ggj-fx9f"],"related":[],"kind":"vulnerability","state":"published","title":"PrivateBin vulnerable to malicious filename use for self-XSS / HTML injection locally for users","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"## 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","format":"markdown","source":"ghsa"},{"lang":"es","text":"PrivateBin es un pastebin en línea donde el servidor tiene conocimiento cero de los datos pegados. A partir de la versión 1.7.7 y antes de la versión 2.0.3, arrastrar un archivo cuyo nombre de archivo contiene HTML se refleja textualmente en la página a través del asistente de arrastrar y soltar, por lo que cualquier usuario que suelte un archivo manipulado en PrivateBin ejecutará JavaScript arbitrario dentro de su propia sesión (self-XSS). Esto permite a un atacante que puede atraer a una víctima para que arrastre o adjunte de otra manera dicho archivo exfiltrar texto plano, claves de cifrado o pegados almacenados antes de que sean cifrados o enviados. Deben existir ciertas condiciones para que la vulnerabilidad sea explotable. Solo los usuarios de macOS o Linux se ven afectados, debido a la forma en que se trata el carácter '>' en un nombre de archivo en Windows. La instancia de PrivateBin necesita tener la carga de archivos habilitada. Un atacante necesita tener acceso al sistema de archivos local o de alguna manera convencer al usuario de crear (o descargar) un archivo (nombre) malicioso. Un atacante necesita convencer al usuario de adjuntar ese archivo malicioso a PrivateBin. Cualquier usuario de Mac / Linux que pueda ser engañado para arrastrar un archivo con nombre malicioso al editor es impactado; el código se ejecuta en el origen de la instancia de PrivateBin que están utilizando. Los atacantes pueden robar texto plano, frases de contraseña o manipular la interfaz de usuario antes de que los datos sean cifrados, anulando las garantías de conocimiento cero para esa sesión de víctima, asumiendo que las contramedidas como Content-Security-Policy (CSP) han sido deshabilitadas. Si CSP no está deshabilitado, los ataques de inyección HTML pueden ser posibles, como redirigir a un sitio web externo, phishing, etc. Dado que todo el exploit debe incluirse en el nombre de archivo del archivo adjunto y solo afecta la sesión local del usuario (es decir, no es persistente ni ejecutable remotamente) y ese usuario necesita interactuar y adjuntar activamente ese archivo al pegado, el impacto se considera prácticamente bajo. La versión 2.0.3 corrige el problema.","source":"nvd"}],"published":"2025-11-13T01:50:31.780Z","modified":"2026-10-19T13:10:00.110Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N","score":3.9,"rating":"LOW"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N","score":3.9,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N","score":3.9,"rating":"LOW"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":">= 1.7.7, < 2.0.3","status":"affected"}],"vendor":"PrivateBin","product":"PrivateBin","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"1.7.7","status":"affected","fixed":"2.0.3"}],"ecosystem":"Packagist","package":"privatebin/privatebin","purl":"pkg:composer/privatebin/privatebin","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"1.7.7","fixed":"2.0.3"}],"vendor":"privatebin","product":"privatebin","cpe":"cpe:2.3:a:privatebin:privatebin:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/PrivateBin/PrivateBin/security/advisories/GHSA-r9x7-7ggj-fx9f","tags":["exploit","mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/PrivateBin/PrivateBin/commit/f9550e513381208b36595ee2404e968144bba78b","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-64711","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/PrivateBin/PrivateBin","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2025-11-13T14:28:32.150Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-64711","url":"https://www.cve.org/CVERecord?id=CVE-2025-64711","licence":"CVE Terms of Use","modified":"2025-11-13T14:34:51.745Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-r9x7-7ggj-fx9f","url":"https://github.com/advisories/GHSA-r9x7-7ggj-fx9f","licence":"CC-BY-4.0","modified":"2025-11-27T09:11:04.378Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-64711","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-64711","licence":"Public domain","modified":"2026-10-19T13:10:00.110Z"}],"updatedAt":"2026-11-25T22:59:07.610Z","epss":{"score":0.00129,"percentile":0.02786,"date":"2026-12-01T12:00:22.000Z"}}