Summary
Pion DTLS could accept a resumed DTLS 1.2 session created by an outbound client connection as an authenticated session on a listener. If an application connects to a malicious server and shares a session store between its outbound connection and listener, that server may use the retained session secret to gain unauthorized access to the listener.
Affected context
The issue affects Pion DTLS deployments using DTLS 1.2 session resumption with a shared SessionStore for outbound client connections and inbound listener connections. The listener must be reachable, and the application must first complete an outbound connection to a malicious server. WebRTC users are not affected.
Exploit preconditions
- Attack surface: A reachable Pion DTLS listener that accepts resumed DTLS 1.2 sessions
- Required access: The attacker must operate or control a server the application connects to outbound
- Trigger point: The attacker presents the outbound session to the listener
- Why exploitation is possible: The shared session store does not ensure that a resumed session was created for the listener's expected peer role, so the listener may skip its usual PSK callback or client-certificate checks
Why this happens
The listener accepted a resumable session without verifying that the session was created for the client role expected by that listener. This is an authentication validation failure, mapping to CWE-287: Improper Authentication. In general, resumption state must be bound to the connection role and authentication context in which it was established; otherwise, a session trusted in one context may be reused in another.
Potential impact
- A peer trusted only for an outbound connection could gain unauthorized listener access
- The listener could accept application data without its normal PSK or client-certificate checks
- An attacker could interact with services or data exposed through the listener, depending on application behavior
General mitigation guidance
Defensive patterns include binding resumable sessions to the expected connection role and authentication context, and ensuring authentication requirements are enforced when a session is resumed. Avoid sharing session state across trust boundaries where possible; use isolated stores for distinct connection roles. Keep listener access limited to necessary peers, apply least privilege to services reachable through the listener, and treat outbound peers as untrusted unless separately authenticated.
How teams detect issues like this
- Review session-resumption logic for checks that bind cached sessions to connection role and authentication context.
- Inspect code and configuration for SessionStore instances shared between outbound clients and inbound listeners.
- Test that resumed connections cannot bypass required PSK callbacks or client-certificate validation.
- Use static analysis or automated review policies to flag session resumption paths that omit role or authentication checks.

