Fix sensitive data written to a log in TanStack Start

A password, token, cookie, or similar value is passed to a log sink. Centralised logs are widely readable inside an organisation and often retained for months - a credential that lands there is a credential that has left the application's control.

medium likely TanStack Start CWE-532 / OWASP A09:2021

The vulnerable pattern in TanStack Start

MEDIUM likely Sensitive data written to a log A09:2021 app/routes/api/session.ts:11:18 9 │ 10 │ // sensitive-data-logged: the password reaches the process log. 11 │ console.info({ password: body.password }) │ ~~~~~~~~~~~~~~~~~~~~~~~ sensitive value written to a log 12 │ 13 │ // sensitive-data-logged: an access token, logged the same way.

This finding comes from the TanStack Start fixture in the owlwarden test suite. Logs are copied into aggregators, retained for months, and readable by anyone with access to the logging system. A credential that reaches a log has left the application's trust boundary.

The corrected handler

Log that a field was present, not the field.

console.info({ hasPassword: Boolean(body.password) })

If you are not using TanStack Start

Log a redacted shape - an id, a boolean, a length - never the secret itself.

Check your own repository

npx owlwarden scan
npx owlwarden explain sensitive-data-logged

Runs on your machine. No account, no telemetry, no network unless you ask. In CI, SARIF uploads to code scanning and the exit code is the gate.

Other TanStack Start checks

Rules with a tested TanStack Start example.

sensitive-data-logged for every framework / All rules / owlwarden