{
 "schema_version": "1.9.2",
 "id": "WPSEC-2026-4040",
 "modified": "2026-11-26T23:43:54Z",
 "published": "2026-11-26T23:43:54Z",
 "summary": "Code Snippets <= 4.1.0 - Unauthenticated Client-Side Path Traversal via 'from' Parameter",
 "details": "The Code Snippets plugin for WordPress is vulnerable to Client-Side Path Traversal via the 'from' query parameter on the Import screen in all versions from 3.10.0 up to, and including, 4.1.0. This is due to the importer name being read from the URL and placed into REST API request paths without validation or URL encoding. When the screen loads, the plugin automatically sends a GET request to that path, and it sends a POST request when the user runs an import. Both requests carry the logged-in user's REST nonce. This makes it possible for unauthenticated attackers to redirect these authenticated requests to other REST API routes, with query parameters they choose, and perform actions as the administrator, for example changing user roles or modifying snippets. Exploitation requires tricking a site administrator into following a crafted link.",
 "severity": [
  {
   "type": "CVSS_V3",
   "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  }
 ],
 "affected": [
  {
   "package": {
    "ecosystem": "WordPress:Plugin",
    "name": "code-snippets"
   },
   "ranges": [
    {
     "type": "ECOSYSTEM",
     "events": [
      {
       "introduced": "3.10.0"
      },
      {
       "fixed": "4.1.1"
      }
     ]
    }
   ],
   "database_specific": {
    "affected_text": [
     "from 3.10.0 before 4.1.1"
    ]
   }
  }
 ],
 "references": [
  {
   "type": "ADVISORY",
   "url": "https://wpsec.com/vuln/WPSEC-2026-4040/"
  },
  {
   "type": "WEB",
   "url": "https://plugins.svn.wordpress.org/code-snippets/tags/4.1.1/"
  },
  {
   "type": "PACKAGE",
   "url": "https://wordpress.org/plugins/code-snippets/"
  }
 ],
 "database_specific": {
  "url": "https://wpsec.com/vuln/WPSEC-2026-4040/",
  "cwe_ids": [
   "CWE-22"
  ],
  "vulnerability_type": "TRAVERSAL",
  "severity": "High",
  "license": {
   "name": "CC BY 4.0",
   "url": "https://creativecommons.org/licenses/by/4.0/"
  }
 }
}
