/

CVE-2026-27624

Severity:

HIGH RISK

(7.2)

Access Control Bypass in Coturn TURN/STUN Server

CVE-2026-27624

Analyzed

Vulnerability type

Category:

Access Control Bypass

CWE:

CWE-284, CWE-441

Impact:

Bypass of network access controls and potential exposure of internal services over TURN

Severity:

HIGH RISK

(7.2)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A logic flaw in Coturn's address handling allows IPv4-mapped IPv6 addresses (such as ::ffff:127.0.0.1) to bypass loopback and internal range restrictions configured with denied-peer-ip and default loopback protections.

Under these conditions, an attacker can create TURN permissions or channels to otherwise blocked internal or loopback endpoints, potentially exposing internal services to unauthorized relay traffic.

Affected context

This vulnerability affects Coturn deployments that:

  • Rely on denied-peer-ip and/or built-in loopback protections to block access to loopback or internal IP ranges, and
  • Process TURN CreatePermission or ChannelBind requests, and
  • Run versions where IPv4-mapped IPv6 addresses (e.g., ::ffff:127.0.0.1) are not normalized and checked consistently against access control rules.

The issue appears when TURN peers are specified using IPv4-mapped IPv6 forms instead of plain IPv4, allowing traffic that is intended to be blocked by policy.

Exploit preconditions

  • Attack surface: TURN server interface exposed to clients on the network or internet.
  • Required access: Ability to authenticate or otherwise use the TURN service to send CreatePermission or ChannelBind requests (depending on deployment, this may be open or restricted).
  • Trigger point: Supplying a XOR-PEER-ADDRESS field using an IPv4-mapped IPv6 address (e.g., ::ffff:127.0.0.1) that corresponds to an IPv4 address covered by denied-peer-ip or loopback restrictions.
  • Why exploitation is possible: Internal address classification and range-matching functions (ioa_addr_is_loopback(), ioa_addr_is_zero(), addr_less_eq()/ioa_addr_in_range()) do not recognize IPv4-mapped IPv6 addresses as equivalent to their IPv4 counterparts before enforcing deny rules, causing the access checks to be skipped or mis-evaluated.

Why this happens

The root cause is inconsistent handling of address families and IPv4-mapped IPv6 addresses in Coturn's access control logic.

Several key functions in src/client/ns_turn_ioaddr.c treat IPv4 (AF_INET) and IPv6 (AF_INET6) addresses as separate categories without first normalizing or extracting embedded IPv4 from IPv4-mapped IPv6 addresses:

  • ioa_addr_is_loopback() only checks 127.x.x.x and ::1, but not ::ffff:127.0.0.1.
  • ioa_addr_is_zero() only checks 0.0.0.0 and ::, but not ::ffff:0.0.0.0.
  • addr_less_eq() (used by ioa_addr_in_range() for denied-peer-ip matching) compares AF_INET ranges to AF_INET6 peers without resolving IPv4-mapped addresses to the underlying IPv4 value, returning 0 and effectively skipping enforcement.

This design flaw maps to CWE-284: Improper Access Control, as access decisions are incorrectly evaluated for a subset of addresses, and is related to CWE-441: Unintended Proxy or Intermediary because the TURN server may relay traffic to internal endpoints that should not be reachable.

Potential impact

  • TURN relaying to loopback addresses (e.g., 127.0.0.1) that are intended to be blocked by policy.
  • Access to internal or management services bound only to localhost, via TURN as an unintended proxy.
  • Bypass of configured denied-peer-ip rules and loopback protections using IPv4-mapped IPv6 notation.
  • Expanded attack surface for internal reconnaissance, exploitation, or brute-force against services assumed to be locally reachable only.
  • Increased risk of data exposure or service compromise if sensitive internal endpoints are accessed through the TURN server.

General mitigation guidance

Effective mitigation typically involves tightening address normalization and access control evaluation rather than relying on specific patterns or blocklists alone.

Defenders commonly:

  • Normalize and canonicalize all incoming peer addresses before policy evaluation, converting IPv4-mapped IPv6 to a consistent internal representation.
  • Apply loopback and private-range checks uniformly to IPv4, IPv6, and IPv4-mapped IPv6 addresses.
  • Design deny/allow logic to be default-deny for ambiguous address forms, only granting access when classification is unambiguous.
  • Treat the TURN server as a sensitive network boundary component and restrict which back-end networks and addresses it is allowed to reach (e.g., avoid allowing relays to loopback or management subnets at all).
  • Reduce privileges of the TURN service at the OS and network layer (e.g., firewall rules, routing constraints) so that even if logical checks fail, the process cannot reach internal-only interfaces.

How teams detect issues like this

Detection usually focuses on both code-level and operational signals:

  • Static/code analysis:
  • Search for address comparison logic that branches on AF_INET vs AF_INET6 without explicitly checking IN6_IS_ADDR_V4MAPPED or equivalent helpers.
  • Flag any access control routines (*_in_range, *_is_loopback, or similar) that do not normalize IPv4-mapped IPv6 addresses prior to evaluation.
  • Use static analysis rules to identify IP/port filtering implemented separately for IPv4 and IPv6 without a shared canonical path.
  • Code review cues:
  • Review network boundary code for assumptions that "IPv4 and IPv6 are disjoint," especially around deny/allow lists.
  • Confirm that loopback and special addresses (0.0.0.0, ::, 127.0.0.1, ::1) are treated equivalently across all supported address families.
  • Runtime/operational monitoring:
  • Log CreatePermission and ChannelBind requests, including resolved peer addresses, and alert on IPv4-mapped IPv6 forms targeting loopback or internal ranges.
  • Implement anomaly detection for TURN relays to local or management endpoints.

Automated review and SAST tools can be configured with custom rules to highlight inconsistent address-family handling and missing IPv4-mapped IPv6 checks in network access control logic.

Sources

SourceLink
github.comgithub.com/coturn/coturn/commit/b80eb898ba26552600770162c26a8ae7f3661b0b
github.comgithub.com/coturn/coturn/security/advisories/GHSA-6g6j-r9rf-cm7p
github.comgithub.com/coturn/coturn/security/advisories/GHSA-j8mm-mpf8-gvjg

Frequently asked

questions

Yes. If the TURN service is exposed to clients (e.g., on the public internet) and allows them to issue CreatePermission or ChannelBind requests, a remote attacker can exploit this issue by using IPv4-mapped IPv6 addresses for blocked targets.

The attacker needs the ability to act as a TURN client against the vulnerable server. Depending on configuration, this may require TURN credentials, or the service may be more broadly accessible. No shell or OS-level access to the server is required.

Ensure that all address handling and access control routines normalize addresses to a canonical form before comparison, including explicitly recognizing IPv4-mapped IPv6 addresses and applying loopback and deny-list checks consistently across all address families.

Adopt a defensive design for network-boundary code that:

  • Centralizes address parsing and normalization in a shared, well-tested utility layer.
  • Applies default-deny rules for ambiguous or unrecognized address forms.
  • Includes unit and integration tests for special-case addresses (loopback, zero, private ranges) across IPv4, IPv6, and IPv4-mapped IPv6.
  • Uses security-focused code review and automated analysis to catch inconsistent address-family handling early in development.
Find out what's already
exploitable in your codebase.