Executive brief
better-icons is a tool used to search for icons and automatically generate code components for web projects. A security flaw allows an attacker to manipulate file paths and component names, potentially leading to unauthorized file modifications or the injection of malicious code into a project's source files. If a developer later builds or runs the affected project, the injected code could execute, compromising the application's security and data.
Technical details
The vulnerability consists of two primary issues within the 'scan_project_icons' and 'sync_icon' tools of the better-icons MCP server. First, the 'icons_file' argument lacks path validation, canonicalization, or project-root confinement, enabling path traversal (CWE-22) and arbitrary file writes (CWE-73). Second, the 'component_name' argument is inserted directly into generated JavaScript/TypeScript/Vue/Svelte templates without identifier validation, allowing for top-level source code injection (CWE-94). An attacker can exploit these to modify sensitive files or achieve code execution when the victim project is subsequently built or executed. The vulnerability is reachable via any MCP client or prompt-injected agent. As of the advisory date, no official patch has been released.
Affected products
- better-auth better-icons up to 1.0.5
Timeline
- 2026-07-13: advisory: NVD publication date
- 2026-07-13: disclosed: Public disclosure of the exploit and issue report