-
Notifications
You must be signed in to change notification settings - Fork 1.8k
JS: polish for #132 #300
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
JS: polish for #132 #300
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.
Looks great!
Apart from a few typos I have two bikeshedding topics, but feel free to ignore these if you don't agree:
- The phrase "remote request" sounds weird to me. I'd say HTTP request or network request or just outbound request (dropping the "remote" part).
- As mentioned inline, "user-controlled data in file" sounds like you're flagging files with user-controlled data, as opposed to places where user-controlled data is written to a file.
@@ -1,6 +1,6 @@ | |||
/** | |||
* @name Http response data flows to File Access | |||
* @description Writing data from an HTTP request directly to the file system allows arbitrary file upload and might indicate a backdoor. | |||
* @name User-controlled data in file |
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.
User-controlled data written to file?
@@ -9,17 +9,31 @@ import javascript | |||
|
|||
/** | |||
* A call that performs a request to a URL. | |||
* | |||
* Example: An HTTP POST request is client request that sends some |
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.
is a client request
@@ -83,6 +105,10 @@ private class RequestUrlRequest extends CustomClientRequest { | |||
result = url | |||
} | |||
|
|||
override DataFlow::Node getADataNode() { | |||
none() |
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.
These are none()
because they're just GET requests?
/** | ||
* Provides taint tracking configuration for reasoning about files created from untrusted http downloads. | ||
/** | ||
* Provides a taint tracking configuration for reasoning about user-controlled data in 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.
Again, I'd emphasize that it's written to files.
Otherwise it sounds like it's looking for files in the codebase that have "user-controlled data" (which doesn't really make sense).
@@ -478,11 +480,11 @@ module NodeJSLib { | |||
} | |||
|
|||
/** | |||
* A write to the file system using a stream. | |||
* A read from the file system. |
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 change looks wrong. It is indeed a write operation.
@@ -16,10 +16,12 @@ | |||
| **Query** | **Tags** | **Purpose** | | |||
|-----------------------------------------------|------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | |||
| Enabling Node.js integration for Electron web content renderers (`js/enabling-electron-renderer-node-integration`) | security, frameworks/electron, external/cwe/cwe-094 | Highlights Electron web content renderer preferences with Node.js integration enabled, indicating a violation of [CWE-94](https://cwe.mitre.org/data/definitions/94.html). Results are not shown on LGTM by default. | | |||
| File data in outbound remote request | security, external/cwe/cwe-200 | Highligts locations where file data is sent in a remote request. Results are not shown on LGTM by default. | |
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.
Highligts -> Highlights
All comments addressed. |
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.
Thanks! Everything LGTM 👍
Kotlin: Improve error catching and logging
This PR polishes #132, the changes have been discussed here.
Evaluation shows that this polishing did not break performance. I plan on giving the results a brief look later.