Skip to content

Conversation

ghost
Copy link

@ghost ghost commented Oct 10, 2018

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.

@ghost ghost added the JS label Oct 10, 2018
@ghost ghost self-requested a review as a code owner October 10, 2018 10:20
Copy link
Contributor

@asger-semmle asger-semmle left a 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
Copy link
Contributor

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
Copy link
Contributor

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()
Copy link
Contributor

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.
Copy link
Contributor

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.
Copy link
Contributor

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. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Highligts -> Highlights

@ghost
Copy link
Author

ghost commented Oct 10, 2018

All comments addressed.

Copy link
Contributor

@asger-semmle asger-semmle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Everything LGTM 👍

@semmle-qlci semmle-qlci merged commit 6a03bd8 into github:master Oct 11, 2018
aibaars pushed a commit that referenced this pull request Oct 14, 2021
smowton pushed a commit to smowton/codeql that referenced this pull request Apr 16, 2022
Kotlin: Improve error catching and logging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants