Skip to content

Commit 7782448

Browse files
committed
JS: Normalize whitespace
1 parent fd9765b commit 7782448

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

javascript/ql/src/Security/CWE-400/PrototypePollution.qhelp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,38 @@
44
<qhelp>
55

66
<overview>
7-
<p>
7+
<p>
88
Most JavaScript objects inherit the properties of the built-in <code>Object.prototype</code> object.
99
If an attacker is be able to modify <code>Object.prototype</code>, they can tamper with the
1010
application logic and often escalate to remote code execution or cross-site scripting.
11-
</p>
11+
</p>
1212

13-
<p>
13+
<p>
1414
One way to cause prototype pollution is through use of an unsafe <em>merge</em> or <em>extend</em> function
1515
to recursively copy properties from an untrusted source object.
1616
Such a call can modify any object reachable from the destination object, and
1717
the built-in <code>Object.prototype</code> is usually reachable through the special properties
1818
<code>__proto__</code> and <code>constructor.prototype</code>.
1919
An attacker can abuse this by sending an object with these property names and thereby modify <code>Object.prototype</code>.
20-
</p>
20+
</p>
2121
</overview>
2222

2323
<recommendation>
24-
<p>
24+
<p>
2525
Update your library dependencies in order to use a safe version of the <em>merge</em> or <em>extend</em> function.
2626
If you library has no fixed version, switch to another library.
27-
</p>
27+
</p>
2828
</recommendation>
2929

3030
<example>
31-
<p>
31+
<p>
3232
In the example below, the untrusted value <code>req.query.prefs</code> is parsed as JSON
3333
and then copied into a new object:
34-
</p>
34+
</p>
3535

3636
<sample src="examples/PrototypePollution1.js"/>
3737

38-
<p>
38+
<p>
3939
Prior to lodash 4.17.11 this would be vulnerable to prototype pollution. An attacker could send
4040
the value <code>{"constructor": {"prototype": {"xxx": true}}}</code> to inject <code>xxx</code>
4141
in <code>Object.prototype</code>.
@@ -55,15 +55,15 @@
5555
</example>
5656

5757
<references>
58-
<li>Prototype pollution attacks:
59-
<a href="https://hackerone.com/reports/380873">lodash</a>,
58+
<li>Prototype pollution attacks:
59+
<a href="https://hackerone.com/reports/380873">lodash</a>,
6060
<a href="https://hackerone.com/reports/454365">jQuery</a>,
6161
<a href="https://hackerone.com/reports/381185">extend</a>,
6262
<a href="https://hackerone.com/reports/430291">just-extend</a>,
6363
<a href="https://hackerone.com/reports/381194">merge.recursive</a>,
64-
</li>
65-
<li>Express:
66-
<a href="https://expressjs.com/en/api.html#express.urlencoded">urlencoded()</a>
67-
</li>
64+
</li>
65+
<li>Express:
66+
<a href="https://expressjs.com/en/api.html#express.urlencoded">urlencoded()</a>
67+
</li>
6868
</references>
6969
</qhelp>

0 commit comments

Comments
 (0)