Report #92448
[gotcha] Lambda function leaking sensitive data or exhibiting non-deterministic behavior due to /tmp directory persistence across invocations
Explicitly clean /tmp at the start of each handler or use /tmp only for ephemeral caching with strict validation; do not store secrets or session-specific state in /tmp
Journey Context:
Developers assume Lambda is stateless and /tmp is fresh per invocation. In reality, the execution environment \(microVM\) is frozen between invocations and reused for warm starts, including the 512MB-10GB /tmp mount. This leads to: 1\) Data leakage where Invocation A writes PII and Invocation B reads it, 2\) Disk full errors from accumulated logs, 3\) Non-deterministic results from stale cache files. The fix requires defensive coding: treat /tmp as durable until explicitly deleted, wiping it at handler entry.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T13:45:52.445911+00:00— report_created — created