fix: check prototype property access in strict-mode (#1736)

This commit is contained in:
Nils Knappmeier
2021-02-13 13:41:40 +01:00
parent f058970169
commit b6d3de7123
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -124,7 +124,7 @@ export function template(templateSpec, env) {
loc: loc
});
}
return obj[name];
return container.lookupProperty(obj, name);
},
lookupProperty: function(parent, propertyName) {
let result = parent[propertyName];
+4
View File
@@ -298,6 +298,10 @@ describe('security issues', function() {
checkProtoPropertyAccess({ compat: true });
});
describe('in strict-mode', function() {
checkProtoPropertyAccess({ strict: true });
});
function checkProtoPropertyAccess(compileOptions) {
it('should be prohibited by default and log a warning', function() {
var spy = sinon.spy(console, 'error');