Postiz — CVE-2026-40487 Stored XSS via File Upload Validation Bypass
AI relevance: Postiz is an AI-powered social media scheduling platform that connects to multiple social networks — compromise of its users enables lateral movement into connected social accounts and any AI workflows that consume scheduled content.
CVE-2026-40487 (CVSS 8.9, High) is a stored cross-site scripting vulnerability in Postiz, an AI social media scheduling tool, published April 18, 2026. The flaw allows any authenticated user to upload arbitrary executable files by spoofing the Content-Type header.
The vulnerability
- Root cause: Postiz versions prior to 2.21.6 validate uploaded files using only the user-supplied
Content-Typeheader, not the actual file content or extension. - Exploitation: An attacker uploads an
.htmlor.svgfile containing JavaScript, spoofing the Content-Type header (e.g.,image/png) to bypass server-side validation. - Server-side amplification: nginx serves the uploaded files with content types derived from the file extension (
text/htmlfor.html,image/svg+xmlfor.svg), ensuring browsers execute embedded scripts in the application's origin context. - Impact: Stored XSS within the application origin enables session riding, account takeover, and full compromise of other users' accounts — including administrators.
- Related: Postiz was also affected by CVE-2026-34577 (unauthenticated SSRF via URL proxy), indicating a pattern of insufficient input validation across the application.
Why it matters
AI scheduling tools like Postiz hold OAuth tokens for connected social accounts and often process user-generated content through AI pipelines. Stored XSS in such a platform can cascade into social account compromise, AI prompt manipulation via scheduled content, and supply-chain attacks against downstream consumers of the scheduled posts. The Content-Type spoofing pattern is a recurring class of file upload vulnerability that affects many self-hosted and SaaS applications.
What to do
- Update to Postiz v2.21.6 or newer.
- If self-hosting, configure nginx to serve user-uploaded files with
Content-Type: application/octet-streamandX-Content-Type-Options: nosniff. - Rotate OAuth tokens for any social accounts connected to Postiz instances that were potentially exposed.
- Audit file upload handlers in your own applications: validate content by inspecting file bytes, not client-supplied headers.