Skip to content

Commit 936bddf

Browse files
authored
fix: upgrade Node.js to 20.20.0 to address async_hooks DoS vulnerability (#2890)
## Summary - Upgrades Node.js from 20.19.0 to 20.20.0 (and 22.12.0 to 22.22.0 for supervisor) to address the async_hooks stack overflow DoS vulnerability - Adds `maxDepth` parameter (default 128) to `flattenAttributes` and `unflattenAttributes` to prevent stack overflow on maliciously deep nested structures ## Details The vulnerability (patched in Node.js 20.20.0, 22.22.0, 24.13.0, 25.3.0) causes unrecoverable crashes (exit code 7) when stack overflow occurs during async_hooks callbacks. Since the webapp uses `AsyncLocalStorage`, it was theoretically vulnerable. ### Changes **Node.js version updates:** - `docker/Dockerfile`: 20.11.1 → 20.20.0 - `apps/supervisor/Containerfile`: 22-alpine → 22.22.0-alpine - `.nvmrc`: 20.19.0 → 20.20.0 - `apps/supervisor/.nvmrc`: 22.12.0 → 22.22.0 - `references/prisma-7/.nvmrc`: 20.19.0 → 20.20.0 - All GitHub workflows: 20.19.0 → 20.20.0 **Defense in depth:** - Added `maxDepth` parameter to `flattenAttributes()` and `unflattenAttributes()` in `packages/core` to prevent stack overflow on deeply nested user input ## Test plan - [x] All existing `flattenAttributes` tests pass (50 tests) - [x] New tests for depth limiting added - [x] Verify Docker builds work with new base images
1 parent b1e21cf commit 936bddf

File tree

18 files changed

+142
-34
lines changed

18 files changed

+142
-34
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/core": patch
3+
---
4+
5+
Add a maxDepth to flatten/unflattenAttributes to prevent possible issues

.github/workflows/changesets-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Setup node
3535
uses: buildjet/setup-node@v4
3636
with:
37-
node-version: 20.19.0
37+
node-version: 20.20.0
3838
cache: "pnpm"
3939

4040
- name: Install dependencies
@@ -83,7 +83,7 @@ jobs:
8383
- name: Setup node
8484
uses: buildjet/setup-node@v4
8585
with:
86-
node-version: 20.19.0
86+
node-version: 20.20.0
8787

8888
- name: Install and update lockfile
8989
run: pnpm install --no-frozen-lockfile

.github/workflows/claude.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: ⎔ Setup node
3939
uses: buildjet/setup-node@v4
4040
with:
41-
node-version: 20.19.0
41+
node-version: 20.20.0
4242
cache: "pnpm"
4343

4444
- name: 📥 Download deps

.github/workflows/e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: ⎔ Setup node
3737
uses: buildjet/setup-node@v4
3838
with:
39-
node-version: 20.19.0
39+
node-version: 20.20.0
4040

4141
- name: 📥 Download deps
4242
run: pnpm install --frozen-lockfile --filter trigger.dev...

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
- name: Setup node
8787
uses: buildjet/setup-node@v4
8888
with:
89-
node-version: 20.19.0
89+
node-version: 20.20.0
9090
cache: "pnpm"
9191

9292
# npm v11.5.1 or newer is required for OIDC support
@@ -154,7 +154,7 @@ jobs:
154154
- name: Setup node
155155
uses: buildjet/setup-node@v4
156156
with:
157-
node-version: 20.19.0
157+
node-version: 20.20.0
158158
cache: "pnpm"
159159

160160
# npm v11.5.1 or newer is required for OIDC support

.github/workflows/typecheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: ⎔ Setup node
2525
uses: buildjet/setup-node@v4
2626
with:
27-
node-version: 20.19.0
27+
node-version: 20.20.0
2828
cache: "pnpm"
2929

3030
- name: 📥 Download deps

.github/workflows/unit-tests-internal.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
- name: ⎔ Setup node
5959
uses: buildjet/setup-node@v4
6060
with:
61-
node-version: 20.19.0
61+
node-version: 20.20.0
6262
cache: "pnpm"
6363

6464
# ..to avoid rate limits when pulling images
@@ -127,7 +127,7 @@ jobs:
127127
- name: ⎔ Setup node
128128
uses: buildjet/setup-node@v4
129129
with:
130-
node-version: 20.19.0
130+
node-version: 20.20.0
131131
# no cache enabled, we're not installing deps
132132

133133
- name: Download blob reports from GitHub Actions Artifacts

.github/workflows/unit-tests-packages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
- name: ⎔ Setup node
5959
uses: buildjet/setup-node@v4
6060
with:
61-
node-version: 20.19.0
61+
node-version: 20.20.0
6262
cache: "pnpm"
6363

6464
# ..to avoid rate limits when pulling images
@@ -127,7 +127,7 @@ jobs:
127127
- name: ⎔ Setup node
128128
uses: buildjet/setup-node@v4
129129
with:
130-
node-version: 20.19.0
130+
node-version: 20.20.0
131131
# no cache enabled, we're not installing deps
132132

133133
- name: Download blob reports from GitHub Actions Artifacts

.github/workflows/unit-tests-webapp.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
- name: ⎔ Setup node
5959
uses: buildjet/setup-node@v4
6060
with:
61-
node-version: 20.19.0
61+
node-version: 20.20.0
6262
cache: "pnpm"
6363

6464
# ..to avoid rate limits when pulling images
@@ -135,7 +135,7 @@ jobs:
135135
- name: ⎔ Setup node
136136
uses: buildjet/setup-node@v4
137137
with:
138-
node-version: 20.19.0
138+
node-version: 20.20.0
139139
# no cache enabled, we're not installing deps
140140

141141
- name: Download blob reports from GitHub Actions Artifacts

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v20.19.0
1+
v20.20.0

0 commit comments

Comments
 (0)