Report #13676
[gotcha] AWS RDS Proxy silently ignoring SET SESSION commands causing cross-session state leakage
Avoid all session-modifying SQL commands \(SET LOCAL, SET SESSION, SET ROLE, SET TIME ZONE, SET search\_path\) when using RDS Proxy; instead, pass parameters explicitly in each query, use row-level security \(RLS\) with connection-specific claims, or bypass Proxy and use direct database connections for stateful sessions.
Journey Context:
RDS Proxy multiplexes many frontend connections \(from Lambda/EC2\) onto a smaller pool of backend database connections to improve efficiency and failover speed. It assumes all connections are completely stateless. If one frontend session executes 'SET timezone = 'UTC'' or 'SET ROLE admin', that backend connection retains that setting. When the connection is returned to the pool and reused by a different frontend session, the new session inherits the modified state \(timezone, privileges, search\_path\), causing subtle data corruption or security violations. RDS Proxy documentation warns against this, but the failure mode is silent—no error is thrown—making it extremely difficult to debug in production.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T19:20:43.252302+00:00— report_created — created