# CVE-2020-5223: Persistent XSS vulnerability in filename of attached file in PrivateBin

> Persistent XSS in PrivateBin allows attackers to inject HTML via attachment filenames, potentially executing scripts in victim browsers.

- **Severity:** Medium 6.1 (`CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:H/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 23 Jan 2020
- **Updated:** 4 Aug 2024
- **Also known as:** GHSA-8j72-p2wm-6738

## What is CVE-2020-5223?

CVE-2020-5223 is a medium-severity cross-site scripting vulnerability in PrivateBin, published on 23 Jan 2020. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

In PrivateBin versions 1.2.0 before 1.2.2, and 1.3.0 before 1.3.2, a persistent XSS attack is possible. Under certain conditions, a user provided attachment file name can inject HTML leading to a persistent Cross-site scripting (XSS) vulnerability. The vulnerability has been fixed in PrivateBin v1.3.2 & v1.2.2. Admins are urged to upgrade to these versions to protect the affected users.

Weakness: CWE-79 (Improper Neutralization of Input During Web Page Generation)

## Which versions are affected by CVE-2020-5223?

4 open source packages ship an affected version, including privatebin/privatebin. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `privatebin/privatebin` | Packagist | All versions | 1.2.2 |
| `privatebin/privatebin` | Packagist | All versions | 1.2.2 |
| `privatebin/privatebin` | Packagist | From 1.3.0 | 1.3.2 |
| `privatebin/privatebin` | Packagist | From 1.3.0 | 1.3.2 |

Products: Privatebin Privatebin.

## How do I fix CVE-2020-5223?

Upgrade privatebin/privatebin to a fixed version for your release line: 1.2.2 or 1.3.2.

## Is CVE-2020-5223 being exploited?

There is no known exploitation of CVE-2020-5223 in the wild and no public exploit code.

## Other vulnerabilities in PrivateBin

- [CVE-2022-24833](https://insights.sbomify.com/CVE-2022-24833/): Persistent Cross-site Scripting (XSS) vulnerability in PrivateBin (high 8.2)
- [CVE-2025-64711](https://insights.sbomify.com/CVE-2025-64711/): PrivateBin vulnerable to malicious filename use for self-XSS / HTML injection locally for users (low 3.9)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2020-5223 and fix it if it is affected.

What it is: CVE-2020-5223 is a medium-severity cross-site scripting vulnerability in PrivateBin, published on 23 Jan 2020. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2020-5223 in the wild and no public exploit code.

Affected packages and fixed versions:
- privatebin/privatebin (Packagist): affected all versions; fixed in 1.2.2
- privatebin/privatebin (Packagist): affected all versions; fixed in 1.2.2
- privatebin/privatebin (Packagist): affected from 1.3.0; fixed in 1.3.2
- privatebin/privatebin (Packagist): affected from 1.3.0; fixed in 1.3.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2020-5223/ (Markdown: https://insights.sbomify.com/CVE-2020-5223/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2020-5223
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2020-5223
- OSV: https://osv.dev/vulnerability/CVE-2020-5223

---
From sbomify Insights: https://insights.sbomify.com/CVE-2020-5223/
Summaries are generated and may contain mistakes; the official description above is the record.
