T09 · Insecure Skill Coding Practices
- Location
scripts/save_scheme.py:190- Finding
Unrestricted File Destination Allows Modification of Arbitrary Writable Files
- Content
View full analysis
最后更新:\d{4}-\d{2}-\d{2}", f"> 最后更新:{today}", content ) scheme_path.write_text(content, encoding="utf-8") ``` The destination is also created without validating its type or location: ```python def ensure_file(scheme_path): """Ensure scheme.md exists with proper header.""" scheme_path.parent.mkdir(parents=True, exist_ok=True) if not scheme_path.exists(): header = f"""# 股票策略跟踪 > 最后更新:{datetime.now().strftime('%Y-%m-%d')} """ scheme_path.write_text(header, encoding="utf-8") ``` ### Technical Analysis The script accepts a destination from either `--path` or `STOCK_SCHEME_PATH` an ...[truncated 2705 chars]- Remediation
View remediation
