Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

C#: Diff-informed queries: phase 3 (non-trivial locations)#20074

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
d10c wants to merge5 commits intogithub:main
base:main
Choose a base branch
Loading
fromd10c:d10c/diff-informed-phase-3-csharp

Conversation

d10c
Copy link
Contributor

This PR enables diff-informed mode on queries that select a location other than dataflow source or sink. This entails adding a non-trivial location override that returns the locations that are actually selected.

Prior work includes PRs like#19663,#19759, and#19817. This PR uses the same patch script as those PRs to find candidate queries to convert to diff-enabled. This is the final step in mass-enabling diff-informed queries on all the languages.

Commit-by-commit reviewing is recommended.

  • I have split the commits that add/modify tests from the ones that enable/disable diff-informed queries.
  • If the commit modifies a .qll file, in the commit message I've included links to the queries that depend on that .qll for easier reviewing.
  • Feel free to delegate parts of the review to others who may be more specialized in certain languages.

@d10cd10c added the no-change-note-requiredThis PR does not need a change note labelJul 17, 2025
@d10cd10c marked this pull request as ready for reviewJuly 17, 2025 13:48
@CopilotCopilotAI review requested due to automatic review settingsJuly 17, 2025 13:48
@d10cd10c requested a review froma team as acode ownerJuly 17, 2025 13:48
@d10cd10c requested a review frommichaelnebelJuly 17, 2025 13:48
Copy link
Contributor

@CopilotCopilotAI 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 enables diff-informed mode on C# queries that select locations other than dataflow source or sink by adding theobserveDiffInformedIncrementalMode() predicate and custom location overrides where needed. This is the final step in mass-enabling diff-informed queries across all languages.

  • AddsobserveDiffInformedIncrementalMode() predicate to enable diff-informed mode on data flow configurations
  • Implements custom location selection logic viagetASelectedSinkLocation() for queries that report locations different from sink locations
  • Distinguishes between primary configurations (enabled withany()) and secondary configurations (disabled withnone())

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
FileDescription
HardcodedConnectionString.qlEnables diff-informed mode and adds location override to select call locations instead of sink locations
ThreadUnsafeICryptoTransformLambda.qlEnables diff-informed mode for parallel crypto transform usage detection
UnsafeDeserializationQuery.qllEnables diff-informed mode for primary configs, disables for secondary configs used in unsafe deserialization queries
ExternalAPIsQuery.qllEnables diff-informed mode for external API data flow tracking
ConditionalBypassQuery.qllEnables diff-informed mode and adds location override to select both sink and sensitive method call locations

Copy link
Contributor

@michaelnebelmichaelnebel left a comment

Choose a reason for hiding this comment

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

LGTM under the conditions that
(1) DCA looks good
(2) The discussion startedhere is resolved.

@@ -78,6 +78,8 @@ private module RemoteSourceToExternalApiConfig implements DataFlow::ConfigSig {
predicateisSource(DataFlow::Nodesource){sourceinstanceofActiveThreatModelSource}

predicateisSink(DataFlow::Nodesink){sinkinstanceofExternalApiDataNode}

predicateobserveDiffInformedIncrementalMode(){any()}
Copy link
Contributor

Choose a reason for hiding this comment

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

This will also affect the output ofcs/count-untrusted-data-external-api (if run in diff informed mode). However, this query is not included in any query suite, so this should be ok.

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

Copilot code reviewCopilotCopilot left review comments

@michaelnebelmichaelnebelmichaelnebel approved these changes

Assignees
No one assigned
Labels
C#no-change-note-requiredThis PR does not need a change note
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@d10c@michaelnebel

[8]ページ先頭

©2009-2025 Movatter.jp