GHSA-r466-rxw4-3j9j
### Summary A path traversal vulnerability in the skill download (`fetch`) command allows attackers to write files to arbitrary locations on the filesystem. The `--out=` flag accepts user-provided paths without validation, enabling directory traversal attacks that can overwrite critical system files or create files in sensitive locations. ### Details The vulnerability exists in `index.js` at lines 752-767: ```javascript // index.js:751-768 const outFlag = args.find(a => typeof a === 'string' && a.startsWith('--out=')); const safeId = String(data.skill_id || skillId).replace(/[^a-zA-Z0-9_\-\.]/g, '_'); // VULNERABLE: No path validation on user input const outDir = outFlag ? outFlag.slice('--out='.length) // User-controlled path : path.join('.', 'skills', safeId); if (!fs.existsSync(outDir)) fs.mkdirSync(outDir, { recursive: true }); // ... downloads skill files to outDir ``` The `outFlag.slice('--out='.length)` extracts the user-provided path without any sanitization or validation. An attacker can provide paths like `../../../etc/cron.d` to write files outside the intended directory. Note: The `safeId` variable is sanitized via inline replacement (`replace(/[^a-zA-Z0-9_\-\.]/g, '_')`), but this sanitization only applies to the default path, not to the user-provided `--out=` path. ### PoC **Prerequisites:** - Node.js installed - Access to the evolver application **Steps to reproduce:** 1. Create a test file demonstrating the vulnerability: ```javascript // test-file-write.js const fs = require('fs'); const path = require('path'); // Simulate the vulnerable fetchSkill logic function vulnerableFetchSkill(outFlag) { const outDir = outFlag ? outFlag.slice('--out='.length) // No validation! : path.join('.', 'skills', 'default'); console.log('Target directory:', outDir); console.log('Resolved path:', path.resolve(outDir)); // In real code, this would write skill files const targetFile = path.join(outDir, 'skill.js'); console.log(
Properties
- ghsa_id
- GHSA-r466-rxw4-3j9j
- severity
- high
- summary
- Evolver: Path Traversal via `--out` flag in `fetch` command allows Arbitrary File Write
- cvss_score
- 8.1
- cve_id
- GHSA-r466-rxw4-3j9j
- cvss_vector
- CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H
- is_ghsa_only
- true
- ghsa_published
- 2026-04-22T22:06:15Z
- source_url
- https://github.com/advisories/GHSA-r466-rxw4-3j9j
- ghsa_updated
- 2026-04-22T22:06:16Z
Related Entities (4)
VULNERABLE_TO (1)
AFFECTS (1)
HAS_WEAKNESS (1)
REPORTED_BY (1)
Explore deeper with Ninja Signal's threat intelligence graph