Skip to content

JS: Add query to detect sensitive information flowing into compiled artifact#3661

Merged
semmle-qlci merged 14 commits into
github:js-team-sprintfrom
erik-krogh:build-leaks
Jun 18, 2020
Merged

JS: Add query to detect sensitive information flowing into compiled artifact#3661
semmle-qlci merged 14 commits into
github:js-team-sprintfrom
erik-krogh:build-leaks

Conversation

@erik-krogh
Copy link
Copy Markdown
Contributor

@erik-krogh erik-krogh commented Jun 9, 2020

CVE status:
CVE-2020-11059: TP/TN
CVE-2017-16225: TP/TP

Adds a query that detects sensitive information flowing to webpack.DefinePlugin().
This sensitive information ends up being part of the compiled JavaScript file.

Example TP.

Any naming suggestions are very welcome, I'm not impressed by my own naming.

TODO (post sprint):

  • find more similar sinks (I looked around, and didn't find other sinks with the same risk of information exposure)
  • add tests for query
  • change note
  • qhelp
  • FP and performance evaluation

@erik-krogh erik-krogh added the JS label Jun 9, 2020
@erik-krogh erik-krogh requested a review from a team June 9, 2020 15:25
@erik-krogh erik-krogh requested a review from mchammer01 as a code owner June 9, 2020 15:25
@erik-krogh erik-krogh removed the request for review from mchammer01 June 9, 2020 15:25
Copy link
Copy Markdown
Contributor

@asgerf asgerf left a comment

Choose a reason for hiding this comment

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

👍

Comment thread javascript/ql/src/semmle/javascript/Arrays.qll Outdated
Comment thread javascript/ql/src/Security/CWE-312/BuildArtifactLeak.ql Outdated
erik-krogh and others added 2 commits June 9, 2020 20:02
Co-authored-by: Asger F <asgerf@github.com>
@erik-krogh erik-krogh requested a review from asgerf June 10, 2020 07:18
@erik-krogh erik-krogh marked this pull request as draft June 15, 2020 11:05
@erik-krogh erik-krogh marked this pull request as ready for review June 15, 2020 14:49
@erik-krogh erik-krogh requested a review from a team June 15, 2020 14:49
Copy link
Copy Markdown
Contributor

@asgerf asgerf left a comment

Choose a reason for hiding this comment

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

Just a few minor things, otherwise LGTM 👍

Comment thread javascript/ql/src/Security/CWE-312/BuildArtifactLeak.qhelp Outdated
Comment thread javascript/ql/src/semmle/javascript/security/dataflow/BuildArtifactLeak.qll Outdated
Co-authored-by: Asger F <asgerf@github.com>
Copy link
Copy Markdown
Contributor

@asgerf asgerf left a comment

Choose a reason for hiding this comment

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

LGTM

@mchammer01 request for doc review

Copy link
Copy Markdown
Contributor

@mchammer01 mchammer01 left a comment

Choose a reason for hiding this comment

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

@erik-krogh - this is looking great, just a tiny comment ✨

<sample src="examples/build-leak-fixed.js"/>
</example>
<references>
<li>webpack: <a href="https://webpack.js.org/plugins/define-plugin/">DefinePlugin API</a></li>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Missing full stop at the end of this bullet point

@semmle-qlci semmle-qlci merged commit 20e9679 into github:js-team-sprint Jun 18, 2020
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.

4 participants