Safeguard
Vulnerability Analysis•

CVE-2026-40487: Stored XSS via File Upload in Postiz

CVE-2026-40487 lets authenticated Postiz users upload HTML or SVG files that run as stored XSS. Upgrade to 2.21.6 and harden how uploads are served.

Safeguard Security Team
2 min read

CVE-2026-40487 is a file upload validation bypass in Postiz, the social media scheduling tool, scored CVSS 8.9. A logged in user can upload HTML or SVG by spoofing the Content-Type header, producing stored cross site scripting. Postiz 2.21.6 fixes it.

What's affected

  • Affected: Postiz before 2.21.6
  • Fixed: 2.21.6

The advisory says nginx serves the uploaded files with a type taken from the file extension, such as text/html or image/svg+xml, so the browser runs them in the application's own origin. It lists the weaknesses as CWE-345, CWE-434 and CWE-79.

How to check if you're exposed

Find your Postiz version in the application or from the image tag you deploy. If you run it from containers:

docker ps --format '{{.Image}}' | grep -i postiz

Then look in the uploads directory for files with html, htm or svg extensions that nobody on your team put there.

What to do now

  1. Upgrade to Postiz 2.21.6 or later.
  2. Review the uploads directory for HTML and SVG files and remove ones you do not recognise.
  3. As the advisory suggests while you plan the upgrade, consider disabling uploads or serving the uploads path with a download disposition and a restrictive content security policy.
  4. Rotate sessions for users who may have opened unknown uploads.
  5. Review your user list and remove accounts that are not needed.

Why it matters

The primary weakness is CWE-79, cross site scripting, made possible by trusting a client supplied header. The upload code checks the declared type, but the web server then decides how to serve the file from its extension. When the two disagree, an attacker picks the one that runs in the browser.

Stored XSS in an application that holds social media account tokens is a serious position, because a script running as a victim can act as that victim. The advisory also notes tokens without an expiry claim. The record does not report exploitation in the wild.

Quick check

Does an attacker need an account?

Yes, the record describes any authenticated user. On a shared or open signup instance that may be a low bar.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.