|
2 | 2 | "-//Semmle//qhelp//EN"
|
3 | 3 | "qhelp.dtd">
|
4 | 4 | <qhelp>
|
| 5 | + |
5 | 6 | <overview>
|
6 |
| -<p>Using an insecure protocol like HTTP or FTP to download your dependencies leaves your npm build vulnerable to a |
7 |
| -<a href="https://en.wikipedia.org/wiki/Man-in-the-middle_attack">Man in the Middle (MITM)</a>. |
8 |
| -This can allow attackers to inject malicious code into the artifacts that you are resolving and infect build artifacts |
9 |
| -that are being produced. This can be used by attackers to perform a |
10 |
| -<a href="https://en.wikipedia.org/wiki/Supply_chain_attack">Supply chain attack</a> |
11 |
| -against your project's users. |
| 7 | +<p> |
| 8 | +Using an insecure protocol like HTTP or FTP to download build dependencies makes the build process vulnerable to a |
| 9 | +Man in the Middle (MITM) attack. |
| 10 | +</p> |
| 11 | +<p> |
| 12 | +This can allow attackers to inject malicious code into the downloaded dependencies and thereby |
| 13 | +infect the build artifacts and execute arbitrary code on the machine building the artifacts. |
12 | 14 | </p>
|
13 | 15 |
|
14 | 16 | </overview>
|
15 | 17 | <recommendation>
|
16 | 18 |
|
17 |
| -<p>Always use HTTPS or SFTP to download artifacts from artifact servers.</p> |
| 19 | +<p>Always use HTTPS or SFTP when downloading artifacts from an URL.</p> |
18 | 20 |
|
19 | 21 | </recommendation>
|
20 | 22 |
|
| 23 | +<example> |
| 24 | +<p> |
| 25 | +The below example shows a <code>package.json</code> file that downloads a dependency using unencrypted HTTP. |
| 26 | +</p> |
| 27 | +<sample src="examples/bad-package.json" /> |
| 28 | +<p> |
| 29 | +The fix is to change the protocol to HTTPS. |
| 30 | +</p> |
| 31 | +<sample src="examples/good-package.json" /> |
| 32 | + |
| 33 | +</example> |
| 34 | + |
21 | 35 | <references>
|
22 | 36 | <li>
|
23 |
| - Research: |
24 |
| - <a href="https://medium.com/bugbountywriteup/want-to-take-over-the-java-ecosystem-all-you-need-is-a-mitm-1fc329d898fb?source=friends_link&sk=3c99970c55a899ad9ef41f126efcde0e"> |
| 37 | + Jonathan Leitschuh: |
| 38 | + <a href="https://infosecwriteups.com/want-to-take-over-the-java-ecosystem-all-you-need-is-a-mitm-1fc329d898fb"> |
25 | 39 | Want to take over the Java ecosystem? All you need is a MITM!
|
26 | 40 | </a>
|
27 | 41 | </li>
|
28 | 42 | <li>
|
29 |
| - Research: |
| 43 | + Max Veytsman: |
30 | 44 | <a href="https://max.computer/blog/how-to-take-over-the-computer-of-any-java-or-clojure-or-scala-developer/">
|
31 | 45 | How to take over the computer of any Java (or Closure or Scala) Developer.
|
32 | 46 | </a>
|
33 | 47 | </li>
|
| 48 | +<li> |
| 49 | + Wikipedia: <a href="https://en.wikipedia.org/wiki/Supply_chain_attack">Supply chain attack</a> |
| 50 | +</li> |
| 51 | +<li> |
| 52 | + Wikipedia: <a href="https://en.wikipedia.org/wiki/Man-in-the-middle_attack">Man-in-the-middle attack</a> |
| 53 | +</li> |
34 | 54 | </references>
|
35 | 55 | </qhelp>
|
0 commit comments