# Code Snippets <= 4.0.0 - Authenticated (Administrator+) Missing Authorization to Network Snippet Import

- **ID:** WPSEC-2026-2642
- **Plugin:** Code Snippets (`code-snippets`), https://wordpress.org/plugins/code-snippets/
- **Affected versions:** from 3.9.4 before 4.1.0
- **Fixed in:** 4.1.0 (Update to 4.1.0 or later.)
- **Severity:** Low 2.2 (CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:N)
- **Weakness:** CWE-862
- **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-2642/

## Description

The Code Snippets plugin for WordPress is vulnerable to unauthorized modification of data via the snippet import REST routes (file upload import and third-party plugin import) in all versions up to, and including, 4.0.0, due to the routes' permission callbacks checking only the site-level snippet capability while honouring a 'network' parameter that writes to the network snippets table. This makes it possible for authenticated attackers with subsite administrator access on a multisite installation to create network snippets, or overwrite existing network snippets with the same name, without the network snippet capability.

## References

- https://wpsec.com/vuln/WPSEC-2026-2642/
- 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-2642/

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.
