Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
fd13088
fix(supervisor): authenticate compute snapshot callbacks (#60)
carderne Jul 10, 2026
cdedd2e
Merge remote-tracking branch 'upstream/main' into release/2026-07-08
Jul 13, 2026
6003794
Merge remote-tracking branch 'upstream/main' into release/2026-07-08
Jul 13, 2026
4bca76c
Merge remote-tracking branch 'upstream/main' into release/2026-07-08
Jul 14, 2026
4a83ff5
Merge remote-tracking branch 'upstream/main' into release/2026-07-08
Jul 16, 2026
28cbffb
Merge remote-tracking branch 'upstream/main' into release/2026-07-08
Jul 20, 2026
589e348
Merge remote-tracking branch 'upstream/main' into release/2026-07-08
Jul 20, 2026
3d19aaa
feat: deployment-scoped runner boundary auth (#77)
nicktrn Jul 20, 2026
05a3ec1
fix(webapp): require same-origin navigation for GET /logout to block …
carderne Jul 20, 2026
845cd21
fix(tsql): validate window-function names against the allowlist (#68)
carderne Jul 20, 2026
2d195ba
fix(webapp): scope deployment background-worker lookup to the authent…
carderne Jul 20, 2026
d212155
fix(webapp): rate-limit unauthenticated OTLP ingestion endpoints (#61)
carderne Jul 20, 2026
3cbbaed
fix(webapp): scope GitHub App installation update to the caller's org…
carderne Jul 20, 2026
7cb35f1
fix(webapp,helm): require control-plane auth secrets and remove weak …
carderne Jul 20, 2026
677ce4c
fix(webapp,core): harden CLI auth-code login, socket-auth (#53)
carderne Jul 20, 2026
7fd671a
fix(webapp): schedule & env-var write scoping (reject cross-project/e…
d-cs Jul 20, 2026
5a5833e
fix(webapp): scope deployment lookup by environment to prevent cross-…
carderne Jul 20, 2026
ee4f190
fix(webapp): require private auth to initialize the session out strea…
carderne Jul 20, 2026
0c2d9ce
fix(core): block prototype-pollution via run metadata operation keys …
carderne Jul 20, 2026
dcc4b40
fix(webapp): harden Electric sync routes against SQLi and add org sco…
d-cs Jul 20, 2026
fc392b1
feat: source worker.id telemetry from the deployment friendlyId (#78)
nicktrn Jul 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/block-metadata-proto-pollution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@trigger.dev/core": patch
---

Prevent prototype pollution when applying run metadata operations or reconstructing nested telemetry attributes, while preserving legitimate `constructor` and `prototype` fields.
6 changes: 6 additions & 0 deletions .changeset/cli-login-poll-window.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@trigger.dev/core": patch
"trigger.dev": patch
---

Require explicit browser approval for CLI and MCP login, with resilient polling while approval is pending.
5 changes: 5 additions & 0 deletions .changeset/worker-id-deployment-friendly-id.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"trigger.dev": patch
---

Deployed task telemetry now reports the deployment identifier (e.g. `deployment_abc123`) in the `worker.id` attribute, instead of an opaque internal value. Upgrade to get the readable identifier in your own OpenTelemetry exporters.
5 changes: 5 additions & 0 deletions .changeset/workload-deployment-token.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@trigger.dev/core": patch
---

Add helpers to mint and verify the deployment-scoped token used to authenticate run controllers to the platform.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
SESSION_SECRET=abcdef1234
MAGIC_LINK_SECRET=abcdef1234
ENCRYPTION_KEY=ae13021afef0819c3a307ad487071c06 # Must be a random 16 byte hex string. You can generate an encryption key by running `openssl rand -hex 16` in your terminal
MANAGED_WORKER_SECRET=abcdef1234 # Must match the supervisor's MANAGED_WORKER_SECRET
LOGIN_ORIGIN=http://localhost:3030
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/postgres?schema=public
# This sets the URL used for direct connections to the database and should only be needed in limited circumstances
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/helm-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ jobs:

- name: Lint Helm Chart
run: |
helm lint ./hosting/k8s/helm/
helm lint ./hosting/k8s/helm/ \
--values ./hosting/k8s/helm/ci/lint-values.yaml

- name: Render templates
run: |
helm template test-release ./hosting/k8s/helm/ \
--values ./hosting/k8s/helm/values.yaml \
--values ./hosting/k8s/helm/ci/lint-values.yaml \
--output-dir ./helm-output

- name: Validate manifests
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release-helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ jobs:

- name: Lint Helm Chart
run: |
helm lint ./hosting/k8s/helm/
helm lint ./hosting/k8s/helm/ \
--values ./hosting/k8s/helm/ci/lint-values.yaml

- name: Render templates
run: |
helm template test-release ./hosting/k8s/helm/ \
--values ./hosting/k8s/helm/values.yaml \
--values ./hosting/k8s/helm/ci/lint-values.yaml \
--output-dir ./helm-output

- name: Validate manifests
Expand Down
6 changes: 6 additions & 0 deletions .server-changes/otlp-ingestion-rate-limit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
area: webapp
type: improvement
---

Added optional request rate limiting for telemetry ingestion endpoints.
6 changes: 6 additions & 0 deletions .server-changes/require-webapp-auth-secrets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
area: webapp
type: breaking
---

Self-hosted deployments no longer ship shared default credentials; fresh installs generate their own. If yours still uses a previously published default, set a unique value before upgrading, or set `ALLOW_INSECURE_DEFAULT_SECRETS=true` to keep booting while you migrate.
6 changes: 6 additions & 0 deletions .server-changes/scope-deployment-background-worker-lookup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
area: webapp
type: fix
---

Background-worker deployment lookups are now scoped to the authenticated environment.
6 changes: 6 additions & 0 deletions .server-changes/scope-github-app-update-to-org.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
area: webapp
type: fix
---

Updating a GitHub App installation from the callback flow is now scoped to your own organization, so an installation ID belonging to another organization can no longer be used to refresh that organization's installation record. The GitHub App installation session is also now single-use, so completing an installation callback invalidates its state and it can no longer be replayed.
6 changes: 6 additions & 0 deletions .server-changes/scope-schedule-and-env-var-writes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
area: webapp
type: fix
---

Scope schedule and environment-variable writes to the caller's project and environment
6 changes: 6 additions & 0 deletions .server-changes/secure-compute-snapshot-callbacks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
area: supervisor
type: fix
---

Reject compute snapshot callbacks that do not match the snapshot request that created them.
6 changes: 6 additions & 0 deletions .server-changes/session-out-stream-private-auth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
area: webapp
type: fix
---

Require secret-key authentication to initialize the session out (agent→client) stream, matching the append route.
6 changes: 6 additions & 0 deletions .server-changes/tighten-realtime-and-trace-sync.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
area: webapp
type: fix
---

Live run and trace subscriptions now validate their identifiers more strictly and only return data from your own organization.
6 changes: 6 additions & 0 deletions .server-changes/tsql-window-function-allowlist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
area: webapp
type: fix
---

Window-function names in the query compiler are now validated against the allowlist, matching how other function calls are handled.
6 changes: 6 additions & 0 deletions .server-changes/workload-token-supervisor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
area: supervisor
type: fix
---

Authenticate run controllers to the platform with a signed, deployment-scoped token.
6 changes: 6 additions & 0 deletions .server-changes/workload-token-webapp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
area: webapp
type: fix
---

Verify that worker actions (starting, completing, and continuing a run, and reading its snapshots) target a run belonging to the caller's environment.
4 changes: 2 additions & 2 deletions apps/supervisor/.env.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# This needs to match the token of the worker group you want to connect to
TRIGGER_WORKER_TOKEN=

# This needs to match the MANAGED_WORKER_SECRET env var on the webapp
MANAGED_WORKER_SECRET=managed-secret
# Must match the webapp's MANAGED_WORKER_SECRET. Generate with: openssl rand -hex 16
MANAGED_WORKER_SECRET=

# Point this at the webapp in prod
TRIGGER_API_URL=http://localhost:3030
Expand Down
19 changes: 18 additions & 1 deletion apps/supervisor/src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,17 @@ export const Env = z

// Required settings
TRIGGER_API_URL: z.string().url(),
TRIGGER_WORKER_TOKEN: z.string(), // accepts file:// path to read from a file
TRIGGER_WORKER_TOKEN: z.string().min(1), // accepts file:// path to read from a file
MANAGED_WORKER_SECRET: z.string(),

// Deployment token: sign a token into TRIGGER_DEPLOYMENT_ID at pod creation and verify it on
// inbound workload calls. "disabled" = off; "log" = mint + verify + metrics only; "enforce" =
// also reject invalid tokens.
WORKLOAD_TOKEN_SECRET: z.string().optional(),
WORKLOAD_TOKEN_ENFORCEMENT: z.enum(["disabled", "log", "enforce"]).default("disabled"),
// Absolute expiry for minted deployment tokens. Deterministic (no wall-clock issued-at) so every
// pod of a deployment carries an identical token; bump before this date. Must outlive any run.
WORKLOAD_TOKEN_EXP: z.string().datetime().default("2032-01-01T00:00:00.000Z"),
OTEL_EXPORTER_OTLP_ENDPOINT: z.string().url(), // set on the runners

// Workload API settings (coordinator mode) - the workload API is what the run controller connects to
Expand Down Expand Up @@ -365,6 +374,14 @@ export const Env = z
path: ["TRIGGER_WORKLOAD_API_DOMAIN"],
});
}
if (data.WORKLOAD_TOKEN_ENFORCEMENT !== "disabled" && !data.WORKLOAD_TOKEN_SECRET) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message:
"WORKLOAD_TOKEN_SECRET is required when WORKLOAD_TOKEN_ENFORCEMENT is not disabled",
path: ["WORKLOAD_TOKEN_SECRET"],
});
}
if (
data.TRIGGER_DEQUEUE_BACKPRESSURE_ENABLED &&
!data.TRIGGER_DEQUEUE_BACKPRESSURE_REDIS_HOST
Expand Down
17 changes: 16 additions & 1 deletion apps/supervisor/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { register } from "./metrics.js";
import { PodCleaner } from "./services/podCleaner.js";
import { FailedPodHandler } from "./services/failedPodHandler.js";
import { getWorkerToken } from "./workerToken.js";
import { mintDeploymentToken } from "./workloadToken.js";
import { OtlpTraceService } from "./services/otlpTraceService.js";
import {
WarmStartVerificationService,
Expand Down Expand Up @@ -96,6 +97,7 @@ class ManagedSupervisor {
COMPUTE_GATEWAY_AUTH_TOKEN,
DOCKER_REGISTRY_PASSWORD,
TRIGGER_DEQUEUE_BACKPRESSURE_REDIS_PASSWORD,
WORKLOAD_TOKEN_SECRET,
...envWithoutSecrets
} = env;

Expand Down Expand Up @@ -290,8 +292,10 @@ class ManagedSupervisor {
});
}

const workerToken = getWorkerToken();

this.workerSession = new SupervisorSession({
workerToken: getWorkerToken(),
workerToken,
apiUrl: env.TRIGGER_API_URL,
instanceName: env.TRIGGER_WORKER_INSTANCE_NAME,
managedWorkerSecret: env.MANAGED_WORKER_SECRET,
Expand Down Expand Up @@ -569,6 +573,7 @@ class ManagedSupervisor {
checkpointClient: this.checkpointClient,
computeManager: this.computeManager,
tracing: this.tracing,
snapshotCallbackSecret: workerToken,
wideEventOpts: this.wideEventOpts,
wideEventsNoisyRoutes: this.wideEventsNoisyRoutes,
});
Expand Down Expand Up @@ -603,6 +608,15 @@ class ManagedSupervisor {
throw new Error("Image is missing");
}

const deploymentToken = await mintDeploymentToken({
deployment: message.deployment.friendlyId,
deployment_version: message.backgroundWorker.version,
environment_id: message.environment.id,
environment_type: message.environment.type,
org_id: message.organization.id,
project_id: message.project.id,
});

await this.workloadManager.create({
dequeuedAt: message.dequeuedAt,
dequeueResponseMs: timings.dequeueResponseMs,
Expand All @@ -617,6 +631,7 @@ class ManagedSupervisor {
deploymentFriendlyId: message.deployment.friendlyId,
deploymentVersion: message.backgroundWorker.version,
runtime: message.backgroundWorker.runtime,
deploymentToken,
runId: message.run.id,
runFriendlyId: message.run.friendlyId,
version: message.version,
Expand Down
Loading
Loading