---
id: "CVE-2026-77871"
kind: "vulnerability"
aliases: ["CVE-2026-77871"]
title: "Post Snippets WordPress plugin: contributors can inject stored scripts into pages"
severity: "medium"
cvss: 6.4
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["package", "post-snippets", "wordpress", "wordpress-plugin"]
not_affected_if: ["no-contributor-accounts", "plugin-not-installed", "shortcodes-disabled"]
published_at: "2026-10-28T07:16:49+00:00"
first_seen_at: "2026-10-28T07:31:38+00:00"
updated_at: "2026-10-28T07:32:54+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-77871", "first_seen_at": "2026-10-28T07:31:38+00:00"}]
---

# Post Snippets WordPress plugin: contributors can inject stored scripts into pages

The Post Snippets WordPress plugin up to and including 4.2.4 fails to sanitize shortcode attributes, so entity-encoded script tags survive save and are decoded into live HTML at render time. An authenticated contributor can plant JavaScript that runs in the browser of anyone who views the affected page, including administrators.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed version of the Post Snippets plugin in the WordPress admin Plugins screen; versions `4.2.4` and below are affected.
- Confirm whether snippet shortcodes are enabled in the plugin settings.
- Review pages and posts for unexpected script content in snippet shortcode attributes.

## Fix

- Update the Post Snippets plugin to a version later than `4.2.4`, as the sources do not name a fixed version.
- Restrict contributor-level accounts or disable snippet shortcodes until the update is applied.

## Timeline

- 2026-10-28T07:31:38+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-77871

## From the sources

The Post Snippets – Custom WordPress Code Snippets Customizer plugin for WordPress is vulnerable to Stored Cross-Site Scripting via Shortcode Attributes in all versions up to, and including, 4.2.4 due to insufficient input sanitization and output escaping. This makes it possible for authenticated attackers, with contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page. Entity-encoded payloads such as &lt;script&gt;...&lt;/script&gt; survive WordPress's wp_kses_post on-save sanitization because kses does not decode HTML entities, and are only converted back into executable HTML tags at render time by the plugin's own shortcode filter. This requires snippet shortcodes to be enabled.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
