-
Notifications
You must be signed in to change notification settings - Fork 1.8k
JS: Loosen the source in js/shell-command-constructed-from-input
#5439
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
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 have some concerns about the FPs we may introduce. But you are the authority on those.
tryExtensions(pkg.getFile().getParentContainer(), "index", priority - prioritiesPerCandidate()) | ||
exists(Folder folder | folder = pkg.getFile().getParentContainer() | | ||
result = | ||
tryExtensions([folder, folder.getChildContainer("src")], "index", |
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.
It is quite common to name the src
folder lib
in JavaScript projects. But perhaps that is not the case with lib/index.js
?
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.
@@ -1,7 +1,7 @@ | |||
var cp = require("child_process") | |||
|
|||
module.exports = function (name) { | |||
cp.exec("rm -rf " + name); // OK - this file belongs in a sub-"module", and is not the primary exported module. |
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.
Hmm. We explicitly decided not to flag this kind of pattern earlier. Should we do a run-on-all to ensure that we are not forgetting something?
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.
Hmm. We explicitly decided not to flag this kind of pattern earlier. Should we do a run-on-all to ensure that we are not forgetting something?
Lets do that.
I think the reason I added the filter was from seeing noise in various sub-packages.
Often these sub-packages were just copy-pasted third party libraries, or only used internally.
But they're not FPs, they're just benign results (and people should stop copy-pasting code).
I'm running an evaluation now, lets wait for that before we do a run-on-all.
* The value is either directly the `module.exports` value, a nested property of `module.exports`, or a method on an exported class. | ||
*/ | ||
private DataFlow::Node getAValueExportedByPackage() { | ||
result = getAnExportFromModule(getTopmostPackageJSON().getMainModule()) | ||
result = |
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 a nice simplification! Let's hope we don't need it.
Evaluation came back, and there's something to look at (new results). I think the performance regression is spurious. |
The And the So I think it looks safe. |
Run on all is done: #5449 (comment) |
Gets a TP/TN for CVE-2021-23326
Three changes:
index.js
andsrc/index.js
, instead of just the former.