Evolver Path Traversal Vulnerability in `fetch` Command
A path traversal vulnerability exists in the `fetch` command of `@evomap/evolver` due to insufficient validation of the `--out` flag, allowing attackers to write files to arbitrary locations on the filesystem, potentially leading to overwriting critical system files and privilege escalation.
The @evomap/evolver package contains a path traversal vulnerability in its fetch command, specifically affecting versions prior to 1.69.3. This flaw arises from the insufficient validation of user-supplied paths provided via the --out flag. By manipulating this flag, attackers can bypass intended directory restrictions and write files to arbitrary locations on the filesystem. This can lead to critical system file modification, potentially leading to privilege escalation and persistent backdoor installation. The vulnerability exists in the index.js file, where the application processes the --out flag without proper sanitization before writing files to the specified directory. This is particularly concerning in automated environments like CI/CD pipelines where user input might be indirectly injected into the fetch command.
Attack Chain
- The attacker gains control over the input to the
fetchcommand, including the--outflag. - The attacker crafts a malicious
--outparameter containing path traversal sequences (e.g.,../../../). - The
fetchcommand inindex.jsprocesses the--outflag and extracts the user-provided path without validation. - The application attempts to create the directory specified by the manipulated
--outflag usingfs.mkdirSyncwith therecursiveoption. - The application writes files (e.g., downloaded skill files) to the directory specified in the
--outparameter usingfs.writeFileSync, effectively writing to an arbitrary location. - If the attacker has sufficient privileges, they can overwrite critical system files or create new files in sensitive directories like
/etc/cron.d. - The attacker leverages the modified files to achieve persistence (e.g., by creating a cron job).
- The attacker executes malicious code, gaining unauthorized access or escalating privileges.
Impact
Successful exploitation of this vulnerability allows an attacker to write files to arbitrary locations on the filesystem. This can lead to several critical consequences, including overwriting system configuration files, installing persistent backdoors via cron jobs, modifying SSH authorized_keys for unauthorized access, and potentially achieving privilege escalation if the affected process runs with elevated privileges. The impact is particularly severe in automated environments where this tool is used to deploy code, as it opens the door for supply chain attacks. This issue affects users of @evomap/evolver prior to version 1.69.3.
Recommendation
- Upgrade the
@evomap/evolverpackage to version 1.69.3 or later to remediate the path traversal vulnerability. - Deploy the Sigma rule
Detect Evolver Path Traversal Attemptto identify exploitation attempts based on command-line arguments. - Monitor process creation events for command-line arguments containing path traversal sequences like
../when executingnodeornodejsrelated to evolver.
Detection coverage 2
Detect Evolver Path Traversal Attempt
highDetects attempts to exploit the path traversal vulnerability in `@evomap/evolver` by monitoring command-line arguments for path traversal sequences passed to node.
Detect Evolver Linux Path Traversal Attempt
highDetects attempts to exploit the path traversal vulnerability in `@evomap/evolver` on Linux by monitoring command-line arguments for path traversal sequences passed to node.
Detection queries are kept inside the platform. Get full rules →