Tainted flow: 'OUT' from os.environ.get (line 18, credential/environment) → open (file write)
Medium
- Category
- Data Flow
- Content
} out.append(entry) print('OK', d['short'], '| 段落', len(items), '| 表格', len(tables), '| 章节', ' / '.join(sections)) with open(OUT, 'w', encoding='utf-8') as f: json.dump(out, f, ensure_ascii=False, indent=1) print('索引已保存:', OUT)- Confidence
- 92% confidence
- Finding
- The script writes JSON to a path taken from the YJ_DOC_OUT environment variable without validating or constraining the destination. If an attacker can influence the runtime environment, they can redirect output to arbitrary filesystem locations, causing file overwrite, data corruption, or clobbering files the process has permission to modify.
