-
Notifications
You must be signed in to change notification settings - Fork 1.8k
JS: add simple query for detecting sensitive files downloaded over insecure connection #3689
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
*/ | ||
string unsafeExtension() { | ||
result = | ||
["exe", "dmg", "pkg", "tar.gz", "zip", "sh", "bat", "cmd", "app", "apk", "msi", "dmg", |
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.
What about .jar
and .war
files?
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.
Good point, those after often used as executeables.
javascript/ql/src/semmle/javascript/security/dataflow/InsecureDownload.qll
Outdated
Show resolved
Hide resolved
Co-authored-by: Asger F <asgerf@github.com>
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
@mchammer01 another doc review for you 😄
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.
@erik-krogh - this LGTM ✨
Happy for this to be merged once you had a look at my suggestions and comments (there are a few typos, but apart from that, it's looking really good).
Hope it helps!
I'm not sure how relevant this is in practice: So it may be useful to also to track such cases. Or maybe not 🤷♂️ |
I think it is useful to track such cases. And you got a good point, thanks 👍 |
Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com>
It did, I agree with all your suggested changes 👍 |
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
CVE-2017-16003: TP/TN
A very closely related issue to look for
http
urls in 'package.jsonfiles, or
<script />tags with
http` urls, but that is not a path-problem, so it feels weird mashing that into the same query.Maybe we should get back to that later?
It was suggested at one point that I could add an integrity-check as a sanitizer, but I don't know what that would look like?
The query only supports the
http
andftp
protocols for now. Suggestions for additional protocols are very welcome.Performance evaluation waits until after this PR has been merged into the sprint branch.