Reviewing WebRTC TURN server access and relay abuse
WebRTC protection spans signalling, relay use and the media sessions that depend on those decisions. Understanding WebRTC turn server access and relay abuse helps establish which security property the feature needs and where that property is actually enforced.
What does this involve?
Browser security is influenced by origins, embedded content, messaging and the way returned data is interpreted. A server can make a correct decision while client-side code later exposes the result to an unintended page or execution context.
This section defines security requirements for systems that operate their own TURN (Traversal Using Relays around NAT) servers. TURN servers assist in relaying media in restrictive network environments but can pose risks if misconfigured. These controls focus on secure address filtering and protection against resource exhaustion.
Why it matters
Consider a realistic failure: a communication feature authenticates its web page but permits unauthorised relay use or an unintended session participant.
A browser trust failure can affect signed-in users, private responses or actions taken with a user's session. The assessment should identify the relevant browser behaviour and the server-side permissions that remain in force.
A code audit connects a stated requirement to the implementation responsible for enforcing it. Source review and targeted behavioural checks should explain the same boundary and any relevant exceptions.
How penetration testers check for it
Review the specific control expectations below against the code, deployment and observable application behaviour.
- Confirm that the Traversal Using Relays around NAT (TURN) service only allows access to IP addresses that are not reserved for special purposes. Note that this applies to both IPv4 and IPv6 addresses.
- Confirm that the Traversal Using Relays around NAT (TURN) service is not susceptible to resource exhaustion when legitimate users attempt to open a large number of ports on the TURN server.
- Trace untrusted data into rendering and navigation.
- Check credentialed requests and sensitive state changes.
How to fix it
Implement the required boundary in the component that actually performs the sensitive operation and retain focused regression coverage.
- Keep trusted and untrusted content in appropriate contexts.
- Use safe rendering and precisely scoped browser policies.
- Validate messaging origins and intended recipients.
- Retain independent server-side identity and permission checks.
A policy finding needs application context. The absence of a particular header or browser feature is not, by itself, proof that protected data can be accessed.
Recheck the changed behaviour against the original failure conditions and the legitimate user journey. Keep enough evidence to show which release and configuration were verified, and include related entry points that depend on the same security decision.
Related issues
- Auditing WebRTC media transport and session protection
- Reviewing WebRTC signalling authentication and authorisation
- Reviewing log integrity, access control and retention
Read about our methodology or contact pentested.com to discuss the security of your application code.