# Code Snippets <= 4.0.0 - Authenticated (Contributor+) Sensitive Information Exposure via Snippet Source Shortcodes

- **ID:** WPSEC-2026-2643
- **Plugin:** Code Snippets (`code-snippets`), https://wordpress.org/plugins/code-snippets/
- **Affected versions:** from 2.6.0 before 4.1.0
- **Fixed in:** 4.1.0 (Update to 4.1.0 or later.)
- **Severity:** Medium 4.3 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N)
- **Weakness:** CWE-200
- **Usage among sites WPSec scans:** plugin Medium, affected versions Medium (as of 2026-11-06)
- **Attack surface analysis:** https://attacksurface.wpsec.com/plugin/code-snippets
- **Fix released:** 2026-11-05
- **Published:** 2026-11-06
- **URL:** https://wpsec.com/vuln/WPSEC-2026-2643/

## Description

The Code Snippets plugin for WordPress is vulnerable to Sensitive Information Exposure via the [code_snippet_source] and [code_snippet] shortcodes in all versions up to, and including, 4.0.0, due to the shortcodes rendering the source code of any snippet by ID without checking whether the author of the post is allowed to manage snippets. This makes it possible for authenticated attackers with contributor-level access and above to read the source code of any site or network snippet, which may contain sensitive data such as credentials or API keys.

## References

- https://wpsec.com/vuln/WPSEC-2026-2643/
- https://plugins.svn.wordpress.org/code-snippets/tags/4.1.0/
- https://wordpress.org/plugins/code-snippets/

Source: WPSec, https://wpsec.com/vuln/WPSEC-2026-2643/

License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Free to use, share and adapt, also commercially, if you credit WPSec and link to this advisory.
