-
Notifications
You must be signed in to change notification settings - Fork 32
Fix 13 CVE vulnerabilities by upgrading npm dependencies #1564
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
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 |
|---|---|---|
|
|
@@ -134,15 +134,19 @@ | |
| "path-to-regexp": "0.1.10", | ||
| "express": "^4.19.2", | ||
| "form-data": "^3.0.4", | ||
| "fast-uri": "^4.1.3", | ||
| "fast-uri": "^4.1.4", | ||
| "js-yaml": "^5.4.1", | ||
| "browserslist": "^4.28.9", | ||
| "postcss": "^8.5.28", | ||
| "qs": "^6.16.0", | ||
| "webpack-dev-middleware": "^8.3.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. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
yarn why webpack-dev-middleware
rg -n --hidden \
-g '!node_modules/**' \
-g '!yarn.lock' \
'webpack-dev-middleware|getFilenameFromUrl|webpack-dev-server' .
rg -n --hidden \
-g 'package.json' \
-g '.nvmrc' \
-g '.node-version' \
-g '.tool-versions' \
-g 'Dockerfile*' \
-g '*.yml' \
-g '*.yaml' \
'"node"|"webpack"|node-version|FROM node:' .Repository: migtools/mig-ui Length of output: 50371 🤖 get_repo_knowledge executed:
Length of output: 2053 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '--- package.json relevant sections ---'
sed -n '1,90p;130,155p' package.json
printf '%s\n' '--- lockfile package records ---'
rg -n -A18 -B4 \
'webpack-dev-middleware@|webpack-dev-server@|webpack@npm:' \
yarn.lock | head -240
printf '%s\n' '--- tracked source/config references (excluding vendored Yarn) ---'
git grep -n -E \
'webpack-dev-middleware|getFilenameFromUrl|webpack-dev-server|webpack[^[:alnum:]_-]' \
-- ':!/.yarn/releases/*' ':!yarn.lock' || true
printf '%s\n' '--- tracked runtime/toolchain declarations ---'
git grep -n -E \
'"engines"|"node"|"webpack"|node-version|FROM[[:space:]]+node:' \
-- 'package.json' '.nvmrc' '.node-version' '.tool-versions' 'Dockerfile*' '*.yml' '*.yaml' || trueRepository: migtools/mig-ui Length of output: 8790 🌐 Web query:
💡 Result: In webpack-dev-middleware version 8.3.0, the minimum supported version of webpack is 5.101.0 [1][2][3]. Regarding the getFilenameFromUrl method, it is designed as an asynchronous API that returns a Promise [4]. According to official documentation, the method should be used with.then and.catch syntax (or async/await) to handle the returned Promise [4]. Example usage: const instance = middleware(compiler); instance.getFilenameFromUrl("/bundle.js").then((filename) => { if (filename) { console.log( Citations:
🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '--- webpack-dev-middleware@8.3.0 package metadata ---'
curl -fsSL https://registry.npmjs.org/webpack-dev-middleware/8.3.0 |
python3 -c 'import json,sys; d=json.load(sys.stdin); print(json.dumps({"version": d.get("version"), "engines": d.get("engines"), "peerDependencies": d.get("peerDependencies")}, indent=2, sort_keys=True))'
printf '%s\n' '--- CI Node declaration ---'
sed -n '10,24p' .github/workflows/ci.yaml
printf '%s\n' '--- development-server integration ---'
sed -n '1,75p' config/webpack.dev.jsRepository: migtools/mig-ui Length of output: 3086 Align the development-server toolchain with
🤖 Prompt for AI Agents |
||
| "connected-react-router/immutable": "^4.3.8", | ||
| "sass/immutable": "^5.1.5", | ||
| "jsdom/ws": "^7.5.11", | ||
| "webpack-bundle-analyzer/ws": "^7.5.11", | ||
| "webpack-dev-server/ws": "^8.21.0", | ||
| "ip-address": "^10.7.0", | ||
| "tar": "^7.5.22", | ||
| "js-yaml": "^5.4.1" | ||
| "tar": "^7.5.22" | ||
| }, | ||
| "packageManager": "yarn@3.6.4", | ||
| "directories": { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: migtools/mig-ui
Length of output: 50371
🤖 get_repo_knowledge executed:
get_repo_knowledge migtools/mig-ui /tmp/coderabbit-repo-knowledge/migtools-mig-ui-6712a33e/architectureLength of output: 2053
🏁 Script executed:
Repository: migtools/mig-ui
Length of output: 7317
🌐 Web query:
official js-yaml v5.4.1 migration v4 v5 safeLoad safeDump compatibility💡 Result:
In js-yaml v5, the formerly deprecated safeLoad, safeLoadAll, and safeDump functions have been completely removed [1][2]. These functions were effectively synonymous with load, loadAll, and dump in v4, and they continue to serve the same purpose in v5 [3]. Key migration and compatibility notes for moving to v5: 1. API Changes: The library has shifted to a flat, named-export model [1][3]. You should now import load and dump directly (e.g., import { load, dump } from 'js-yaml') rather than relying on a default export [3][4]. For legacy compatibility, you can use namespace imports (import * as yaml from 'js-yaml') to access yaml.load and yaml.dump [5][3]. 2. Default Behavior: - The load function now uses the YAML 1.2 CORE_SCHEMA by default [5][3]. Notably, this schema does not support the YAML 1.1 merge key (<<) by default [1][3]. If your data relies on it, you must explicitly enable it [5][3]. - Loading an empty string with load now throws an error instead of returning undefined [5][1]. 3. Schemas and Types: - The Type class, DEFAULT_SCHEMA, and the types namespace have been removed [5][1][2]. Custom tags must now be defined using the new tag API (defineScalarTag, defineSequenceTag, defineMappingTag) and registered via schema.withTags [5][1]. - Unsafe tags (like!!js/function,!!js/regexp, and!!js/undefined) have been moved to the separate js-yaml-js-types package [2]. 4. Configuration: Many legacy dumper options (such as styles, replacer, and noCompatMode) have been removed in favor of configuring formatting through presenter options, schemas, and tag definitions [1][2]. Refer to the official migration guide for specific replacements for these options [5][2].
Citations:
🏁 Script executed:
Repository: migtools/mig-ui
Length of output: 8781
🌐 Web query:
GitHub@eslint/eslintrcv0.4.3 js-yaml safeLoad source💡 Result:
The package
@eslint/eslintrcversion 0.4.3 lists js-yaml version ^3.13.1 as a dependency [1]. In js-yaml v3 (such as v3.13.1), the safeLoad function is a standard, exported method used to safely parse YAML strings [2]. It is part of the library's legacy API, which was subsequently removed in js-yaml v4 [2][3]. Because@eslint/eslintrcv0.4.3 relies on the js-yaml v3.x series, it has access to and may utilize the safeLoad function in its implementation [1]. Subsequent versions of@eslint/eslintrc(specifically starting with v1.0.4) were updated to use js-yaml v4 to resolve dependency mismatches with the main ESLint package [4][5][6].Citations:
🌐 Web query:
GitHub eslint 7.32.0 js-yaml safeLoad source💡 Result:
In js-yaml, the safeLoad function was a method used in version 3 and earlier to safely parse YAML documents without executing arbitrary code that could be embedded in YAML files [1][2]. In js-yaml version 4.0.0 and later, the safeLoad function was removed [1][3]. Instead, the standard load function was updated to be safe by default [4][2]. Consequently, developers migrating from older versions of js-yaml to version 4 or higher are instructed to replace calls to safeLoad with load [1][2]. Regarding ESLint version 7.32.0 (released July 2021), it utilized js-yaml as a dependency [5][6]. Because js-yaml v4 introduced breaking changes—specifically the removal of safeLoad—projects using older versions of ESLint (like 7.32.0) often encountered compatibility issues if their environment forced an upgrade to js-yaml v4 [7][4]. For this reason, many legacy projects maintained version 3.x of js-yaml to avoid these breaking changes [8][9].
Citations:
🌐 Web query:
GitHub@istanbuljs/load-nyc-config1.1.0 js-yaml safeLoad source💡 Result:
The package
@istanbuljs/load-nyc-configversion 1.1.0 does not use the js-yaml function safeLoad [1]. Instead, the source code in index.js uses the js-yaml.load method to parse YAML configuration files [2][1][3]. Specifically, the relevant code snippet in index.js is [3]: return require('js-yaml').load(await readFile(configFile, 'utf8')); While js-yaml version 3.x (which is used as a dependency in this version of the package) offered a safeLoad function, it is not explicitly called in this implementation [4][1]. When js-yaml is updated to version 4.x, the.load method acts similarly to the previous safeLoad behavior by being safe by default [1].Citations:
🏁 Script executed:
Repository: migtools/mig-ui
Length of output: 1605
Do not force
js-yamlv5.4.1 for@eslint/eslintrc@0.4.3.Yarn maps its declared
js-yaml@^3.13.1dependency to v5.4.1. When ESLint loads a YAML configuration,@eslint/eslintrc@0.4.3calls the removedyaml.safeLoadAPI, which causes a runtime error. Use a compatible resolution or upgrade the ESLint consumer to a version that usesyaml.load. The@istanbuljs/load-nyc-configconsumer uses the compatibleloadAPI.🤖 Prompt for AI Agents