mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
Prevent command injection through _.template's variable option
Closes #5085.
This commit is contained in:
committed by
Benjamin Tan
parent
ded9bc6658
commit
3469357cff
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user