Prevent command injection through _.template's variable option

Closes #5085.
This commit is contained in:
Christophe Coevoet
2021-02-17 12:33:19 +01:00
committed by Benjamin Tan
parent ded9bc6658
commit 3469357cff
2 changed files with 28 additions and 1 deletions

View File

@@ -22296,6 +22296,14 @@
}
});
QUnit.test('should forbid code injection through the "variable" options', function(assert) {
assert.expect(1);
assert.raises(function () {
_.template('', { 'variable': '){console.log(process.env)}; with(obj' });
});
});
QUnit.test('should support custom delimiters', function(assert) {
assert.expect(2);