T09 · Insecure Skill Coding Practices
- Location
scripts/network_to_inp.py:21- Finding
Untrusted Model Fields Permit SWMM INP Configuration Injection
- Content
View full analysis
str: if x is None: return "" if isinstance(x, bool): return "YES" if x else "NO" if isinstance(x, int): return str(x) if isinstance(x, float): return f"{x:.6f}".rstrip("0").rstrip(".") return str(x) def emit_junctions(network: dict) -> list[str]: lines = ["[JUNCTIONS]", ";;Name Elevation MaxDepth InitDepth SurDepth Aponded"] for j in network.get("junctions", []): lines.append( f"{j['id']:<16} {format_num(j['invert_elev']):<14} {format_num(j['max_depth']):<14} {format_num(j.get('init_depth', 0)):<14} {format_num(j.get('sur_depth', 0)):<14} {format_num(j.get('aponded', 0))}" ) return lines def emit_outfalls(network: dict) -> list[str]: lines = ["[OUTFALLS]", ";;Name Elevation Type Stage Data Gated Route To"] for o in network.get("outfalls", []): lines.append( f"{o['id']:<16} {format_num(o['invert_elev']):<14} {o['type']:<14} {format_num(o.get('stage_data', '')):<15} {format_num(o.get('gated', False)):<14} {format_num(o.get('route_to', ''))}" ) return lines def emit_conduits(network: dict) -> list[str]: lines = ["[CONDUITS]", ";;Name From Node To Node Length Roughness InOffset OutOffset InitFlow MaxFlow"] for c in network.get("conduits", ...[truncated 6650 chars]- Remediation
View remediation
