Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Argument-position matching can bind inputs to the wrong parameters and lose security-relevant data flow, while unchanged UnsafeJsEval expectations will cause a consistency-test failure.
6 open issues
Regenerate UnsafeJsEval consistency expectations · New Account for omitted defaults in unlabeled argument matching · New Retain synthetic argument positions 0–20 · New Avoid expanding positional matches across all source positions · New Preserve unlabeled indexing for legacy summary operands · New Account for positional trailing closures in parameter matching · New
What changed in this PR
Aligns unified CodeQL data-flow parameter and argument positions with type inference, distinguishing source parameters from summary positions and ranking repeated external names.
Changes:
- Introduces separate parameter and argument representations with explicit matching rules.
- Uses position helpers when constructing data-flow nodes.
- Removes obsolete overlapping-parameter expectations from the type-inference consistency test.
| File | Description |
|---|---|
unified/ql/test/library-tests/type-inference/CONSISTENCY/DataFlowConsistency.expected |
Removes obsolete overlapping-parameter diagnostics. |
unified/ql/lib/codeql/unified/internal/dataflow/ParameterPositions.qll |
Defines source, summary, and argument positions and their matching rules. |
unified/ql/lib/codeql/unified/internal/dataflow/DataFlowInstantiation.qll |
Connects parameter and argument nodes to the new position helpers. |
Review effort: Max
| or | ||
| name = any(Argument arg).getName() | ||
| } | ||
| TSourceParameter(int pos, string name, int rnk) { parameterPos(_, _, pos, name, rnk) } or |
| or | ||
| ppos.isCallee() and apos.isCallee() | ||
| or | ||
| ppos = TSourceParameter(apos.asPositional(), _, _) |
| private newtype TArgumentPosition = | ||
| TReceiverArgument() or | ||
| TCalleeArgument() or | ||
| TPositionalArgument(int pos) { positionalArgument(_, _, pos) } or |
| or | ||
| ppos.isCallee() and apos.isCallee() | ||
| or | ||
| ppos = TSourceParameter(apos.asPositional(), _, _) |
| or | ||
| ppos = TSourceParameter(apos.asPositional(), _, _) | ||
| or | ||
| ppos = TSummaryPositionalParameter(apos.asPositional()) |
| or | ||
| ppos = TSummaryPositionalParameter(apos.asPositional()) | ||
| or | ||
| exists(int rnk | ppos = TSourceParameter(_, apos.asNamed(rnk), rnk)) |
This branch has not been deployed
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.


No description provided.