mirror of
https://github.com/trailofbits/skills
synced 2026-06-21 14:12:00 +00:00
52314112b9
* fix(ct_analyzer): escape XML special chars in _compile_csharp()
source_path and output_dir were embedded into the .csproj f-string
without escaping. On Linux, filenames may contain XML-special chars
(", <, >, &), allowing a crafted filename to inject arbitrary MSBuild
XML (CWE-91 -> CWE-78).
Fix: wrap both values with xml.sax.saxutils.escape() before
interpolation. The extra {chr(34): '"'} arg covers double-quotes
inside the attribute value (chr(34) avoids an f-string quote conflict
on Python < 3.12).
* Update script_analyzers.py
---------
Co-authored-by: Scott Arciszewski <147527775+tob-scott-a@users.noreply.github.com>