Skip to content

chore(deps/js): resolve npm audit vulnerabilities - #651

Open
SoulPancake wants to merge 3 commits into
mainfrom
fix/npm-audit-vulnerabilities
Open

chore(deps/js): resolve npm audit vulnerabilities#651
SoulPancake wants to merge 3 commits into
mainfrom
fix/npm-audit-vulnerabilities

Conversation

@SoulPancake

@SoulPancake SoulPancake commented Jul 30, 2026

Copy link
Copy Markdown
Member

Bumps the brace-expansion override to ^5.0.9 and js-yaml to ^4.3.0, clearing the 26 high severity advisories that are currently failing make audit-js on main.

Summary by CodeRabbit

  • Chores
    • Updated package configuration to use newer dependency versions.
    • Added an override for brace-expansion to improve dependency consistency.

Override brace-expansion to ^5.0.9 and js-yaml to ^4.3.0 to clear 26 high
severity advisories reported by npm audit.
@SoulPancake
SoulPancake requested a review from a team as a code owner July 30, 2026 18:51
Copilot AI review requested due to automatic review settings July 30, 2026 18:51
@SoulPancake
SoulPancake requested a review from a team as a code owner July 30, 2026 18:51
@dosubot

dosubot Bot commented Jul 30, 2026

Copy link
Copy Markdown

📄 Knowledge review

Dosu skipped reviewing this PR because your organization has used its 200 included credits for the month. Your usage will reset on 2026-08-01. To have Dosu review this PR before then, ask your organization admin to upgrade to a pro account.


Leave Feedback Ask Dosu about language Add Dosu to your team

@SoulPancake SoulPancake changed the title fix(js): resolve npm audit vulnerabilities chore(deps/js): resolve npm audit vulnerabilities Jul 30, 2026
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2d8a9548-e1f4-4275-885b-59be2257bbeb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

The JavaScript package override configuration updates js-yaml to ^4.3.0 and adds a brace-expansion override pinned to ^5.0.9.

Changes

JavaScript dependency overrides

Layer / File(s) Summary
Override configuration
pkg/js/package.json
Updates the js-yaml override and adds the brace-expansion override.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: aaguiarz, copilot

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the dependency updates made to fix npm audit vulnerabilities.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/npm-audit-vulnerabilities

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.

Copilot AI 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.

Pull request overview

This PR updates the JavaScript package’s dependency overrides to address npm audit findings in pkg/js/, bringing the JS workspace back to a clean security/audit state.

Changes:

  • Bump the js-yaml override from ^4.2.0 to ^4.3.0.
  • Add a brace-expansion override at ^5.0.9 to eliminate vulnerable transitive versions and update the lockfile accordingly.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/js/package.json Updates overrides to newer js-yaml and introduces brace-expansion override for audit remediation.
pkg/js/package-lock.json Reflects resolved dependency tree changes from the overrides (removes older nested vulnerable copies and pins updated versions).
Files not reviewed (1)
  • pkg/js/package-lock.json: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@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 `@pkg/js/package.json`:
- Line 56: Update the dependency configuration around brace-expansion and the
minimatch@3 consumers so brace-expansion@5 is not forced onto minimatch@3, which
requires a callable CommonJS export. Upgrade all affected minimatch consumers
together, or use an override/patch that preserves the callable API while
retaining compatibility.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d275fea8-7acb-4c8f-b93c-cb2c79e2f7b1

📥 Commits

Reviewing files that changed from the base of the PR and between 83fedf8 and 8bfa07e.

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

Comment thread pkg/js/package.json Outdated
"overrides": {
"js-yaml": "^4.2.0"
"js-yaml": "^4.3.0",
"brace-expansion": "^5.0.9"

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail
cd pkg/js
npm ci --ignore-scripts
node - <<'NODE'
const expansion = require('brace-expansion')
if (typeof expansion !== 'function') {
  throw new Error(`brace-expansion CommonJS export is ${typeof expansion}, not callable`)
}
const minimatch = require('minimatch')
if (!minimatch('a.js', '*.js')) {
  throw new Error('minimatch smoke test failed')
}
NODE

Repository: openfga/language

Length of output: 2079


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail
cd pkg/js

printf 'package.json override section:\n'
awk 'NR>=1,NR<=90' package.json | sed -n '45,65p'

printf '\nlock brace-expansion entries:\n'
python3 - <<'PY'
import json
p=json.load(open('package-lock.json'))
for k,v in p.get('packages',{}).items():
    if k.endswith('brace-expansion') or k.endswith('minimatch'):
        print(k, v.get('version'), v.get('dependencies'), v.get('peerDependencies'), v.get('engines'))
PY

printf '\nResolved brace-expansion/cjs files:\n'
node - <<'NODE'
const path = require.resolve('brace-expansion')
const be = require('brace-expansion')
console.log({path, type: typeof be, exports: Object.keys(byRequire(path))})
function byRequire(p) { try { return require.cache[p] && require.cache[p].exports ?? require(p) } catch (e) { console.error(e); process.exit(1) } }
NODE

printf '\nminimatch source call sites involving brace-expansion:\n'
sed -n '1,140p' node_modules/minimatch/minimatch.js | python3 - <<'PY'
import sys
text=sys.stdin.read()
for i,line in enumerate(text.splitlines(),1):
    if 'brace' in line or i <= 160:
        print(f'{i}: {line}')
PY

printf '\nTop package engines:\n'
sed -n '1,25p' package.json

Repository: openfga/language

Length of output: 2441


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail
cd pkg/js

printf 'package.json override section:\n'
awk 'NR>=1,NR<=90' package.json | sed -n '45,65p'

printf '\nlock brace-expansion entries:\n'
python3 - <<'PY'
import json
p=json.load(open('package-lock.json'))
for k,v in p.get('packages',{}).items():
    if k.endswith('brace-expansion') or k.endswith('minimatch'):
        print(k, v.get('version'), v.get('dependencies'), v.get('peerDependencies'), v.get('engines'))
PY

printf '\nResolved brace-expansion CommonJS shape:\n'
node - <<'NODE'
const be = require('brace-expansion')
console.log(JSON.stringify({type: typeof be, constructor: (be.constructor && be.constructor.name), exportKeys: Object.keys(be)}, null, 2))
try {
  be('a')
  console.log('callable result', be('a'))
} catch (err) {
  console.log(err.name + ': ' + err.message.split('\n')[0])
}
NODE

printf '\nMinimatch brace-expansion imports/calls:\n'
grep -n "brace" node_modules/minimatch/minimatch.js || true

printf '\nTop package engines:\n'
sed -n '1,30p' package.json

Repository: openfga/language

Length of output: 2751


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail
cd pkg/js

printf 'Package manager / engines context:\n'
jq -r '{packageManager: .packageManager, engines: .engines}' package.json 2>/dev/null || true

printf '\nDirect call of brace-expansion CommonJS export:\n'
node - <<'NODE'
const be = require('brace-expansion')
try {
  console.log('callable result:', be('a'))
} catch (err) {
  console.log(err.name + ': ' + err.message.split('\n')[0])
}
NODE

printf '\nResolving minimatch versions affected by brace-expansion override:\n'
python3 - <<'PY'
import json
lock=json.load(open('package-lock.json'))
pkg=lock.get('packages',{}).get('',{})
print('workspace package manager:', pkg.get('packageManager'))
print('workspace engines:', pkg.get('engines'))
print()
for k in sorted(lock.get('packages',{}).keys()):
    if 'minimatch' in (k.split('/')[-2:] if isinstance(k, str) else []):
        v=lock['packages'][k]
        print(k, v.get('version'), 'deps:', v.get('dependencies',{}), 'engines:', v.get('engines'))
PY

Repository: openfga/language

Length of output: 1328


Do not force brace-expansion@5 onto minimatch@3.

brace-expansion@5.0.9 exports an object with expand, while minimatch@3.x dependencies still require brace-expansion through a direct callable import, which fails at runtime. Upgrade the affected minimatch@3 consumers together, or override/patch to a brace-expansion build that preserves the callable CommonJS API.

🤖 Prompt for 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.

In `@pkg/js/package.json` at line 56, Update the dependency configuration around
brace-expansion and the minimatch@3 consumers so brace-expansion@5 is not forced
onto minimatch@3, which requires a callable CommonJS export. Upgrade all
affected minimatch consumers together, or use an override/patch that preserves
the callable API while retaining compatibility.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@SoulPancake did you see this?

brace-expansion@5 exports an object ({ expand, ... }) instead of a
callable CommonJS function. Forcing it onto minimatch@3.x consumers
(eslint, eslint-plugin-import, test-exclude, @eslint/*) made
`require('brace-expansion')(pattern)` throw
"TypeError: expand is not a function" for any pattern containing braces.

The override is unnecessary: minimatch@3.x requests ^1.1.7, which
resolves to the patched brace-expansion@1.1.18, and npm audit reports
0 vulnerabilities without it.
@SoulPancake
SoulPancake requested a review from rhamzeh August 1, 2026 05:49
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