Skip to content

fix(deps): update build-tools and fix npm vulnerabilities#2366

Open
platex-rehor-bot wants to merge 2 commits into
RedHatInsights:masterfrom
platex-rehor-bot:bot/RHCLOUD-48037
Open

fix(deps): update build-tools and fix npm vulnerabilities#2366
platex-rehor-bot wants to merge 2 commits into
RedHatInsights:masterfrom
platex-rehor-bot:bot/RHCLOUD-48037

Conversation

@platex-rehor-bot

@platex-rehor-bot platex-rehor-bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

What and why

RHCLOUD-48037

Vulnerability mitigation for the insights-rbac-ui container image. The June 2026 scan identified 58 vulnerabilities (2 Critical, 19 High) in the built image, primarily from outdated base images and npm dependencies.

Container image fixes (Phase 1):

  • Update build-tools submodule to latest (6bdef6f) — bumps Node.js builder image from 9.7-1773053268 to 9.8-1780375952, removes deprecated valpop binary. A rebuild will pull the latest caddy-ubi:latest runtime image, picking up RPM patches for gnutls, krb5-libs, libcap, libnghttp2, and other system packages.

npm dependency fixes:

  • Add axios ^1.17.0 as direct dependency (used in 20 source files, was only transitive)
  • Update vitest / @vitest/coverage-v8 / @vitest/ui to ^4.1.8 (fixes critical vitest RCE)
  • Update happy-dom to ^20.10.2 (fixes high severity issues)
  • Add overrides for transitive deps: serialize-javascript ^7.0.5, shell-quote ^1.8.4, tmp ^0.2.7

Result: npm audit reduced from 51 vulnerabilities (5 critical, 13 high) to 16 moderate-only. All critical and high severity npm vulnerabilities are resolved.

Note: Go module vulnerabilities (CVE-2026-27143 in Go stdlib, OpenTelemetry, Caddy, golang.org/x/crypto, pgx) reside in the caddy-ubi runtime image and require an upstream image update — tracked separately as Phase 2.


Screenshots

N/A — no UI changes.


Anything non-obvious reviewers should know?

  • The axios addition to direct dependencies is intentional — it was previously resolved only as a transitive dependency despite being imported in 20 source files.
  • The overrides section forces patched versions of serialize-javascript, shell-quote, and tmp which are transitive dependencies not directly imported in this project.
  • This PR supersedes the scope of PR chore(deps): update build-tools digest to 6bdef6f #2349 (build-tools digest update to 72c2bef) by going to the latest commit (6bdef6f).

Attention needed

  • (Optional) QE: notable impact on test coverage or OUIA IDs changed
  • (Optional) UX: end-user UX modified, designs may need sign-off

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated build tools and dependencies, including adding axios and pinning critical transitive dependencies for improved stability.

RHCLOUD-48037

Update build-tools submodule to latest (6bdef6f) which bumps
the Node.js builder image from 9.7 to 9.8 and removes the
deprecated valpop binary. This triggers a rebuild with latest
UBI9 base images, fixing RPM-level CVEs.

Fix all critical and high npm audit vulnerabilities:
- Add axios ^1.17.0 as direct dependency (20 source imports)
- Update vitest/coverage-v8/ui to ^4.1.8
- Update happy-dom to ^20.10.2
- Add overrides for transitive deps: serialize-javascript,
  shell-quote, tmp

Reduces npm audit from 51 vulnerabilities (5 critical, 13 high)
to 16 moderate-only.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@platex-rehor-bot platex-rehor-bot requested a review from a team as a code owner June 10, 2026 20:06
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@platex-rehor-bot, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 51 minutes and 53 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 4d626b93-6eaf-4d1f-bd2a-de0a354ef2a5

📥 Commits

Reviewing files that changed from the base of the PR and between 29ae98b and ca4213c.

📒 Files selected for processing (1)
  • package.json
📝 Walkthrough

Walkthrough

Build tools submodule reference is updated to a new commit, and package.json adds axios as a dependency, introduces an overrides section to pin three transitive dependencies, and bumps testing tool versions including vitest, vitest coverage, vitest ui, and happy-dom.

Changes

Dependencies and Build Tools Update

Layer / File(s) Summary
Build tools submodule update
build-tools
Build tools subproject reference is advanced to a new Git commit SHA.
Package dependencies update
package.json
axios (^1.17.0) is added as a dependency. An overrides section is introduced to pin serialize-javascript, shell-quote, and tmp to specific versions. Testing devDependencies are bumped: @vitest/coverage-v8 and @vitest/ui to ^4.1.8, happy-dom to ^20.10.2, and vitest to ^4.1.8.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

dependencies, javascript

Suggested reviewers

  • riccardo-forina

Poem

🐰 Hop along, dear dependencies flow,
Axios joins the team, testing tools grow.
Build tools steady, overrides in place,
A gentle bump to keep the testing race! 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: updating build-tools and fixing npm vulnerabilities, matching the primary objectives of the PR.
Description check ✅ Passed The description comprehensively covers all required template sections with detailed explanations of the changes, rationale, and impact, including proper issue linkage and notes on non-obvious decisions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Around line 48-52: The package.json uses the "overrides" field which only
takes effect on npm >=8.3.0; update the package.json "engines" entry (or add one
if missing) to require npm ">=8.3.0" so the overrides will be applied (i.e., set
or change the "npm" value under "engines" to ">=8.3.0"); if an existing
engines.npm range is present, replace it with the new minimum; ensure CI/docs
that enforce Node/npm versions are aligned with this change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 84502aa8-0f38-4d1c-ac96-543212858d88

📥 Commits

Reviewing files that changed from the base of the PR and between daa921f and 29ae98b.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • build-tools
  • package.json

Comment thread package.json
RHCLOUD-48037
The overrides field in package.json only takes effect with npm 8.3.0+.
Bumping the engines.npm minimum from 7.0.0 to 8.3.0 ensures the
vulnerability overrides are always applied.
@github-actions

Copy link
Copy Markdown

@aferd

aferd commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

We will leave the overrides because the current situation with overrides:

  1. serialize-javascript - brought in by webpack → terser-webpack-plugin
  2. shell-quote - brought in by:
    - @redhat-cloud-services/frontend-components-config → concurrently
    - npm-run-all2
    - webpack-dev-server → launch-editor
  3. tmp - brought in by patch-package

Can we solve without overrides?

Short answer: No, not easily. Here's why:

  1. serialize-javascript: Would require webpack or terser-webpack-plugin to update. You can't reasonably avoid webpack in this project.
  2. shell-quote: Multiple packages depend on it. You'd need:
    - @redhat-cloud-services/frontend-components-config to update (Red Hat package, outside your control)
    - npm-run-all2 to update
    - webpack-dev-server to update
  3. tmp: Would require patch-package to update its dependency.

The overrides are the correct solution because:

  • These are transitive dependencies you don't directly control
  • The upstream packages haven't updated yet
  • Overrides ensure you get the secure versions without waiting for all upstream packages to update
  • The npm engines requirement (>=8.3.0) ensures overrides work correctly

@aferd

aferd commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

@platex-rehor-bot this branch is out of date, please update.

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.

2 participants