fix(ct_analyzer): escape XML special chars in _compile_csharp()#106
Open
NucleiAv wants to merge 2 commits intotrailofbits:mainfrom
Open
fix(ct_analyzer): escape XML special chars in _compile_csharp()#106NucleiAv wants to merge 2 commits intotrailofbits:mainfrom
NucleiAv wants to merge 2 commits intotrailofbits:mainfrom
Conversation
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).
Contributor
|
https://github.com/trailofbits/skills/actions/runs/22356340569/job/64847828554?pr=106#step:4:138
|
Author
|
issue: there's a diff in the quote sign |
tob-scott-a
approved these changes
Feb 25, 2026
Author
|
i was changing it... but i see you have already done that... thanks! |
Contributor
|
Understood. I'm not quite sure why the other 4 required checks are stuck in "pending" state. |
Author
|
Those 4 checks look like they need a maintainer to approve/trigger the workflow run from a fork... I don't think there's anything on my end causing it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


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).