Skip to content

CreatePermission 403 Forbidden #103

@lherman-cs

Description

@lherman-cs

This project is awesome! I had a nice time reading the codebase and particularly enjoyed the separation of turn vs `turn-server.

Describe the bug
I was able to receive the reflexive candidate from the TURN service. However, when my client tried to create a binding or CreatePermission request, The turn server responded with 403 Forbidden.

To Reproduce
My TURN setup currently is the following:

  1. Compile from the latest main: f113b2b
  2. Configure so the bind port listens to 0.0.0.0:3478 and the external IP is set to <external>:3478. The transport is set to UDP.
  3. Static auth config is demo=demo.
  4. The server ran without any containerization, just a barebone binary. The instance also has direct access to an external IP.
  5. Use either https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/ or https://github.com/pion/turn/tree/master/examples/turn-client/udp to run a ping test.

Expected behavior
TURN server to allow the allocation and let the media flow.

Additional context
From tracing the codebase, these lines caused the issue, https://github.com/mycrl/turn-rs/blob/main/turn/src/processor/create_permission.rs#L93-L99.

I didn't see anything in RFC that defines this behavior as a MUST. So, I'm expecting that there are some specific reasons for this implementation.

Regarding ip_is_local:

ctx contains my server's external IPs, whereas peer contains the reflexive IP. But, with !ip_is_local (as the name implies), the TURN server will always reject external IPs.

Then, I tried commenting out ip_is_local check:

I found that the bind_port look ups for the peer's port whereas the allocation used the server's port instead, https://github.com/mycrl/turn-rs/blob/main/turn/src/processor/allocate.rs#L88-L91.

Thus, bind_port also couldn't find anything and ended with another 403 Forbidden.

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions