T09 · Insecure Skill Coding Practices
- Location
scripts/tts-converter.js:129- Finding
Unrestricted Output Path Allows Arbitrary File Overwrite
- Content
View full analysis
', 'Output file path (default: temp file in system temp dir)') ``` It is subsequently passed to `textToSpeech` without path validation: ```javascript outputPath: options.output, ``` ### Technical Analysis The `--output` argument accepts an arbitrary filesystem path. The application neither constrains that path to an approved output directory nor checks whether the destination already exists, resolves through a symbolic link, or refers to a sensitive file. The path is passed directly to `node-edge-tts` as the destination for generated audio. Consequently, the behavior of the write operation is delegated to the dependency without enforcing application-level filesystem security boundaries. If subtitle generation is enabled, the library may also create a JSON file derived from the selected output path. This violates the principle of least privilege for filesystem operations. Even though the process cannot write beyond the privileges of the account running it, any writable file available to that account is potentially exposed to replacement or corruption. ### Attack Path 1. An attacker supplies or influences a TTS request that includes a crafted output path. 2. The Agent or user invokes the converter with an argument such as: ```bash node scripts/tts-converter.js "text" --output /path/to/writable/important-file ``` 3. Commander stores the path in `options.output`. 4. The a ...[truncated 1099 chars]- Remediation
View remediation
