forked from handlebars-lang/handlebars.js
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from mattolson/backport-rce-fix
STRF-6929: Backport fixes to Handlebars 3.x
- Loading branch information
Showing
9 changed files
with
74 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "handlebars", | ||
"version": "3.0.6", | ||
"version": "3.1.0", | ||
"main": "handlebars.js", | ||
"dependencies": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
describe('security issues', function() { | ||
describe('GH-1495: Prevent Remote Code Execution via constructor', function() { | ||
it('should not allow constructors to be accessed', function() { | ||
shouldCompileTo('{{constructor.name}}', {}, ''); | ||
shouldCompileTo('{{lookup (lookup this "constructor") "name"}}', {}, ''); | ||
}); | ||
|
||
it('should allow the "constructor" property to be accessed if it is enumerable', function() { | ||
shouldCompileTo('{{constructor.name}}', {'constructor': { | ||
'name': 'here we go' | ||
}}, 'here we go'); | ||
shouldCompileTo('{{lookup (lookup this "constructor") "name"}}', {'constructor': { | ||
'name': 'here we go' | ||
}}, 'here we go'); | ||
}); | ||
|
||
it('should allow prototype properties that are not constructors', function() { | ||
function TestClass() { | ||
} | ||
|
||
Object.defineProperty(TestClass.prototype, 'abc', { | ||
get: function() { | ||
return 'xyz'; | ||
} | ||
}); | ||
|
||
shouldCompileTo('{{#with this}}{{this.abc}}{{/with}}', | ||
new TestClass(), 'xyz'); | ||
shouldCompileTo('{{#with this}}{{lookup this "abc"}}{{/with}}', | ||
new TestClass(), 'xyz'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters