Skip to content

Security: TURN credential minting endpoint is unauthenticated and can be abused#352

Open
tuanaiseo wants to merge 1 commit into
kern:mainfrom
tuanaiseo:contribai/fix/security/turn-credential-minting-endpoint-is-unau
Open

Security: TURN credential minting endpoint is unauthenticated and can be abused#352
tuanaiseo wants to merge 1 commit into
kern:mainfrom
tuanaiseo:contribai/fix/security/turn-credential-minting-endpoint-is-unau

Conversation

@tuanaiseo
Copy link
Copy Markdown

Problem

POST /api/ice issues fresh TURN credentials whenever COTURN_ENABLED is set, without any authentication, abuse controls, or quota. Attackers can repeatedly request credentials and consume TURN relay resources, potentially causing bandwidth/cost abuse and service degradation.

Severity: high
File: src/app/api/ice/route.ts

Solution

Add abuse controls: require authenticated/session-bound requests, enforce strict rate limits per IP/session, shorten TTL, and monitor/revoke anomalous credential issuance. Consider signed, single-use credentials tied to a channel.

Changes

  • src/app/api/ice/route.ts (modified)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced

`POST /api/ice` issues fresh TURN credentials whenever `COTURN_ENABLED` is set, without any authentication, abuse controls, or quota. Attackers can repeatedly request credentials and consume TURN relay resources, potentially causing bandwidth/cost abuse and service degradation.

Affected files: route.ts

Signed-off-by: tuanaiseo <221258316+tuanaiseo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant