T09 · Insecure Skill Coding Practices
- Location
scripts/collect.py:1491- Finding
Arbitrary Filesystem Writes Through Author Path Traversal
- Content
View full analysis
共{len(all_posts)}条,生成时间:{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}\n\n---\n\n") ``` ### Technical Analysis The user-controlled `--author` value is used directly as a filesystem path component. The application does not reject absolute paths, path separators, drive-qualified paths, or traversal sequences such as `..`. `os.path.join()` does not enforce containment. Traversal components can escape the configured output directory, and an absolute author value may cause the output root to be discarded entirely on supported platforms. The application then creates directories and writes predictable filenames beneath the resulting path. The affected outputs include: - `posts_full.json` - `posts_full.md` - Category-specific JSON and Markdown files - Downloaded image files - Intermediate output directories ### Attack Path 1. An attacker or untrusted caller controls the `--author` argument or interactive author input. 2. The attacker supplies a value such as `../../target-directory` or an absolute ...[truncated 1166 chars]- Remediation
View remediation
