-
Notifications
You must be signed in to change notification settings - Fork 2k
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 #1532 from mattolson/backport-security-fixes
Backport security fixes to 3.x branch
- Loading branch information
Showing
9 changed files
with
102 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
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,37 @@ | ||
# Test against these versions of Node.js | ||
environment: | ||
matrix: | ||
- nodejs_version: "10" | ||
|
||
platform: | ||
- x64 | ||
|
||
# Install scripts (runs after repo cloning) | ||
install: | ||
# Get the latest stable version of Node.js | ||
- ps: Install-Product node $env:nodejs_version $env:platform | ||
# Clone submodules (mustache spec) | ||
- cmd: git submodule update --init --recursive | ||
# Install modules | ||
- cmd: npm install | ||
- cmd: npm install -g grunt-cli | ||
|
||
|
||
# Post-install test scripts | ||
test_script: | ||
# Output useful info for debugging | ||
- cmd: node --version | ||
- cmd: npm --version | ||
# Run tests | ||
- cmd: grunt --stack travis | ||
|
||
# Don't actually build | ||
build: off | ||
|
||
on_failure: | ||
- cmd: 7z a coverage.zip coverage | ||
- cmd: appveyor PushArtifact coverage.zip | ||
|
||
|
||
# Set build version format here instead of in the admin panel | ||
version: "{build}" |
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
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