{"id":"GHSA-pfvm-w89x-94jw","revision":null,"records":[{"revision":"6fcb5ee9ff944d6b9e99ef58e2d8bae1","observedAt":"2026-10-23T16:01:25.029+00:00","statement":{"source":"osv","id":"GHSA-pfvm-w89x-94jw","aliases":[],"title":"SIPSorcery: Malformed UDP datagram crashes TurnServer receive loop with no restart, disabling TURN UDP relay for all clients (DoS)","description":"## Summary\n`TurnServer.ReceiveUdpAsync` places its generic `catch (Exception)` OUTSIDE the `while` receive loop, and `Start()` launches the loop fire-and-forget with no supervision or restart. A single pre-authentication UDP datagram whose STUN header first byte is in `0x80–0xFF` causes `STUNHeader.ParseSTUNHeader` to throw `ApplicationException`, which unwinds past the loop and terminates it. The TURN UDP relay is then dead for ALL clients until the process is restarted.\n\n## Root Cause\n`src/SIPSorcery/net/TURN/TurnServer.cs`:\n- `ReceiveUdpAsync` (:555-577): the inner `try` (:562-567) wraps only `_udpSocket.ReceiveAsync()`; `HandleUdpDatagram(result.Buffer, result.RemoteEndPoint)` (:569) is inside the `while` body but OUTSIDE that inner try. The generic `catch (Exception ex)` (:573) is lexically OUTSIDE the `while`.\n- `Start()` does `_ = ReceiveUdpAsync();` (:381) — fire-and-forget, no restart.\n- `HandleUdpDatagram` (:579) calls `STUNMessage.ParseSTUNMessage(data, data.Length)` (:600) for any non-ChannelData datagram; `ParseSTUNMessage` (STUNMessage.cs:94) has no try/catch.\n\n## Impact\n`ApplicationException` propagates out of the `while`, is caught at :573, logged, and the method returns. `_running` remains true but nothing re-invokes `ReceiveUdpAsync` → TURN UDP relay permanently unavailable for all clients (whole-server DoS). Pre-authentication: STUN parsing precedes any TURN allocation/credential check.\n\n## Proof of Concept\nSend one UDP datagram to the TURN port (default 3478) with first byte `0x80` (e.g. `80 00 00 00`). `0x80 & 0xC0 = 0x80 ≠ 0x40` → not ChannelData → `ParseSTUNMessage` → `ParseSTUNHeader` executes `if ((Array[startIndex] & 0xC0) != 0) throw new ApplicationException(...)` (STUNHeader.cs:169-172); `0x80 & 0xC0 = 0x80 ≠ 0` → throws.\n\n## Attack Chain\n1. Entry: one UDP datagram to the TURN port, first byte `0x80–0xFF`. Guard: ChannelData branch requires `(data[0] & 0xC0) == 0x40` (:583). Bypass: `0x80 & 0xC0 = 0x80 ≠ 0x40` → falls through to `ParseSTUNMessage` (:600).\n2. Sink: `STUNMessage.ParseSTUNMessage` → `STUNHeader.ParseSTUNHeader` (STUNHeader.cs:169-172) throws `ApplicationException`. Guard: none before the throw; `ParseSTUNMessage` has no try/catch. Bypass: `0x80 & 0xC0 = 0x80 ≠ 0` → throws.\n3. Impact: exception unwinds past the `while` into `catch(Exception)` at :573 → logged → method returns → loop exits. Guard: none — no restart (`Start()` :381 fire-and-forget). Bypass: N/A. TURN UDP relay dead for all clients until process restart.\n\n## Bypass Evidence\n- Loop/catch structure: catch at TurnServer.cs:573 is outside the `while` at :559; `HandleUdpDatagram` at :569 is outside the inner try (:562-567).\n- Unguarded `ParseSTUNMessage` at :600; throw at STUNHeader.cs:169-172.\n- Fire-and-forget start at :381 with no restart in `Start()`.\n- `TurnServerConfig.ListenAddress` defaults to `IPAddress.Loopback` (:42), but a functioning TURN server must bind a routable address to serve clients, so real deployments are exposed. Non-default config narrows the vulnerable population, not the attack difficulty → AC:L.\n\n## Affected Versions\n`nuget:SIPSorcery <= 10.0.13` (TurnServer component present since 10.0.5; verified on release tag v10.0.13 and HEAD).\n\n## Dedup\nNOT a duplicate of GHSA-28gm-jrmw-xx93 (CVE-2026-54632), which covers the client RTP/ICE socket (`UdpReceiver`/`RTPChannel`). `TurnServer` is a distinct shipped RFC 5766 server component with its own loop and fix location.\n\n## Suggested Fix\nWrap `HandleUdpDatagram` in a per-datagram try/log-and-continue INSIDE the `while` (matching the drop-and-continue intent of fix bdb76cb), and/or add loop supervision/restart.\n\n---\nReported by **zx (Jace)** — GitHub: @manus-use","state":0,"publishedAt":"2026-08-12T19:31:48+00:00","modifiedAt":"2026-08-12T19:45:11.3416794+00:00","affected":[{"ecosystem":"NuGet","name":"SIPSorcery","ranges":[{"type":"ECOSYSTEM","events":[{"kind":"introduced","version":"10.0.5"},{"kind":"fixed","version":"10.0.14"}]}],"versions":["10.0.10","10.0.11","10.0.12","10.0.13","10.0.5","10.0.6","10.0.7","10.0.8","10.0.9"],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://github.com/sipsorcery-org/sipsorcery/security/advisories/GHSA-pfvm-w89x-94jw","https://github.com/sipsorcery-org/sipsorcery/commit/ccb0b5a845efa2fb131fd00de4f5321bae627f29","https://github.com/sipsorcery-org/sipsorcery"],"sourceUrl":"https://github.com/advisories/GHSA-pfvm-w89x-94jw","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-pfvm-w89x-94jw","identifiers":["GHSA-pfvm-w89x-94jw"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-11-22T05:27:14.4728645+00:00","complete":true,"records":1790,"lastAttemptAt":"2026-11-22T05:27:14.4728645+00:00","lastSuccessAt":"2026-11-22T05:27:14.6107479+00:00","error":null,"lastVerifiedAt":"2026-11-22T05:27:14.6107491+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-a00cc431548e20f01f2da20f449eca4a9c3c2d80f0a99ee8150099224d339982-b191656a7040c574e13b668ab781a95f29ba8dbef68a43862670e2413145262d","complete":true,"records":430427,"lastAttemptAt":"2026-11-22T05:25:37.678505+00:00","lastSuccessAt":"2026-11-22T05:25:37.6547981+00:00","error":null,"lastVerifiedAt":"2026-11-22T05:25:37.678505+00:00","snapshotPublishedAt":"2026-11-22T05:22:23+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-efc8370ba7e74efd8a204158e9b65b20","complete":false,"records":13927,"lastAttemptAt":"2026-11-22T05:38:38.1059674+00:00","lastSuccessAt":"2026-11-22T05:38:38.102+00:00","error":"73 identifier lookups failed; latest failures include AccessDenied (HTTP 403). Other identifiers were checked independently.","lastVerifiedAt":"2026-11-22T05:38:38.102+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13706,"expectedIdentifiers":13975,"failedIdentifiers":73},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-11-22T05:27:14.4728645+00:00","complete":true,"records":1131,"lastAttemptAt":"2026-11-22T05:27:14.4728645+00:00","lastSuccessAt":"2026-11-22T05:27:14.7528028+00:00","error":null,"lastVerifiedAt":"2026-11-22T05:27:14.7528029+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-3ae09e4868224a68aa79c1beaa1ed9c1","complete":true,"records":13939,"lastAttemptAt":"2026-11-22T05:27:33.8102267+00:00","lastSuccessAt":"2026-11-22T05:27:33.807+00:00","error":null,"lastVerifiedAt":"2026-11-22T05:27:33.807+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13975,"expectedIdentifiers":13975,"failedIdentifiers":0},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-e5345bb505029da8292989aaa8236ee0c21dd40080e465858702ec2ecb4dcefd","complete":true,"records":9989,"lastAttemptAt":"2026-11-22T05:27:14.3307731+00:00","lastSuccessAt":"2026-11-21T19:16:03.0413179+00:00","error":null,"lastVerifiedAt":"2026-11-22T05:27:14.3307731+00:00","snapshotPublishedAt":"2026-11-21T18:18:24+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-6ba2352decd0c95d34a1b50f642582aa34659ce946f552488f0a5cea4e0cc09a","complete":true,"records":2020,"lastAttemptAt":"2026-11-22T05:25:37.805711+00:00","lastSuccessAt":"2026-11-20T15:46:15.4249619+00:00","error":null,"lastVerifiedAt":"2026-11-22T05:25:37.805711+00:00","snapshotPublishedAt":"2026-11-20T14:48:20+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-67ea94df7f6b2100258b087b14035af283f000b6aefe39f55e9f2795f912fde8","complete":true,"records":3209,"lastAttemptAt":"2026-11-22T05:27:14.4396539+00:00","lastSuccessAt":"2026-11-21T19:16:06.9994675+00:00","error":null,"lastVerifiedAt":"2026-11-22T05:27:14.4396539+00:00","snapshotPublishedAt":"2026-11-21T18:18:24+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-c6e6524a8cc790a5155fe5929547cc5f963dbc50bf1bac44215f68577b7d2a8c","complete":true,"records":232857,"lastAttemptAt":"2026-11-22T05:27:14.2045082+00:00","lastSuccessAt":"2026-11-22T05:27:13.1364419+00:00","error":null,"lastVerifiedAt":"2026-11-22T05:27:14.2045082+00:00","snapshotPublishedAt":"2026-11-22T04:33:39+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}