fix: [parse-url] Upgrade parse-url from 5.0.1 to 6.0.1 to resolve CVE-2022-2216 - #226
fix: [parse-url] Upgrade parse-url from 5.0.1 to 6.0.1 to resolve CVE-2022-2216#226hannahhuh-cog wants to merge 1 commit into
Conversation
Co-Authored-By: Hannah Huh <hannah.huh@cognition.ai>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| "overrides": { | ||
| "parse-url": "6.0.1" | ||
| } |
There was a problem hiding this comment.
🟡 Lockfile omits overrides, out of sync with manifest
The new overrides block is not recorded in the regenerated lockfile's root packages[""] entry, which npm requires. The manifest and lockfile are out of sync, so npm ci fails with EUSAGE.
Prompt for agents
package.json now declares an overrides block (parse-url: 6.0.1), but the committed package-lock.json's root package entry (packages[""]) does not include a corresponding overrides field. In lockfileVersion 2/3, npm records the overrides object in the root of package-lock.json, and npm ci verifies the two files agree. Because the lockfile lacks the overrides marker, npm ci will error that package.json and package-lock.json are out of sync. Regenerate the lockfile with a modern npm (npm install, not a partial edit) so that the overrides object is written into package-lock.json's packages[""] entry, and commit the result.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Verified locally — npm ci is not broken by this.
I regenerated the lockfile with npm install --package-lock-only on npm 10.8.2. This repo's lockfile is lockfileVersion: 2 (hybrid v1/v2), and npm did not write an overrides key into packages[""] — but it did resolve the overridden version in the tree, and npm only enforces the overrides-sync check when the lockfile records one.
Evidence, from a clean checkout of just package.json + package-lock.json on this branch:
$ npm ci --ignore-scripts
added 947 packages in 5s
$ node -e "console.log(require('parse-url/package.json').version)"
6.0.1
No EUSAGE error. Leaving the lockfile as npm generated it.
| "overrides": { | ||
| "parse-url": "6.0.1" | ||
| } |
There was a problem hiding this comment.
Summary
Fixes Server-Side Request Forgery in
parse-url, reported by the scheduled Snyk MCP scan.SNYK-JS-PARSEURL-2936249parse-url@5.0.1(transitive)>=6.0.1; pinned to6.0.1parse-urlis transitive, so the fix is an npmoverridesentry:package-lock.jsonregenerated withnpm install --package-lock-only; resolvednode_modules/parse-urlis now6.0.1.Snyk scan reference:
snyk test --all-projects --dev/snyk_sca_scan(unmanaged: true), Snyk org9e26acce-22c7-4efc-b470-21d9587f49fe.Devin-Org: engineering
Link to Devin session: https://app.devin.ai/sessions/fc1965e7d98f4966bea1c7aa64a929b0
Requested by: @hannahhuh-cog
Devin Review