-
Notifications
You must be signed in to change notification settings - Fork 1.7k
JS: model property projection calls #113
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
Conversation
( | ||
callee = DataFlow::moduleMember("dotty", "search") and | ||
objectIndex = 0 and | ||
selectorIndex = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation.
import javascript | ||
|
||
/** | ||
* A call that projects selected properties of an object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and below: these comments could do with examples of what is being modelled.
abstract DataFlow::Node getASelector(); | ||
|
||
/** | ||
* Holds if this call returns the value of a single projected property. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is particularly arcane; please explain more carefully and add an example.
Comments addressed. |
Squashed the fixups. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The tests actually seem to have succeeded, but the status didn't propagate (@pavel). Merging. |
@esben-semmle, this PR seems to have been left behind when creating https://github.com/Semmle/ql/tree/rc/1.18. Could you open a PR to cherry-pick the commits across? Same for #115. |
@xiemaisi Thanks for notifying me, but it does not seem that I'm involved in this project in any way. https://blog.github.com/2011-03-23-mention-somebody-they-re-notified/ |
Oops, sorry, wrong Pavel... (It's a great project, though! 😄) |
Kotlin: Allow building only a single way
fix implicit this
…this fix implicit this
This PR adds a taint step for property reads done through calls that projects selected properties of an object.
The property projections that have been modeled have slightly different features. So I have adopted @asger-semmle's extensible architecture proposal immediately. We may want to discuss how we generally document the intended usage of the architecture, I have simply added an explanation to the module docstring for now.
This PR only makes use of the object-argument in the models.
For the record, the libraries support various features for the selector-argument:
'a.b[42].c'
['a', 'b', 42, 'c']
'a.\*.c'
We can consider implementing support for these once our general heap treatment is better.
An evaluation with the security suite on big-apps.slugs flags nothing new, and it does not have a significant performance impact (internal link).