Files
bumble_mirror/bumble
ibondarenko1 8614881fb3 sdp: bound DataElement parse recursion to prevent RecursionError DoS
DataElement.from_bytes -> list_from_bytes -> (SEQUENCE/ALTERNATIVE
constructor dispatches back to list_from_bytes) had no depth limit. A
malicious SDP peer could send a PDU of a few kilobytes containing ~1000
nested SEQUENCE tags and exhaust the Python recursion stack, crashing the
host with an unhandled RecursionError propagating out of the SDP handler.

Reachable via: any remote Bluetooth device that Bumble performs SDP
service discovery against (default during Classic connection setup).

Same family as PR #912 (ATT_PDU.from_bytes empty PDU IndexError) - remote
unchecked-input parser crash in the Bluetooth stack.

Fix: thread-local depth counter, cap nesting at 32 (well above anything a
legitimate service record uses). Added two regression tests covering the
deep-nesting reject path and normal 16-level-nested SEQUENCE parsing.

Reproducer (4.5 KB payload, deterministic crash on 0.0.228):

    from bumble.sdp import DataElement
    inner = b"\x35\x00"
    for _ in range(1500):
        size = len(inner)
        if size < 65535:
            inner = bytes([0x36, (size >> 8) & 0xFF, size & 0xFF]) + inner
    DataElement.from_bytes(inner)  # RecursionError before fix

Signed-off-by: ibondarenko1 <ibondarenko1@users.noreply.github.com>
2026-04-23 00:53:06 -07:00
..
2026-01-01 03:25:32 +08:00
2026-01-12 13:16:49 +08:00
2026-02-10 17:35:39 +08:00
2026-01-01 03:25:32 +08:00
2026-01-12 13:16:49 +08:00
2026-01-12 13:16:49 +08:00
2026-02-25 00:39:45 +08:00
2026-01-27 09:47:52 -08:00
2026-01-01 03:25:32 +08:00
2026-03-11 21:41:48 +08:00
2026-01-01 03:25:32 +08:00
2026-01-01 03:25:32 +08:00
2026-04-03 23:06:24 +02:00
2026-01-01 03:25:32 +08:00
2026-01-15 12:06:05 +08:00
2026-01-01 03:25:32 +08:00
2026-01-12 13:16:49 +08:00
2026-01-22 23:16:25 +08:00
2026-01-01 03:25:32 +08:00
2026-03-01 02:24:55 +08:00
2025-07-27 15:02:42 -07:00
2026-02-10 20:08:01 +08:00
2026-01-12 13:16:49 +08:00
2025-08-21 16:38:58 -07:00
2026-01-22 17:49:58 +01:00
2026-01-01 03:25:32 +08:00