Bump json from 10.0.0 to 11.0.0
Bumps json from 10.0.0 to 11.0.0.
Changelog
Sourced from json's changelog.
11.0.0
Backward incompatible and security-related change to parsing the
-d DELIMoption. (#148)The
-d DELIMoption allows specifying the field delimiter in output:% echo '{"name":"trent","age":38}' | json -a name age trent 38 % echo '{"name":"trent","age":38}' | json -a name age -d, trent,38The given "DELIM" string is parsed to allow escapes. For example:
% echo '{"name":"trent","age":38}' | json -a name age -d'\t' trent 38 % echo '{"name":"trent","age":38}' | json -a name age -d'\n' trent 38Before this change, that parsing used
eval(), which allowed for unintended code execution if an untrusted argument to-dwas provided. The fix for this vulnerability changes to useJSON.parse()to support escapes. However that results in a backward incompatible change, because the set of JSON escapes is a subset of JavaScript escapes.The only escape I expect that would affect any current user would be the null byte escape (
\0) which can be useful for processing values that may have spaces or other likely delimiter characters. For example:# BEFORE % echo '{"title":"Monsters, Inc.","year":"2001"}' \ | json -a title year -d'\0' \ | xargs -0 node -e 'console.log(process.argv)' [ 'node', 'Monsters, Inc.', '2001\n' ]AFTER
% echo '{"title":"Monsters, Inc.","year":"2001"}' | json -a title year -d'\0' json: error: Unexpected number in JSON at position 2
One must now use the JSON unicode escape syntax, '\u0000':
% echo '{"title":"Monsters, Inc.","year":"2001"}' \ | json -a title year -d'\u0000' \ | xargs -0 node -e 'console.log(process.argv)' [ 'node', 'Monsters, Inc.', '2001\n' ]
Commits
e08c86811.0.00672aadfix test suite for new '-d DELIM' tests for node >=124a69ea3doc, fix tests, and improve errors for '-d DELIM' change in #1504114e32Fix Code injection in-d DELIMthrough use of eval (#150)27e1ad7update devDeps to latest version; regen 'json_parse' with latest uglify-js ve...ffeaab4bump semver (#137) and fix tools/perf.js- See full diff in compare view
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
-
@dependabot rebasewill rebase this PR -
@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it -
@dependabot mergewill merge this PR after your CI passes on it -
@dependabot squash and mergewill squash and merge this PR after your CI passes on it -
@dependabot cancel mergewill cancel a previously requested merge and block automerging -
@dependabot reopenwill reopen this PR if it is closed -
@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually -
@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Codecov Report
Merging #755 (d434026) into master (17592f8) will not change coverage. The diff coverage is
n/a.
:exclamation: Current head d434026 differs from pull request most recent head fa83e84. Consider uploading reports for the commit fa83e84 to get more accurate results
@@ Coverage Diff @@
## master #755 +/- ##
=======================================
Coverage 94.36% 94.36%
=======================================
Files 17 17
Lines 550 550
=======================================
Hits 519 519
Misses 31 31
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more