# CVE-2026-55891: PrivateBin: Reflected JSON injection in backend responses via unescaped REQUEST_URI

> Attackers can inject arbitrary JSON data into PrivateBin responses via unescaped REQUEST_URI, affecting structured-data consumers and bypassing security headers.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 28 Aug 2026
- **Updated:** 31 Aug 2026
- **Also known as:** GHSA-xrjc-c68j-hp7w

## What is CVE-2026-55891?

CVE-2026-55891 is a code injection vulnerability in PrivateBin, published on 28 Aug 2026. 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. Prior to 2.0.5, Request::getRequestUri() in lib/Request.php passes $_SERVER['REQUEST_URI'] through FILTER_SANITIZE_URL, which does not remove quotation marks, angle brackets, or apostrophes, and Controller::_init() stores the attacker-controlled value in Controller::$_urlBase. Controller::_jsonld() in lib/Controller.php then uses str_replace() to insert that value without JSON escaping into js/types.jsonld, js/paste.jsonld, and the other JSON-LD templates used by /?jsonld= and /?pasteid. A raw quotation mark delivered by an HTTP client, proxy, or structured-data crawler that does not normalize the request target can break out of the JSON string and inject arbitrary key-value data into a CORS-open application/ld+json response. The jsonld branch in Controller::__construct() returns before _setCacheHeaders(), so the response also lacks X-Content-Type-Options: nosniff, Content Security Policy, X-Frame-Options, and Referrer-Policy. Direct script execution was not demonstrated, but manipulated responses can affect structured-data consumers or combine with less strict clients. This issue is fixed in version 2.0.5.

Weakness: CWE-116 (Improper Encoding or Escaping of Output)

## Which versions are affected by CVE-2026-55891?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `privatebin/privatebin` | Packagist | All versions | 2.0.5 |
| `privatebin/privatebin` | Packagist | All versions | 2.0.5 |

## How do I fix CVE-2026-55891?

Upgrade privatebin/privatebin to 2.0.5 or later.

## Is CVE-2026-55891 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-55891 and fix it if it is affected.

What it is: CVE-2026-55891 is a code injection vulnerability in PrivateBin, published on 28 Aug 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-55891 exists.

Affected packages and fixed versions:
- privatebin/privatebin (Packagist): affected all versions; fixed in 2.0.5
- privatebin/privatebin (Packagist): affected all versions; fixed in 2.0.5

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

## Sources

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

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