JS: Extra taint-steps to support CVE#4231
Merged
codeql-ci merged 6 commits intogithub:mainfrom Sep 15, 2020
Merged
Conversation
asgerf
approved these changes
Sep 11, 2020
| } | ||
|
|
||
| /** | ||
| * Holds if there is a taint-step involving a (non-function) underscore method from `pred` to `succ`. |
Contributor
There was a problem hiding this comment.
What do you mean by "non-function"?
Contributor
Author
There was a problem hiding this comment.
I mean that I don't include any of the Underscore methods that involve functions. (E.g. _.bind(), _.partial(), _.throttle()).
They are called Function Functions in the Underscore documentation.
Should I update the docstring to something else?
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 almost gets a TP/TN for CVE-2020-15152 (one callgraph related step missing).
Does the following:
Add support for direct callbacks to
require("net").createServer((socket) => {...}).Previously only
require("net").createServer().on("connection", (socket) => {...})was supported.(Also adds
tlsas another module that has the samecreateServermethod).Adds
(new require("net").Socket()).connect(..)as aClientRequest.Neither
getAResponseDataNodenorgetADataNodeare needed for the CVE, but I added them for completeness.Drive-by refactorization of
arrayFunctionTaintStep.Taint step for
require("bluebird").mapSeries().(
mapSeriesis unique tobluebird).Only the
argument -> parameterstep is needed for the CVE, but I added thereturn -> callstep for completeness.Adds lots of taint-steps for
underscoremethods.I took a quick walk through here: https://underscorejs.org/#each, and added taint-steps for the methods that had obvious taint-steps.
Only
_.compact(array)is needed for the CVE.An evaluation on nightly looks fine fine.
(
UnsafeJQueryPlugin.qlfailed forazure-sdk-for-nodeon both branches - that was after my recent PR - I'm investigating).