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

Add codeql suppression #8134

Merged
merged 2 commits into from
Jan 8, 2025
Merged

Add codeql suppression #8134

merged 2 commits into from
Jan 8, 2025

Conversation

AdamYoblick
Copy link
Member

@AdamYoblick AdamYoblick commented Jan 8, 2025

Fixes #8090

CodeQL doesn't allow you to suppress an warning on an entire file or class, it's per line only.

So even though line 251 already has a suppression, the violation at https://liquid.microsoft.com/codeql/issues/38ae4090-21dd-4617-94cf-6f5f77966286 is now occurring on line 256, so we need another suppression.

That's what this change is.

@AdamYoblick AdamYoblick requested a review from a team as a code owner January 8, 2025 19:25
Build/17.0/packages.config Outdated Show resolved Hide resolved
@@ -253,7 +253,7 @@ public static ProcessOutput Run(
psi.Arguments = string.Join(" ",
arguments.Where(a => a != null).Select(QuoteSingleArgument));
} else {
psi.Arguments = string.Join(" ", arguments.Where(a => a != null));
psi.Arguments = string.Join(" ", arguments.Where(a => a != null)); // CodeQL [SM00406] Code ql is complaining, but this is a utility class that is called with many different file names.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

complaining that we dont verify arguments?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah so the actual violation is https://liquid.microsoft.com/Web/Object/Read/ScanningToolWarnings/Requirements/CodeQL.SM00406#Zguide. The problem is that we can't possibly validate arguments here, it's a generic helper class to run a command line, we just join the arguments and run. Just red tape.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so alternatively we look at all the usage points to find a set of strings.. but there will still be some dynamic ones. maybe arg templates safer.

Build/nuget.config Outdated Show resolved Hide resolved
Copy link

sonarqubecloud bot commented Jan 8, 2025

@AdamYoblick
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@AdamYoblick AdamYoblick merged commit 75ed3e9 into main Jan 8, 2025
7 checks passed
@AdamYoblick AdamYoblick deleted the codeql_suppressions branch January 8, 2025 22:45
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.

Codeql alert: Uncontrolled command line
4 participants