Conversation
f3351e3 to
396a283
Compare
chanel-y
approved these changes
Apr 16, 2025
chanel-y
left a comment
There was a problem hiding this comment.
whoops opened the window but then forgot to approve mb
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.
This PR does a couple of things to add more flow sources to PowerShell:
It adds a
Stored.qllfile containing a subclass of local flow sources that represents file reads. It turns out we already have some flow sources belonging to this kind since we stole them from C#:codeql/powershell/ql/lib/semmle/code/powershell/frameworks/SystemIOFile/model.yml
Line 10 in 1637df0
SourceNode😅Then, I also discovered two sources of user flow recently. For example, Select-XML, which can read user input when given an
-Pathargument. So this PR also adds MaD syntax for specifying "the return value of a call when there is a specific named argument". After adding this functionality, this PR also models calls toSelect-XMLandFormat-Hexas remote flow sources of this kind.It fixes a bunch of incorrect models for flow sources. I had incorrectly marked some of them as static method calls, where they should have been non-static method calls.
Field/Propertys should have beenMemberall along in the type models. I've done a mass-renaming to fix this. I've also made all the method names lower-case.It adds testcases for all the currently flow sources. Most of the above fixes are motivated by these tests which were written by a combination of me and Bing 😅