-
Notifications
You must be signed in to change notification settings - Fork 1.8k
JS: Add model for live-server
#6572
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
cb75762
to
28dce6e
Compare
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. I have a few semantics-preserving suggestions.
@@ -156,10 +113,11 @@ module Connect { | |||
* An access to a user-controlled Connect request input. | |||
*/ | |||
private class RequestInputAccess extends HTTP::RequestInputAccess { | |||
RequestExpr request; | |||
NodeJSLib::RequestExpr request; |
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.
Could we keep hiding that this is just a NodeJSLib::RequestExpr
reference under the hood?
Perhaps the deleted RequestExpr
should just be an alias now?
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.
I've added a class RequestExpr = NodeJSLib::RequestExpr;
result = middleware.getAMemberCall(["push", "unshift"]).getArgument(0).getAFunctionValue() | ||
or | ||
result = middleware.(DataFlow::ArrayCreationNode).getAnElement().getAFunctionValue() |
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 middleware
value is just an array in practice, right?
I expect that this push/unshift
pattern could apply to all kinds of middleware setups that take arrays as arguments.
Should we (later?) add a utility class that would enable us to write the above as:
result = middleware.(DataFlow::ArrayLikeNode).getAnElement().getAFunctionValue()
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.
We could do that. The same utility class could also be used in UnsafeShellCommandConstructionCustomizations.qll
.
I'll put it on my list, and look at it later.
Co-authored-by: Esben Sparre Andreasen <esbena@github.com>
And improve+simplify the model for
connect
by basing it off theNodeJS
model.Adds source+sink for CVE-2020-7680.
Evaluation was uneventful.