You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[crash] librtmp AMF_Decode: unbounded recursion on server data -> stack overflow #102
AMF_Decode/AMFProp_Decode/AMF_DecodeArray in plugins/obs-outputs/librtmp/amf.c recurse once per nesting level of the
AMF data, with no depth limit, on packet bodies supplied by the remote
RTMP server.
amf.c:697 (AMF_OBJECT), :725 (AMF_ECMA_ARRAY), :741
(AMF_STRICT_ARRAY) all recurse into AMF_Decode/AMF_DecodeArray
with attacker-controlled nesting; the AMF3 path mirrors it at amf.c:601, :787.
Reached from rtmp.c:1397/:1420 (HandleInvoke on invoke/command
packets), rtmp.c:3568 (HandleMetadata) and rtmp.c:4800
(stream metadata) — i.e. during the handshake and on every media
packet the server sends.
A nested object/array chain costs only a few bytes per level, so a 1 MB packet (m_nBodySize max 0xFFFFFF) provides hundreds of
thousands of recursion levels — well past the send thread's stack.
A malicious server (or MITM on plaintext RTMP) crashes OBS by answering connect with a deeply nested AMF object. Bounds arithmetic elsewhere in
the decoder is fine; this is purely missing recursion depth limiting.
Suggested fix: thread a depth counter through AMF_Decode / AMFProp_Decode / AMF_DecodeArray / AMF3_Decode / AMF3Prop_Decode
and fail with -1 past a bound (e.g. 128), or decode iteratively.
Note on upstream OBS Studio: this bug very likely affects obsproject/obs-studio too. We would report it there, but OBS Studio bans AI-assisted contributions, and in the owner's view they're probably too woke to handle it anyway, so we're keeping it here. Fix: #116.
Activity
test/cmocka: Add AMF nesting depth test
librtmp: Bound AMF/AMF3 decode recursion depth
test/cmocka: Add AMF nesting depth test
librtmp: Bound AMF/AMF3 decode recursion depth
chriscoveries commentedon Oct 11, 2026
Note on upstream OBS Studio: this bug very likely affects obsproject/obs-studio too. We would report it there, but OBS Studio bans AI-assisted contributions, and in the owner's view they're probably too woke to handle it anyway, so we're keeping it here. Fix: #116.
test/cmocka: Add AMF nesting depth test
librtmp: Bound AMF/AMF3 decode recursion depth
test/cmocka: Add AMF nesting depth test
librtmp: Bound AMF/AMF3 decode recursion depth