Skip to content

[security] chore(deps-dev): bump json from 9.0.6 to 11.0.0#277

Open
dependabot-preview[bot] wants to merge 1 commit intodevelopfrom
dependabot/npm_and_yarn/json-11.0.0
Open

[security] chore(deps-dev): bump json from 9.0.6 to 11.0.0#277
dependabot-preview[bot] wants to merge 1 commit intodevelopfrom
dependabot/npm_and_yarn/json-11.0.0

Conversation

@dependabot-preview
Copy link
Contributor

@dependabot-preview dependabot-preview bot commented Apr 28, 2021

Bumps json from 9.0.6 to 11.0.0.

Changelog

Sourced from json's changelog.

11.0.0

  • Backward incompatible and security-related change to parsing the -d DELIM option. (#148)

    The -d DELIM option 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,38
    

    The 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
      38
    

    Before this change, that parsing used eval(), which allowed for unintended code execution if an untrusted argument to -d was provided. The fix for this vulnerability changes to use JSON.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' ]
    

10.0.0

... (truncated)

Commits
  • e08c868 11.0.0
  • 0672aad fix test suite for new '-d DELIM' tests for node >=12
  • 4a69ea3 doc, fix tests, and improve errors for '-d DELIM' change in #150
  • 4114e32 Fix Code injection in -d DELIM through use of eval (#150)
  • 27e1ad7 update devDeps to latest version; regen 'json_parse' with latest uglify-js ve...
  • ffeaab4 bump semver (#137) and fix tools/perf.js
  • cc47981 BREAKING CHANGE: limit syntax for bracketed lookup strings to fix vuln (#145)
  • 8d3cf25 Update README.md
  • See full diff in compare view

Dependabot compatibility score

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 will not automatically merge this PR because it includes an out-of-range update to a development dependency.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will 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 version will 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 dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
  • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot dashboard:

  • Update frequency (including time of day and day of week)
  • Pull request limits (per update run and/or open at any time)
  • Automerge options (never/patch/minor, and dev/runtime dependencies)
  • Out-of-range updates (receive only lockfile updates, if desired)
  • Security updates (receive only security updates, if desired)

@dependabot-preview dependabot-preview bot added the dependencies Pull requests that update a dependency file label Apr 28, 2021
@dependabot-preview
Copy link
Contributor Author

We've just been alerted that this update fixes a security vulnerability:

Sourced from The GitHub Security Advisory Database.

Command injection in json

This affects the package json before 10.0.0. It is possible to inject arbritary commands using the parseLookup function.

Affected versions: ["< 10.0.0"]

@dependabot-preview dependabot-preview bot changed the title chore(deps-dev): bump json from 9.0.6 to 11.0.0 [security] chore(deps-dev): bump json from 9.0.6 to 11.0.0 May 6, 2021
@dependabot-preview dependabot-preview bot added the security Pull requests that address a security vulnerability label May 6, 2021
@dependabot-preview dependabot-preview bot force-pushed the dependabot/npm_and_yarn/json-11.0.0 branch 2 times, most recently from 872715c to b907898 Compare May 31, 2021 10:49
Bumps [json](https://github.com/trentm/json) from 9.0.6 to 11.0.0.
- [Release notes](https://github.com/trentm/json/releases)
- [Changelog](https://github.com/trentm/json/blob/master/CHANGES.md)
- [Commits](trentm/json@9.0.6...11.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
@dependabot-preview dependabot-preview bot force-pushed the dependabot/npm_and_yarn/json-11.0.0 branch from b907898 to ba68efa Compare May 31, 2021 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file security Pull requests that address a security vulnerability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants