# CVE-2026-40487: Postiz Has Unrestricted File Upload via MIME Type Spoofing that Leads to Stored XSS

> Authenticated users can upload malicious files via MIME spoofing, leading to stored XSS and potential account takeover in Postiz.

- **Severity:** High 8.9 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** No
- **Published:** 18 Apr 2026
- **Updated:** 20 Apr 2026
- **Also known as:** GHSA-44wg-r34q-hvfx

## What is CVE-2026-40487?

CVE-2026-40487 is a high-severity vulnerability in gitroomhq postiz-app, published on 18 Apr 2026. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

### Official description

Postiz is an AI social media scheduling tool. Prior to version 2.21.6, a file upload validation bypass allows any authenticated user to upload arbitrary HTML, SVG, or other executable file types to the server by spoofing the `Content-Type` header. The uploaded files are then served by nginx with a Content-Type derived from their original extension (`text/html`, `image/svg+xml`), enabling Stored Cross-Site Scripting (XSS) in the context of the application's origin. This can lead to session riding, account takeover, and full compromise of other users' accounts. Version 2.21.6 contains a fix.

Weakness: CWE-79 (Improper Neutralization of Input During Web Page Generation), CWE-434 (Unrestricted Upload of File with Dangerous Type), CWE-345 (Insufficient Verification of Data Authenticity)

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

It affects 1 product.


Products: Gitroom Postiz.

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

No fix has been published for CVE-2026-40487 yet. Limit exposure of the affected software until one is available.

## Is CVE-2026-40487 being exploited?

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

Public exploit code:

- CVE-2026-40487 - Postiz <= 2.21.5 - Arbitrary File Upload via MIME-Type Spoofing → Stored XSS → Account Takeover (github_poc): https://github.com/Astaruf/CVE-2026-40487

## Other vulnerabilities in gitroomhq postiz-app

- [CVE-2026-42298](https://insights.sbomify.com/CVE-2026-42298/): Postiz: Arbitrary Code Execution and Token Exfiltration in pr-docker-build.yml via untrusted Dockerfile.dev (critical 10.0)
- [CVE-2026-42556](https://insights.sbomify.com/CVE-2026-42556/): Postiz stored XSS in public preview page (high 8.9)
- [CVE-2026-34577](https://insights.sbomify.com/CVE-2026-34577/): Postiz: Unauthenticated Full-Read SSRF via /public/stream Endpoint with Trivially Bypassable Extension Check (high 8.6)
- [CVE-2026-34576](https://insights.sbomify.com/CVE-2026-34576/): Postiz: SSRF in upload-from-url endpoint allows fetching internal resources and cloud metadata (high 8.3)
- [CVE-2026-40168](https://insights.sbomify.com/CVE-2026-40168/): Postiz has Server-Side Request Forgery via Redirect Bypass in /api/public/stream (high 8.2)

## Fix prompt for AI coding agents

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

What it is: CVE-2026-40487 is a high-severity vulnerability in gitroomhq postiz-app, published on 18 Apr 2026. Any signed-in user can exploit it over the network, 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-2026-40487 exists.

Affected product: gitroomhq postiz-app. No package-level version data is available, so check the vendor advisory linked from the reference page.

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

## Sources

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

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