Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added explicit sub command for dotnet in NSwagExe #4796

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Nisden
Copy link

@Nisden Nisden commented Feb 27, 2024

This PR resolves an issue where CodeQL could interpert the user intent incorrectly and accidently add invalid parameters to the NSwag execution.

In the following example, CodeQL would assume the run is the dotnet subcommand, but that is incorrect, its the arguments sent to NSwag.

<Target Name="NSwag" AfterTargets="Build">
<Exec Command="$(NSwagExe) run nswag.json /variables:Configuration=$(Configuration)" />
</Target>

This is because of how CodeQL detects the user intent, by ignoring parameters until it finds the first string that could be a subcommand, see:
https://github.com/github/codeql/blob/606a8fed0c57d1c4cad02f2c48acc3fa331d92a2/csharp/tools/tracing-config.lua#L70

This avoids an issue where CodeQL would inject addition build arguments
(p:EmitCompilerGeneratedFiles).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant