# CVE-2022-24833: Persistent Cross-site Scripting (XSS) vulnerability in PrivateBin

> Attackers can execute arbitrary JavaScript via crafted SVG attachments in PrivateBin pastes if the instance lacks a proper Content Security Policy.

- **Severity:** High 8.2 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 11 Apr 2022
- **Updated:** 22 Apr 2025
- **Also known as:** GHSA-cqcc-mm6x-vmvw

## What is CVE-2022-24833?

CVE-2022-24833 is a high-severity cross-site scripting vulnerability in PrivateBin, published on 11 Apr 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

PrivateBin is minimalist, open source online pastebin clone where the server has zero knowledge of pasted data. In PrivateBin < v1.4.0 a cross-site scripting (XSS) vulnerability was found. The vulnerability is present in all versions from v0.21 of the project, which was at the time still called ZeroBin. The issue is caused by the fact that SVGs can contain JavaScript. This can allow an attacker to execute code, if the user opens a paste with a specifically crafted SVG attachment, and interacts with the preview image and the instance isn't protected by an appropriate content security policy. Users are advised to either upgrade to version 1.4.0 or to ensure the content security policy of their instance is set correctly.

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

## Which versions are affected by CVE-2022-24833?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `privatebin/privatebin` | Packagist | From 0.21 | 1.4.0 |
| `privatebin/privatebin` | Packagist | From 0.21 | 1.4.0 |

Products: Privatebin Privatebin.

## How do I fix CVE-2022-24833?

Upgrade privatebin/privatebin to 1.4.0 or later.

## Is CVE-2022-24833 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-24833 exists.

## Other vulnerabilities in PrivateBin

- [CVE-2020-5223](https://insights.sbomify.com/CVE-2020-5223/): Persistent XSS vulnerability in filename of attached file in PrivateBin (medium 6.1)
- [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-2022-24833 and fix it if it is affected.

What it is: CVE-2022-24833 is a high-severity cross-site scripting vulnerability in PrivateBin, published on 11 Apr 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-24833 exists.

Affected packages and fixed versions:
- privatebin/privatebin (Packagist): affected from 0.21; fixed in 1.4.0
- privatebin/privatebin (Packagist): affected from 0.21; fixed in 1.4.0

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-2022-24833/ (Markdown: https://insights.sbomify.com/CVE-2022-24833/index.md)
```

## Sources

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

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