Skip to content

security: upgrade parcel-bundler from 1.12.4 to 1.12.5 #3161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 19, 2021
Merged

security: upgrade parcel-bundler from 1.12.4 to 1.12.5 #3161

merged 1 commit into from
Apr 19, 2021

Conversation

jawnsy
Copy link
Contributor

@jawnsy jawnsy commented Apr 18, 2021

Upgrade parcel-bundler due to a transitive dependency on is-svg.
This resolves CVE-2021-28092.

Notes

This issue is not flagged by audit-ci or yarn audit for some reason, but both Dependabot Alerts and Trivy flag this. Yarn

[coder@jawnsy-m code-server]$ yarn why is-svg
=> Found "[email protected]"
info Reasons this module exists
   - "parcel-bundler#cssnano#cssnano-preset-default#postcss-svgo" depends on it
   - Hoisted from "parcel-bundler#cssnano#cssnano-preset-default#postcss-svgo#is-svg"
Done in 0.56s.

Before

[coder@jawnsy-m code-server]$ trivy filesystem .
yarn.lock
=========
Total: 1 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 1, CRITICAL: 0)

+---------+------------------+----------+-------------------+---------------+---------------------------------------+
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION |                 TITLE                 |
+---------+------------------+----------+-------------------+---------------+---------------------------------------+
| is-svg  | CVE-2021-28092   | HIGH     | 3.0.0             | 4.2.2         | nodejs-is-svg: ReDoS                  |
|         |                  |          |                   |               | via malicious string                  |
|         |                  |          |                   |               | -->avd.aquasec.com/nvd/cve-2021-28092 |
+---------+------------------+----------+-------------------+---------------+---------------------------------------+

After

[coder@jawnsy-m code-server]$ trivy filesystem .
yarn.lock
=========
Total: 0 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 0, CRITICAL: 0)

@jawnsy jawnsy self-assigned this Apr 18, 2021
Upgrade parcel-bundler due to a transitive dependency on is-svg.
This resolves CVE-2021-28092.
@jawnsy jawnsy marked this pull request as ready for review April 18, 2021 19:07
@jawnsy jawnsy requested a review from a team as a code owner April 18, 2021 19:07
Comment on lines +283 to 291
"@babel/parser@^7.12.13", "@babel/parser@^7.13.15", "@babel/parser@^7.4.4":
version "7.13.15"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.15.tgz#8e66775fb523599acb6a289e12929fa5ab0954d8"
integrity sha512-b9COtcAlVEQljy/9fbcMHpG+UIW9ReF+gpaxDHTlZd0c6/UU9ng8zdySAW9sRTzpvcdCHn6bUcbuYUgGzLAWVQ==

"@babel/parser@^7.13.10":
version "7.13.13"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.13.tgz#42f03862f4aed50461e543270916b47dd501f0df"
integrity sha512-OhsyMrqygfk5v8HmWwOzlYjJrtLaFhF34MrfG/Z73DgYCI6ojNUTUp2TYbtnjo8PegeJp12eamsNettCQjKjVw==
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking out loud here - is there any reason yarn resolved to both 7.13.13 and 7.13.15?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsjoeio taught me yarn why and it seems to have the hint

[coder@jawnsy-m code-server]$ yarn why @babel/parser
yarn why v1.22.10
[1/4] Why do we have the module "@babel/parser"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "@babel/[email protected]"
info Has been hoisted to "@babel/parser"
info Reasons this module exists
   - Hoisted from "parcel-bundler#@babel#parser"
   - Hoisted from "parcel-bundler#@babel#template#@babel#parser"
   - Hoisted from "parcel-bundler#@babel#core#@babel#parser"
   - Hoisted from "parcel-bundler#@babel#traverse#@babel#parser"
info Disk size without dependencies: "1.54MB"
info Disk size with unique dependencies: "1.54MB"
info Disk size with transitive dependencies: "1.54MB"
info Number of shared dependencies: 0
=> Found "@stylelint/postcss-css-in-js#@babel/[email protected]"
info Reasons this module exists
   - "stylelint#@stylelint#postcss-css-in-js#@babel#core" depends on it
   - Hoisted from "stylelint#@stylelint#postcss-css-in-js#@babel#core#@babel#parser"
info Disk size without dependencies: "1.53MB"
info Disk size with unique dependencies: "1.53MB"
info Disk size with transitive dependencies: "1.53MB"
info Number of shared dependencies: 0
Done in 0.56s.

I did yarn upgrade parcel-bundler and then manually updated the package.json, then ran yarn install to update the lock file -- so I have no clue if this is due to the way that I updated things. I was trying to minimize changes but would be happy to also update stylelint if the duplicate dependency might be a problem here?

Comment on lines +1889 to 1903
browserslist@^4.0.0, browserslist@^4.1.0, browserslist@^4.14.5, browserslist@^4.16.3:
version "4.16.4"
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.4.tgz#7ebf913487f40caf4637b892b268069951c35d58"
integrity sha512-d7rCxYV8I9kj41RH8UKYnvDYCRENUlHRgyXy/Rhr/1BaeLGfiCptEdFE8MIrvGfWbBFNjVYx76SQWvNX1j+/cQ==
dependencies:
caniuse-lite "^1.0.30001208"
colorette "^1.2.2"
electron-to-chromium "^1.3.712"
escalade "^3.1.1"
node-releases "^1.1.71"

browserslist@^4.12.0:
version "4.16.3"
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.3.tgz#340aa46940d7db878748567c5dea24a48ddf3717"
integrity sha512-vIyhWmIkULaq04Gt93txdh+j02yX/JzlyhLYbV3YQCn/zvES3JnY7TifHHvvr1w5hTDluNKMkV05cs4vy8Q7sw==
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar here - there doesn't appear to be any reason to pull two different versions 🤔
I feel like this is a sign of something funny with yarn, but 🤷

@oxy
Copy link

oxy commented Apr 19, 2021

I've asked on the yarn discord about the weird "duplicate" resolutions - I'll let you know when they get back.

Edit: In addition - since its from parcel-bundler -> cssnano -> ... in devDependencies, this isn't a major security concern for any code-server users; its just a nice-to-fix.

I think (though this is only a guess) audit-ci may only be auditing dependencies and not devDependencies.

@scinos
Copy link

scinos commented Apr 19, 2021

You may want to look at https://github.com/atlassian/yarn-deduplicate to solve the duplication

@jawnsy
Copy link
Contributor Author

jawnsy commented Apr 19, 2021

I think (though this is only a guess) audit-ci may only be auditing dependencies and not devDependencies.

@oxy I've seen some weirdness with yarn audit, but the docs say that it defaults to auditing all of them:

--groups <group_name> [<group_name> ...] Only audit dependencies from listed groups. Default: devDependencies, dependencies, optionalDependencies (default: devDependencies,dependencies,optionalDependencies)

And testing with the different groups seems to show different results:

[coder@jawnsy-m code-server]$ yarn audit --level=low 
yarn audit v1.22.10
0 vulnerabilities found - Packages audited: 1263
Done in 1.00s.
[coder@jawnsy-m code-server]$ yarn audit --level=low --groups devDependencies
yarn audit v1.22.10
0 vulnerabilities found - Packages audited: 1147
Done in 1.18s.
[coder@jawnsy-m code-server]$ yarn audit --level=low --groups dependencies
yarn audit v1.22.10
0 vulnerabilities found - Packages audited: 168
Done in 0.95s.
[coder@jawnsy-m code-server]$ yarn audit --level=low --groups optionalDependencies
yarn audit v1.22.10
0 vulnerabilities found - Packages audited: 0
Done in 0.86s.

@jawnsy jawnsy changed the title chore: upgrade parcel-bundler from 1.12.4 to 1.12.5 security: upgrade parcel-bundler from 1.12.4 to 1.12.5 Apr 19, 2021
Copy link

@oxy oxy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I'll see what I can do with deduplicating it in a future PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants