Skip to content

n8n tooling uses patched dependencies and assembler writes - #855

Merged
zlareb1 merged 5 commits into
mainfrom
fix/n8n-security-dependencies
Nov 18, 2026
Merged

zlareb1 merged 5 commits into
mainfrom
fix/n8n-security-dependencies

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Related: #755, #934

Changelog category (leave one):

  • Build/Testing/Packaging Improvement

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

The n8n package builds resolve patched glob matching, query serialization and UUID dependencies. A pinned assembler backport prevents prototype injection while retaining the toolchain's CommonJS API.

Why

The n8n dependency graph includes vulnerable minimatch, qs and uuid versions. The package-manager pin uses 10.34.9, above the fixed 10.34.5 release for pnpm tarball path traversal and pnpm store-linker path traversal. Scoped package-manager overrides select the patched versions while retaining the existing direct toolchain and application dependencies.

Scope and risk

The n8n manifest, generated lockfile, dependency patch, patch provenance and regression tests change. The overrides select minimatch 11.0.8 for vulnerable versions from 7 through 11.0.0, qs 6.16.1 for the affected 6.x range and uuid 11.1.1 for uuid 10.0.0. They address minimatch preprocessing amplification, qs comma-array serialization and UUID buffer bounds.

The minimatch and uuid selections cross a major version because their callers pin an affected major. Both selected versions retain CommonJS and ESM entry points. The n8n package requires Node.js 24; minimatch 11 supports that runtime. The matching APIs used by the toolchain and the no-options UUID generation APIs used by the consumers remain available. The recorded build and lint checks exercise the security overrides; CI checks their composition with the merged dependency update. Existing minimatch 3 remains outside the override.

The stream-json 1.9.1 assembler receives a minimal backport of the upstream prototype-injection fix. Both ordinary and reviver writes define __proto__ as an own data property. The package manager binds the patch SHA256 in the frozen lockfile. This is a local mitigation on 1.9.1, not an upstream fixed-version claim. Upstream 3.6 changes the assembler API and cannot replace the current toolchain import directly.

The manifest and lockfile retain the esbuild update merged by the linked pull request. This change does not claim to resolve other dependency advisories.

Compatibility, rollout and rollback

  • Wire: no operation, field or default changes.
  • Operator steps: none. Frozen installs use the regenerated lockfile and its scoped overrides.
  • Rollback: reverting the manifest and lockfile restores the prior dependency graph; no stored data changes.

Tests

The hosted n8n package job on this head passes frozen installation with pnpm 10.34.9, build, lint, both dependency-security regressions, package creation and loading without development dependencies: 11 passes and one existing live-test skip.

  • The same assembler regression fails against the original unpatched dependency while its ordinary-value control passes. The patch and both tests remain unchanged.
  • Earlier dependency API smoke checks pass for UUID generation and bounds rejection, query serialization and glob matching. No blanket dependency-audit clearance is claimed.
  • Whitespace and source-union checks pass. All 54 checks are terminal: 53 pass and the release-only publish check is skipped. All five applicable workflows pass, including full unit, integration, Postgres-authority, coverage and offline benchmark checks.
  • No live n8n deployment is qualified. No broad local suite, service or dependency installation was started for this composition.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated: Codex traced the dependency consumers, checked upstream advisories, backported the assembler fix, wrote its regression controls and checked the dependency API controls.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • Full checks pass in CI on this head.
  • The package manager regenerates the lockfile; it is formatted for repository checks.
  • No migrations, wire fields, plugin behavior or frontend source change.
  • Repository text follows the public-copy rules.
  • Commits are signed off.

Pin compatible secure matching, query and UUID dependencies and backport own-property handling for the legacy streaming assembler. Preserve its CommonJS API and test the exact parser loaded by the build toolchain.

Signed-off-by: zlareb1 <[email protected]>
Keep every authored dependency and assembler change while incorporating the published source that restores request-work isolation in the shared test fixture.

Signed-off-by: zlareb1 <[email protected]>
The manifest and lock retain the assembler backport and scoped dependency
resolutions alongside the merged esbuild update.

Signed-off-by: zlareb1 <[email protected]>
The ordering assertion requires all three calls to share a window. Use the existing manual clock so scheduler delay cannot turn the third call into an independent point write.

Signed-off-by: zlareb1 <[email protected]>
The combined CI run exercises the dependency changes with a test that controls its coalescing window. Both source components retain their reviewed bytes.

Signed-off-by: zlareb1 <[email protected]>
zlareb1 added a commit that referenced this pull request Nov 18, 2026
Related: #855
Related: #932

### Changelog category (leave one):

- Build/Testing/Packaging Improvement

### Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

The first-set cancellation test controls the clock so its writes share one coalescing window.

### Why

The test requires a bulk flush behind an unfinished point write. Yielding a fixed number of event-loop turns does not establish that all three calls fit inside one 200 ms window. If the window expires before the third call submits, that call can become a point write in a new window and finish while the earlier write waits.

The existing manual clock holds this test in the window it intends to exercise. Explicitly closing the window still starts the flush, and the test still requires the cancelled caller's write to land before that flush.

### Scope and risk

One test gains the existing clock fixture. Its cancellation, gates, both ordering assertions and scheduling yields remain unchanged. The SDK implementation and 200 ms window are unchanged. The separate close-cancellation test is unaffected.

### Compatibility, rollout and rollback

- Wire: none.
- Operator steps: none.
- Rollback: reverting removes the clock control; no stored data changes.

### Tests

- The exact changed test passes: `python -m pytest -q tests/unit/test_sdk_set_coalescer.py::test_a_first_set_its_caller_cancels_still_lands_before_the_windows_flush` — 1 passed in 1.64s.
- A bounded witness invokes the original test with the actual SDK and existing fake transport. A frozen-clock control passes; advancing the clock by 0.21s before the third submission reproduces the failed assertion, with the newer value landing first. The hosted failure records no window ages, so its exact scheduling cause remains unproven.
- Ruff format/check and whitespace checks pass for the changed file. AST comparison preserves the entire original file after removing only the clock setup and added fixture parameter, including both original assertions.
- All 44 checks and all three applicable workflows pass in GitHub CI on this head, including the unit, integration, Postgres-authority, coverage and offline benchmark gates.

### AI assistance in the code (leave one; writing this description with AI is fine):

- AI-generated: Codex wrote the clock setup. Source review checked the coalescer's window and cancellation behavior; a bounded witness checked the scheduling premise, and AST comparison checked the preserved assertions.

- [x] I can explain every line of this diff and how it interacts with the rest of Loom.

### Checklist

- [x] `make format-check`, `make lint`, `make typecheck` and `make test-unit` pass; the integration suite passes if server behaviour changed.
- [x] Generated files are unaffected.
- [x] No migration changes.
- [x] No shipped plugin files change.
- [x] No frontend changes.
- [x] No operator steps or wire changes.
- [x] Repository text has no dates, people, host names, internal namespaces, ticket or decision numbers.
- [x] Commits are signed off (`git commit -s`).
@zlareb1
zlareb1 merged commit e9e40d9 into main Nov 18, 2026
54 checks passed
@zlareb1 zlareb1 mentioned this pull request Nov 18, 2026
6 tasks done
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