rfellows opened a new pull request, #11933: URL: https://github.com/apache/nifi/pull/11933
# NIFI-16596: Address nifi-frontend npm audit findings ## Description Jira: https://issues.apache.org/jira/browse/NIFI-16596 This change resolves the 37 moderate npm audit findings reported against the `nifi-frontend` workspace. The findings collapse to two leaf advisories, `glob` ([GHSA-3g3m-2fjr-6pw4](https://github.com/advisories/GHSA-3g3m-2fjr-6pw4)) and `minimatch` ([GHSA-g3hv-75wg-m249](https://github.com/advisories/GHSA-g3hv-75wg-m249)). Both are now resolved through `package.json` `overrides`, and `npm audit` reports 0 vulnerabilities. Stale overrides that no longer suppressed any advisory are removed so the override list reflects only active pins. ## What's Changed ### nifi-frontend - Add `glob` override `^14.0.2` (resolves to `14.0.6`) to clear GHSA-3g3m-2fjr-6pw4 - Add `minimatch` override `^11.0.1` (resolves to `11.0.9`) to clear GHSA-g3hv-75wg-m249 - Pin nested `@eslint/eslintrc` → `minimatch` to `3.1.5` so ESLint keeps its default-import contract - Remove stale overrides: `piscina`, `@modelcontextprotocol/sdk`, `node-forge`, `qs`, `fast-uri`, `ip-address`, `serialize-javascript`, `@eslint/plugin-kit`, `zod`, and `nx.minimatch` - Update `package-lock.json` to match the new overrides ### Tests - No test files changed. Existing lint, unit test, and build targets were run to validate the dependency changes. ## Key Features - **Two-leaf collapse**: The 37 moderate findings are parent packages (`js-beautify`, `nx`, `@eslint/eslintrc`, and others) that pull in the two vulnerable leaves. Fixing the leaves clears the whole set. - **Nested `minimatch` pin for ESLint**: `@eslint/eslintrc` does `import minimatch from "minimatch"` and then destructures `Minimatch`. `minimatch` 11 is named-export ESM, so it breaks the Nx ESLint project-graph plugin. The nested pin to `3.1.5` is the range that package declares and sits outside the CVE range (`>=7.0.0 <11.0.1`). - **`npm audit fix` not used**: The automatic fix wanted to bump `typescript-eslint` / `@typescript-eslint/*` from `8.72.1` to `8.73.0`, which is a framework guardrail, and it would not lift `glob` out of `<=14.0.1`. Targeted overrides were used instead. - **Guardrails kept**: `vite` and `webpack-dev-server` overrides are retained as framework guardrails even though they were not load-bearing in this audit. - **Validation**: Override removals were checked with an empty-overrides audit. No new advisory surfaced for the removed pins. ## Screenshots No UI changes. --- ## npm Audit Triage Report ### Summary | Metric | Before | After | | --------- | ------ | ----- | | Critical | 0 | 0 | | High | 0 | 0 | | Moderate | 37 | 0 | | Low | 0 | 0 | | **Total** | **37** | **0** | **Target repo:** nifi-frontend (`nifi-frontend/src/main/frontend`) **JIRA:** [NIFI-16596](https://issues.apache.org/jira/browse/NIFI-16596) **Branch:** `NIFI-16596` **Node version:** v24.22.1 **npm version:** 11.19.1 The 37 baseline rows were two leaf advisories plus parent packages. Both leaves are resolved. ### Actions Taken #### Stale Overrides Removed Unpinned after empty-overrides audit (no new advisory surfaced). `vite` and `webpack-dev-server` stayed because they are framework guardrail packages even though they were not load-bearing in this audit. - **`piscina`**: was pinned to `^5.3.2` — removed (no advisory surfaced when unpinned) - **`@modelcontextprotocol/sdk`**: was pinned to `^1.32.0` — removed - **`node-forge`**: was pinned to `^1.4.3` — removed - **`qs`**: was pinned to `^6.16.2` — removed - **`fast-uri`**: was pinned to `^3.1.9` — removed - **`ip-address`**: was pinned to `^10.7.5` — removed - **`serialize-javascript`**: was pinned to `^7.1.4` — removed - **`@eslint/plugin-kit`**: was pinned to `^0.7.3` — removed - **`zod`**: was pinned to `^4.6.6` — removed - **`nx.minimatch`**: was pinned to `^9.0.9` — removed (still inside GHSA-g3hv-75wg-m249 range; replaced by flat `minimatch` `^11.0.1`) Kept (still suppressing highs/moderates when unpinned): `undici` (nested), `nx.brace-expansion`, `sockjs.uuid`, `axios`, `follow-redirects`, `smol-toml`. Kept as guardrail: `vite`, `webpack-dev-server`. ```diff "overrides": { - "piscina": "^5.3.2", - "@modelcontextprotocol/sdk": "^1.32.0", - "node-forge": "^1.4.3", - "qs": "^6.16.2", - "fast-uri": "^3.1.9", - "ip-address": "^10.7.5", - "serialize-javascript": "^7.1.4", - "@eslint/plugin-kit": "^0.7.3", - "zod": "^4.6.6" - "nx": { "minimatch": "^9.0.9" } } ``` #### npm audit fix Skipped. Dry-run would bump `@typescript-eslint/*` / `typescript-eslint` 8.72.1 → 8.73.0 (framework guardrail) and would not lift `glob` out of `<=14.0.1`. #### Overrides Added / Updated - **`glob`**: `10.5.0` / `13.0.6` → `14.0.6` via `"glob": "^14.0.2"` (accepted major) — resolves [GHSA-3g3m-2fjr-6pw4](https://github.com/advisories/GHSA-3g3m-2fjr-6pw4) - _Severity:_ moderate - _Prod/Dev:_ prod (via `js-beautify`) plus dev copies - _Applied because:_ patched in `14.0.2`; latest on registry is `14.0.6` (no 15.x) - **`minimatch`**: `9.0.9` / `10.2.x` → `11.0.9` via `"minimatch": "^11.0.1"` (accepted major) — resolves [GHSA-g3hv-75wg-m249](https://github.com/advisories/GHSA-g3hv-75wg-m249) - _Severity:_ moderate - _Prod/Dev:_ prod (via `js-beautify`/`glob`) plus dev copies - _Applied because:_ patched in `11.0.1`; latest on registry is `11.0.9` (no 12.x) - **`@eslint/eslintrc.minimatch`**: nested exact `"3.1.5"` — `@eslint/eslintrc` does `import minimatch from "minimatch"` then destructures `Minimatch`. minimatch 11 is named-export ESM and breaks Nx's ESLint project-graph plugin. 3.1.5 is the package's declared range and is outside the CVE (`>=7.0.0 <11.0.1`). ```diff "overrides": { + "glob": "^14.0.2", + "minimatch": "^11.0.1", + "@eslint/eslintrc": { + "minimatch": "3.1.5" + } } ``` ### Deferred / Approval Required None for remaining CVEs (`npm audit` is clean). Optional later (not required for this ticket): - **`vite`: `^7.3.7`** and **`webpack-dev-server`: `^5.2.6`** — prune candidates, kept because they are framework guardrail packages. - **`typescript-eslint` 8.72.1 → 8.73.0** — patch, framework guardrail; `npm audit fix` wanted this. ### Remaining Vulnerabilities | Advisory | Severity | Prod/Dev | Reason No Fix Applied | | -------- | -------- | -------- | --------------------- | | — | — | — | None; `npm audit` reports 0 | ### Dependabot Cross-Reference | PR # | Title | Package | Status | | ---- | ----- | ------- | ------ | | — | No open Dependabot PRs on `apache/nifi` | — | n/a | ### Verification **nifi-frontend:** `nx run-many -t lint,build,test --parallel=3` > lint: exit 0 (6 projects) | test: exit 0 (4666 specs passed across 6 projects) | build: exit 0 (6 projects) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
