-
Notifications
You must be signed in to change notification settings - Fork 13
fix: patch critical vulnerabilities (simple-git, property-expr, minimist, form-data) #25
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| # Critical Vulnerabilities Mitigation Log | ||
|
|
||
| This document lists all **critical severity vulnerabilities** in the project and the steps taken to mitigate them. | ||
|
|
||
| --- | ||
|
|
||
| ## 1. Remote Code Execution in `simple-git` | ||
|
|
||
| - **Package:** simple-git | ||
| - **Current Version:** <3.16.0 | ||
| - **Patched Version:** >=3.16.0 | ||
| - **Dependency Path:** react-floki > lint-staged > g-status > simple-git | ||
| - **CVE / Advisory:** [NPM Advisory 1103707](https://www.npmjs.com/advisories/1103707) | ||
aman-wednesdaysol marked this conversation as resolved.
Show resolved
Hide resolved
aman-wednesdaysol marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - **Description:** Remote Code Execution (RCE) vulnerability allowing malicious commands to execute if untrusted input reaches `simple-git`. | ||
| - **Mitigation:** Upgrade `simple-git` to version >=3.16.0 via Yarn resolutions or direct dependency update. | ||
|
|
||
| --- | ||
|
|
||
| ## 2. Prototype Pollution in `property-expr` | ||
|
|
||
| - **Package:** property-expr | ||
| - **Current Version:** <2.0.3 | ||
| - **Patched Version:** >=2.0.3 | ||
| - **Dependency Path:** react-floki > lint-staged > yup > property-expr | ||
| - **CVE / Advisory:** [NPM Advisory 1089042](https://www.npmjs.com/advisories/1089042) | ||
| - **Description:** Prototype pollution vulnerability allowing attackers to modify object prototypes, potentially leading to arbitrary code execution. | ||
| - **Mitigation:** Upgrade `property-expr` to version >=2.0.3 via Yarn resolutions. | ||
|
|
||
| --- | ||
|
|
||
| ## 3. Prototype Pollution in `minimist` | ||
|
|
||
| - **Package:** minimist | ||
| - **Current Version:** <1.2.6 | ||
| - **Patched Version:** >=1.2.6 | ||
| - **Dependency Path:** react-floki > minimist | ||
| - **CVE / Advisory:** [NPM Advisory 1097678](https://www.npmjs.com/advisories/1097678) | ||
| - **Description:** Prototype pollution vulnerability in argument parsing. May allow attackers to override object properties. | ||
| - **Mitigation:** Upgrade `minimist` to version >=1.2.6 via Yarn resolutions. | ||
|
|
||
| --- | ||
|
|
||
| ## 4. Unsafe Random Function in `form-data` (coveralls path) | ||
|
|
||
| - **Package:** form-data | ||
| - **Current Version:** <2.5.4 | ||
| - **Patched Version:** >=2.5.4 | ||
aman-wednesdaysol marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - **Dependency Path:** coveralls > request > form-data | ||
| - **CVE / Advisory:** [NPM Advisory 1109540](https://www.npmjs.com/advisories/1109540) | ||
| - **Description:** `form-data` uses an unsafe random function for generating multipart boundaries, potentially allowing collisions or predictable boundaries. | ||
| - **Mitigation:** Upgrade `form-data` to version >=2.5.4 via Yarn resolutions. | ||
|
|
||
| --- | ||
|
|
||
| ## 5. Unsafe Random Function in `form-data` (react-floki path) | ||
|
|
||
| - **Package:** form-data | ||
| - **Current Version:** <2.5.4 | ||
| - **Patched Version:** >=2.5.4 | ||
| - **Dependency Path:** react-floki > coveralls > request > form-data | ||
| - **CVE / Advisory:** [NPM Advisory 1109540](https://www.npmjs.com/advisories/1109540) | ||
| - **Description:** Same as above; appears via a different dependency path. | ||
| - **Mitigation:** Upgrade `form-data` to version >=2.5.4 via Yarn resolutions. | ||
|
|
||
| --- | ||
|
|
||
| ## Summary of Actions | ||
|
|
||
| - Added **Yarn resolutions** for all critical packages: | ||
|
|
||
| ```json | ||
| { | ||
| "resolutions": { | ||
| "simple-git": ">=3.16.0", | ||
| "property-expr": ">=2.0.3", | ||
| "minimist": ">=1.2.6", | ||
| "form-data": ">=2.5.4" | ||
| } | ||
| } | ||
aman-wednesdaysol marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,13 +47,14 @@ | |
| "@formatjs/intl-utils": "^3.8.4", | ||
| "@webcomponents/shadydom": "^1.11.0", | ||
| "antd": "^5.20.5", | ||
| "apisauce": "^2.1.6", | ||
| "apisauce": "^3.2.2", | ||
| "axios": "^1.13.5", | ||
| "env-cmd": "^10.1.0", | ||
| "hoist-non-react-statics": "^3.3.2", | ||
| "immer": "^9.0.21", | ||
| "invariant": "^2.2.4", | ||
| "lodash": "^4.17.21", | ||
| "next": "14.2.8", | ||
| "next": "14.2.35", | ||
| "next-images": "^1.8.5", | ||
| "next-redux-wrapper": "^8.1.0", | ||
| "prop-types": "^15.8.1", | ||
|
|
@@ -68,6 +69,7 @@ | |
| "styled-components": "^6.1.13" | ||
| }, | ||
| "devDependencies": { | ||
| "coveralls": "^3.1.1", | ||
| "@babel/core": "7.25.2", | ||
| "@babel/preset-env": "^7.25.4", | ||
| "@babel/preset-react": "^7.24.7", | ||
|
|
@@ -87,7 +89,7 @@ | |
| "babel-jest": "^29.7.0", | ||
| "babel-plugin-styled-components": "^2.1.4", | ||
| "eslint": "^9.9.1", | ||
| "eslint-config-next": "14.2.8", | ||
| "eslint-config-next": "^16.1.6", | ||
| "eslint-config-prettier": "^9.1.0", | ||
| "eslint-config-prettier-standard": "^4.0.1", | ||
| "eslint-config-standard": "^17.1.0", | ||
|
|
@@ -103,7 +105,7 @@ | |
| "jest-cli": "29.7.0", | ||
| "jest-environment-jsdom": "^29.7.0", | ||
| "jest-styled-components": "^7.2.0", | ||
| "lint-staged": "^15.2.10", | ||
| "lint-staged": "^16.2.7", | ||
| "next-transpile-modules": "^10.0.1", | ||
| "postcss": "8.4.45", | ||
| "postcss-scss": "4.0.9", | ||
|
|
@@ -118,5 +120,16 @@ | |
| "stylelint-config-recommended": "^14.0.1", | ||
| "stylelint-config-standard-scss": "^13.1.0", | ||
| "stylelint-config-styled-components": "^0.1.1" | ||
| }, | ||
| "resolutions": { | ||
| "simple-git": ">=3.16.0", | ||
| "property-expr": ">=2.0.3", | ||
| "minimist": ">=1.2.6", | ||
| "form-data": ">=2.5.4", | ||
| "next": ">=15.0.8", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: cat -n package.json | sed -n '50,60p; 120,135p'Repository: wednesday-solutions/nextjs-template Length of output: 986 🌐 Web query:
💡 Result: Key breaking changes in Next.js 15 vs 14 (per the official upgrade guide / release notes):
Sources: 🏁 Script executed: #!/bin/bash
# Check if these specific versions exist in npm registry
# Query npm for next.js 14.2.35 and other versions
npm view next@14.2.35 version 2>/dev/null || echo "next@14.2.35 NOT FOUND"
npm view next@15.0.8 version 2>/dev/null || echo "next@15.0.8 NOT FOUND"
npm view json@10.0.0 version 2>/dev/null || echo "json@10.0.0 NOT FOUND"
npm view lint-staged@16.2.7 version 2>/dev/null || echo "lint-staged@16.2.7 NOT FOUND"
npm view eslint-config-next@16.1.6 version 2>/dev/null || echo "eslint-config-next@16.1.6 NOT FOUND"Repository: wednesday-solutions/nextjs-template Length of output: 114 🌐 Web query:
💡 Result:
Security note: versions < 11.0.0 are reported vulnerable to arbitrary code injection via the Sources: [1] npm package page for
Yarn resolutions override all dependency versions globally. This forces a major version upgrade to Next.js 15, which introduces significant breaking changes: React 19 becomes required, async Request APIs ( Additionally, the Finally, lines 129–133 use 2-space indentation while lines 125–128 use 4-space indentation. Standardize to 4 spaces for consistency. 🤖 Prompt for AI Agents |
||
| "json": ">=10.0.0", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: cd . && find . -name 'yarn.lock' -o -name 'package.json' | head -20Repository: wednesday-solutions/nextjs-template Length of output: 105 🏁 Script executed: cat -n package.json | sed -n '120,140p'Repository: wednesday-solutions/nextjs-template Length of output: 598 🏁 Script executed: if [ -f yarn.lock ]; then grep -A 2 -B 2 '"json@' yarn.lock | head -30; fiRepository: wednesday-solutions/nextjs-template Length of output: 61 🏁 Script executed: grep -i '"json' yarn.lock | head -20Repository: wednesday-solutions/nextjs-template Length of output: 61 🏁 Script executed: cat -n package.json | sed -n '1,123p' | grep -i jsonRepository: wednesday-solutions/nextjs-template Length of output: 101 🏁 Script executed: # Check package.json for direct "json" dependency
cat package.json | jq '.dependencies.json, .devDependencies.json, .peerDependencies.json' 2>/dev/null || echo "Check manually"Repository: wednesday-solutions/nextjs-template Length of output: 93 🏁 Script executed: # Check if there are any other json-like packages in yarn.lock
grep -o '"[^"]*json[^"]*@' yarn.lock | sort -u | head -20Repository: wednesday-solutions/nextjs-template Length of output: 209 🏁 Script executed: # Check the complete resolutions section and look for context
cat -n package.json | sed -n '124,135p'Repository: wednesday-solutions/nextjs-template Length of output: 418 Remove the orphaned No dependency in yarn.lock actually pulls in a package named 🤖 Prompt for AI Agents |
||
| "braces": ">=3.0.3", | ||
| "cross-spawn": ">=6.0.6", | ||
| "qs": ">=6.14.1" | ||
| } | ||
|
Comment on lines
+124
to
134
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistent indentation in the Lines 125–128 use 4-space indentation, while lines 129–133 drop to 2-space indentation. This is cosmetically inconsistent and suggests a merge or copy-paste error. It also correlates with the entries that look like scope creep (the non-critical-vuln resolutions). Proposed fix "resolutions": {
"simple-git": ">=3.16.0",
"property-expr": ">=2.0.3",
"minimist": ">=1.2.6",
"form-data": ">=2.5.4",
- "next": ">=15.0.8",
- "json": ">=10.0.0",
- "braces": ">=3.0.3",
- "cross-spawn": ">=6.0.6",
- "qs": ">=6.14.1"
+ "next": ">=15.0.8",
+ "json": ">=10.0.0",
+ "braces": ">=3.0.3",
+ "cross-spawn": ">=6.0.6",
+ "qs": ">=6.14.1"
}🤖 Prompt for AI Agents |
||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.