T09 · Insecure Skill Coding Practices
- Location
scripts/backtest_engine.py:408- Finding
Predictable shared temporary files allow symlink-based file overwrite
- Content
View full analysis
0) win_rate = winning_trades / total_trades * 100 if total_trades > 0 else 0 avg_pnl = sum(t['pnl'] for t in self.trades) / total_trades if total_trades > 0 else 0 f.write(f"总交易次数: {total_trades}\n") f.write(f"胜率: {win_rate:.1f}%\n") f.write(f"平均盈亏: {avg_pnl:.2f}%\n") ``` ### Technical Analysis The scripts write to fixed, globally predictable filenames in the shared `/tmp` directory. The output operations do not use exclusive file creation, verify file ownership, reject symbolic links, o ...[truncated 1967 chars]- Remediation
View remediation
