@evomap/evolver Path Traversal Vulnerability Leads to RCE
A path traversal vulnerability in `@evomap/evolver` allows a malicious A2A Hub to overwrite project files, leading to remote code execution when a user fetches a malicious skill.
The @evomap/evolver package, specifically versions 1.70.0-beta.4 and earlier, contains a path traversal vulnerability in the evolver fetch subcommand. This vulnerability resides within index.js and allows a malicious A2A Hub to overwrite project files, ultimately leading to remote code execution (RCE). The flaw stems from insufficient sanitization of the skill_id parameter, where a regex allow-list permits the use of . characters. An attacker can exploit this by uploading a malicious skill to the A2A Hub with a crafted skill_id of .. and a bundled file such as index.js containing attacker-controlled JavaScript code. When a victim fetches the malicious skill, their index.js file is overwritten. The next time the victim invokes node index.js, even with a simple command like --help, the malicious code executes with the victim’s privileges, giving the attacker control of the victim’s environment.
Attack Chain
- Attacker uploads a malicious skill to the A2A Hub, setting the
skill_idto... The malicious skill also includes abundled_filesarray containing a file namedindex.jswith malicious JavaScript code. - The victim runs
node index.js fetch --skill=anythingto download the skill. - The
evolver fetchcommand inindex.jsusespath.join('.', 'skills', safeId)to determine the output directory, wheresafeIdis the attacker-controlledskill_idafter regex sanitization. SincesafeIdis.., the output directory resolves to the current working directory. - The code proceeds to iterate over the
bundled_filesarray from the Hub response and writes each file to the output directory. - Due to the path traversal, the attacker-supplied
index.jsfile overwrites the originalindex.jsfile in the victim’s current working directory. - The victim subsequently invokes
node index.js <command>, which executes the attacker-controlled JavaScript code due to the overwrittenindex.jsfile. - The attacker achieves remote code execution with the privileges of the victim’s user account.
- The attacker can maintain persistence by using the
run --loopdaemon mode and injecting commands or establishing reverse shells.
Impact
Successful exploitation leads to remote code execution on the victim’s machine with the privileges of the evolver process. This allows the attacker to execute arbitrary commands, install malware, steal sensitive data, or compromise the entire system. The impact is amplified because the loop daemon (node index.js run --loop) is the documented long-running mode, resulting in the malicious code being executed rapidly after the next daemon iteration. This vulnerability allows an attacker to compromise every user that fetches the malicious skill with a single malicious skill upload. Furthermore, the attacker can also overwrite other files like package.json, potentially leading to further compromise of the victim’s system.
Recommendation
- Deploy the following Sigma rule to detect attempts to download skills with suspicious
skill_idvalues from the A2A Hub. - Apply the provided patch to
index.jsto rejectsafeIdvalues that are not single non-traversing path segments, or reuse the samepath.relativecheck used in the--outbranch. - Consider removing
.from the regex allow-list used to sanitize theskill_idparameter. - Implement signature verification on the Hub response payload before writing any file to disk.
- Disallow bundled-file
safeNamevalues that match top-level project files (index.js,package.json,package-lock.json, etc.) regardless ofoutDir.
Detection coverage 2
Detect Suspicious Skill ID in evomap/evolver fetch Command
highDetects attempts to fetch skills with suspicious skill_id values (e.g., '..') that could indicate a path traversal attack.
Detect Overwritten index.js with Malicious Content
criticalDetects if index.js has been overwritten by malicious content
Detection queries are kept inside the platform. Get full rules →