Skip to content

Commit b6d3de7

Browse files
committed
fix: check prototype property access in strict-mode (#1736)
1 parent f058970 commit b6d3de7

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/handlebars/runtime.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export function template(templateSpec, env) {
124124
loc: loc
125125
});
126126
}
127-
return obj[name];
127+
return container.lookupProperty(obj, name);
128128
},
129129
lookupProperty: function(parent, propertyName) {
130130
let result = parent[propertyName];

spec/security.js

+4
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,10 @@ describe('security issues', function() {
298298
checkProtoPropertyAccess({ compat: true });
299299
});
300300

301+
describe('in strict-mode', function() {
302+
checkProtoPropertyAccess({ strict: true });
303+
});
304+
301305
function checkProtoPropertyAccess(compileOptions) {
302306
it('should be prohibited by default and log a warning', function() {
303307
var spy = sinon.spy(console, 'error');

0 commit comments

Comments
 (0)