Skip to content

Commit c627e38

Browse files
committed
Mention CVE-2021-23358 in code, test and documentation (#2915)
1 parent c9e803e commit c627e38

File tree

7 files changed

+10
-6
lines changed

7 files changed

+10
-6
lines changed

docs/modules/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ <h1>template.js</h1>
10131013
<div class="pilwrap ">
10141014
<a class="pilcrow" href="#section-9">&#182;</a>
10151015
</div>
1016-
<p>Insure against third-party code injection.</p>
1016+
<p>Insure against third-party code injection. (CVE-2021-23358)</p>
10171017

10181018
</div>
10191019

docs/underscore-esm.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2496,7 +2496,7 @@ <h1>underscore-esm.js</h1>
24962496
<div class="pilwrap ">
24972497
<a class="pilcrow" href="#section-129">&#182;</a>
24982498
</div>
2499-
<p>Insure against third-party code injection.</p>
2499+
<p>Insure against third-party code injection. (CVE-2021-23358)</p>
25002500

25012501
</div>
25022502

index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2714,7 +2714,9 @@ <h2 id="changelog">Change Log</h2>
27142714
affects all versions of Underscore between 1.3.2 and 1.12.0,
27152715
inclusive, as well as preview releases 1.13.0-0 and 1.13.0-1. The
27162716
fix in this release is also included in the parallel preview
2717-
release 1.13.0-2.
2717+
release 1.13.0-2. <a
2718+
href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-23358"
2719+
>CVE-2021-23358</a>
27182720
</li>
27192721
<li>
27202722
Restores an optimization in <tt>_.debounce</tt> that was

modules/template.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default function template(text, settings, oldSettings) {
6868

6969
var argument = settings.variable;
7070
if (argument) {
71-
// Insure against third-party code injection.
71+
// Insure against third-party code injection. (CVE-2021-23358)
7272
if (!bareIdentifier.test(argument)) throw new Error(
7373
'variable is not a bare identifier: ' + argument
7474
);

test/utility.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,11 @@
468468
QUnit.test('#2911 - _.templateSettings.variable must not allow third parties to inject code.', function(assert) {
469469
QUnit.holyProperty = 'holy';
470470
var invalidVariableNames = [
471+
// CVE-2021-23337 (not applicable to Underscore)
471472
'){delete QUnit.holyProperty}; with(obj',
472473
'(x = QUnit.holyProperty = "evil"), obj',
473474
'document.write("got you!")',
475+
// CVE-2021-23358 (our actual security leak, which we fixed)
474476
'a = (function() { delete QUnit.holyProperty; }())',
475477
'a = (QUnit.holyProperty = "evil")',
476478
'a = document.write("got you!")'

underscore-esm.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

underscore.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)