Skip to content

fix: patch remaining service dependency vulnerabilities - #400

Merged
danny-avila merged 2 commits into
mainfrom
danny-avila/remaining-audit-fixes
Nov 15, 2026
Merged

danny-avila merged 2 commits into
mainfrom
danny-avila/remaining-audit-fixes

Conversation

@danny-avila

Copy link
Copy Markdown
Collaborator

Summary

Remove the remaining service audit findings that have fixed releases, and apply a reproducible fix for the unpatched deepmerge advisory.

  • Scope minimatch 11.0.1 to typescript-estree; retain the callable v3 API for legacy ESLint/glob consumers and replace the deprecated @types/minimatch stub with real declarations.
  • Upgrade MinIO's stream-json dependency to 3.9.0 and patch its source/CommonJS/ESM notification parser imports and stream adapter. An override alone breaks MinIO.
  • Patch deepmerge's destination writes to define own data properties, preventing prototype poisoning without changing normal merge semantics. The low-severity audit warning remains because upstream has no patched release; nothing is suppressed.
  • Copy patches before every service Docker dependency install. Use the same frozen Bun lock in the Node Dockerfile so npm cannot silently skip the patches.

This does not close the separate sandbox-runtime/Zod alert tracked in #383.

Change Type

  • Bug fix

Testing

  • Service build passed.
  • 100 focused Bun tests passed, including prototype-poisoning regressions, ESLint project-service compatibility, MinIO upload/listing, and file resolution.
  • Both MinIO module formats passed UTF-8 notification and malformed-JSON tests under Node and Bun; added to CI.
  • Fresh frozen production dependency install and Node MinIO import passed.
  • Docker service dependency stage built successfully with development and production patches.
  • bun audit --json now reports only the locally patched deepmerge 4.3.1 advisory; minimatch and stream-json findings are gone.

Checklist

  • Added regression coverage and documented patch removal conditions.
  • Verified the dependency lockfile and patch installation paths.

@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current PR head 661d0cc. Confirm that this exact commit is the reviewed commit and ignore findings that apply only to earlier heads.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T17:27:21.579313Z 54e332b Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 661d0ccbe6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread service/package.json Resolved
@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current PR head 661d0cc. Confirm that this exact commit is the reviewed commit and ignore findings that apply only to earlier heads.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 54e332b828

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danny-avila
danny-avila merged commit e0710a8 into main Nov 15, 2026
24 checks passed
zahangirbu added a commit to bu-ist/code-interpreter that referenced this pull request Nov 25, 2026
…h files

The amd64 `sandbox` image failed to build after the v1.11.0 merge:

  error: Unknown lockfile version  at bun.lock:2:22
  error: lockfile had changes, but lockfile is frozen

v1.11.0's service/bun.lock is lockfileVersion 3, which bun 1.3.14 cannot
parse. Every stage in this file still pinned oven/bun:1.3.14 while upstream
moved to 1.4.4; service/Dockerfile, which CI uses for the api and worker
images, was already on 1.4.4, and languageConfig pins the sandbox runtime to
Bun 1.4.4 as well. So the fork was the only thing left behind. All five stages
move to 1.4.4. oven/bun:1.4.4-debian is still trixie, so the Posit R build the
distro derivation selects does not change.

Fixing the version alone then failed differently:

  error: patch file not found: 'patches/deepmerge@4.3.1.patch'

service/package.json declares patchedDependencies (deepmerge@4.3.1,
minio@8.0.7), added upstream in LibreChat-AI#400, and --frozen-lockfile refuses to install
without the patch files the lockfile records. Upstream copies service/patches
before every service install; this fork copied it nowhere. Added to all three
stages that install service dependencies: worker-builder, worker-sandbox-kvm
and worker-sandbox-nokvm.

api/package.json declares no patched dependencies. That is why the Lambda
stage, which installs only api dependencies, built fine throughout and why
sandbox-microvm did not fail alongside sandbox.

Verified:

  - worker-sandbox-kvm builds on linux/amd64, the exact target and platform
    that failed; worker-builder installs 513 packages
  - sandbox-lambda-microvm rebuilt on the new base: the sandbox starts, the
    NsJail smoke test passes, all five runtimes load, and R 4.5.2 runs end to
    end through /api/v2/execute including Sys.which and the stats path
  - the hardening survives the base bump: zero libnl links in nsjail, and
    sandbox-supervisor-policy, tool-call-pipe-bridge and anonymous-pipes.node
    all present
  - no regression and isolation intact: python+numpy runs, the sandbox cannot
    reach the network, and R cannot read /etc/shadow
  - 24 pass / 0 fail in service/src/config.spec.ts

worker-sandbox-nokvm is not built by CI (images.json builds only
worker-sandbox-kvm and sandbox-lambda-microvm) and was not built here; its
change is the same one-line copy verified in the other two stages.
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.

1 participant