Skip to content

Conversation

@jonjanego
Copy link
Member

Updated the name and description to clarify why using Path.Combine is problematic.

Reflecting detail in https://codeql.github.com/codeql-query-help/csharp/cs-path-combine/

Updated the name and description to clarify the issue with Path.Combine.
@jonjanego jonjanego requested a review from a team as a code owner December 15, 2025 21:19
Copilot AI review requested due to automatic review settings December 15, 2025 21:19
@github-actions github-actions bot added the C# label Dec 15, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the CodeQL query metadata for PathCombine.ql to better communicate the actual security/behavior concern with Path.Combine. The change clarifies that the issue is not simply calling the method, but rather that later absolute path arguments can silently discard earlier arguments.

Key Changes:

  • Updated the query name from a generic "Call to System.IO.Path.Combine" to a more descriptive warning about the silent argument dropping behavior
  • Enhanced the description to explain that absolute paths in later arguments cause earlier arguments to be dropped

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

@michaelnebel michaelnebel left a comment

Choose a reason for hiding this comment

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

Thank you for doing this @jonjanego !
We should probably also add a change note, since we are changing the query metadata (documentation can be seen here)

jonjanego and others added 2 commits December 16, 2025 09:10
Co-authored-by: Tom Hvitved <hvitved@github.com>
Updated the `name` and `description` of PathCombine.ql to provide more details about the issue.
Copy link
Contributor

@michaelnebel michaelnebel left a comment

Choose a reason for hiding this comment

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

Once again, thank you for doing this! I really appreciate that you take on the challenge @jonjanego !

Copy link
Contributor

@michaelnebel michaelnebel left a comment

Choose a reason for hiding this comment

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

Excellent!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants