# CVE-2024-39899: PrivateBin allows shortening of URLs for other domains

> Attackers can bypass URL shortening restrictions to shorten arbitrary external URLs, potentially facilitating phishing or spam campaigns.

- **Severity:** Medium 5.3 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 9 Jul 2024
- **Updated:** 2 Aug 2024
- **Also known as:** GHSA-mqqj-fx8h-437j

## What is CVE-2024-39899?

CVE-2024-39899 is a medium-severity vulnerability in PrivateBin, published on 9 Jul 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

PrivateBin is an online pastebin where the server has zero knowledge of pasted data. In v1.5, PrivateBin introduced the YOURLS server-side proxy. The idea was to allow using the YOURLs URL shortener without running the YOURLs instance without authentication and/or exposing the authentication token to the public, allowing anyone to shorten any URL. With the proxy mechanism, anyone can shorten any URL pointing to the configured PrivateBin instance. The vulnerability allowed other URLs to be shortened, as long as they contain the PrivateBin instance, defeating the limit imposed by the proxy. This vulnerability is fixed in 1.7.4.

Weakness: CWE-791 (Incomplete Filtering of Special Elements), CWE-305 (Authentication Bypass by Primary Weakness)

## Which versions are affected by CVE-2024-39899?

2 open source packages ship an affected version, including privatebin/privatebin.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `privatebin/privatebin` | Packagist | From 1.5.0 | 1.7.4 |
| `privatebin/privatebin` | Packagist | From 1.5.0 | 1.7.4 |

## How do I fix CVE-2024-39899?

Upgrade privatebin/privatebin to 1.7.4 or later.

## Is CVE-2024-39899 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-39899 and fix it if it is affected.

What it is: CVE-2024-39899 is a medium-severity vulnerability in PrivateBin, published on 9 Jul 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-39899 in the wild and no public exploit code.

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

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

## Sources

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

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