-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added security tests, changed to yarn, bump version
- Loading branch information
1 parent
65d0843
commit ef376d4
Showing
6 changed files
with
519 additions
and
215 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
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,20 @@ | ||
var assert = require('assert'); | ||
var ConnieLang = require('../'); | ||
|
||
describe('ConnieLang', function () { | ||
it('should not allow prototype pollution at the top level', function () { | ||
var obj = Object.create(null); | ||
obj['__proto__'] = { polluted: true }; | ||
var config = ConnieLang.parse(obj); | ||
assert.deepEqual(config, {}); | ||
assert.equal(Object.polluted, undefined); | ||
}); | ||
|
||
it('should not allow prototype pollution at a nested level', function () { | ||
var obj = Object.create(null); | ||
obj['__proto__'] = { polluted: true }; | ||
var config = ConnieLang.parse({ foo: obj }); | ||
assert.deepEqual(config, {}); | ||
assert.equal(Object.polluted, undefined); | ||
}); | ||
}); |
Oops, something went wrong.