Skip to content

fix: Pin Node.js to v22.23.4 and update body-parser and vite - #1394

Open
cybele-ripple wants to merge 4 commits into
mainfrom
fix/security-node-pin-and-dep-bumps
Open

cybele-ripple wants to merge 4 commits into
mainfrom
fix/security-node-pin-and-dep-bumps

Conversation

@cybele-ripple

@cybele-ripple cybele-ripple commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

High Level Overview of Change

Addresses three high-severity advisories in a single change:

  • .nvmrc pinned from v22.14.0 to v22.23.4 (CVE-2026-111497)
  • body-parser raised from ^1.20.6 to ^1.20.9 (CVE-2026-111181)
  • vite raised from ^7.3.6 to ^7.3.7 (CVE-2026-112942)
  • package-lock.json regenerated so the patched versions are the resolved ones

Context of Change

Node.js — CVE-2026-111497. .nvmrc pinned v22.14.0, which is affected by a Brotli decoder out-of-bounds write (remote code execution). v22.23.4 is the first 22.x release carrying the fix. It is kept as an explicit pin rather than a floating alias such as lts or latest, per the advisory guidance. The CI workflows resolve NODE_VERSION: 22.x at run time and therefore already install a patched release, so no workflow change is needed.

body-parser — CVE-2026-111181. The lockfile resolved 1.20.8, which is affected by an uncaught exception advisory rated high severity. Updated to 1.20.9. This is the highest-priority item of the three; see the advisory for details.

vite — CVE-2026-112942. The lockfile resolved 7.3.6, which bundles a launch-editor affected by a command injection advisory. The affected code path belongs to the dev server, which production builds do not run.

Both existing caret ranges already permitted the patched versions — the lockfile was simply pinned to older resolutions. The floors in package.json are raised alongside the lockfile update so a future regeneration cannot resolve back below the patched releases.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Codebase Modernization

Not applicable — this change touches only dependency metadata and the Node version file. No source files were modified.

Before / After

Resolved versions in package-lock.json:

Package Before After
body-parser 1.20.8 1.20.9
vite 7.3.6 7.3.8

vite resolves to 7.3.8 rather than exactly 7.3.7 because the caret range picks up the newest patch; both are past the fixed version. The nested express/node_modules/body-parser at 2.3.0 was never in the affected range and is unchanged.

Test Plan

Run under Node 22 (engines requires >=22.0.0 <23):

  • npm install — reported changed 2 packages, confirming the update is limited to the two dependencies.
  • npm run build — succeeded, 1,783 modules transformed. The chunk-size warning is pre-existing and unrelated.
  • npm run test:ci — 314 suites, 1,900 tests, all passing.
  • npm run lint:ci — eslint and stylelint clean.

Resolved versions were then verified directly in package-lock.json to confirm no other copy of either package remains in the affected range.

🤖 Generated with Claude Code

Pins .nvmrc to v22.23.4 for CVE-2026-111497, raises body-parser to ^1.20.9 for CVE-2026-111181, and raises vite to ^7.3.7 for CVE-2026-112942. The existing caret ranges already permitted the patched versions; the floors are raised so a future lockfile regeneration cannot resolve back below them.

@ripple-code-reviewer ripple-code-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found.

Comment thread package-lock.json Outdated
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.8.tgz",
"integrity": "sha512-JNcyFQ64OiijEkPzUBTCe+hyPXUD/3LEldGQ6iF5LR1w00mx9o7xtDWHXBY2iItjdCFGoilOLNQbH943ut7pHA==",
"version": "1.20.9",
"resolved": "https://artifactory.ops.ripple.com/artifactory/api/npm/ripple-npm/body-parser/-/body-parser-1.20.9.tgz",

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.

CI is failing due to internal NPM registry

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed here and build is now passing

@ripple-code-reviewer ripple-code-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found.

@ripple-code-reviewer ripple-code-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found.

Comment thread .nvmrc Outdated
@@ -1 +1 @@
v22.14.0
v22.23.4

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.

I have the same comment and question as in [this PR discussion]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Based on that discussion, reverted back to v22 here

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.

@cybele-ripple Can you keep the PR title and description up to date?

Only affects contributors running nvm install locally, since v22
already resolves to the latest 22.x patch. Matches the decision made
on XRPLF/xrpl.js#3592.

@ripple-code-reviewer ripple-code-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Found 1 blocking issue — see inline.

Comment thread .nvmrc
@@ -1 +1 @@
v22.14.0
v22

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 High — .nvmrc pinned to floating "v22" alias, not the exact v22.23.4 described in the PR

.nvmrc uses floating v22 instead of exact pin v22.23.4, risking the Brotli RCE. Use explicit version:

Suggested change
v22
v22.23.4

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.

3 participants