Commit 0014c75
fix: bound sprop-parameter-sets copy to prevent SDP stack overflow
SessionDescriptor::generateFormatContext() copied the camera-controlled
SDP sprop-parameter-sets value into a fixed char pvalue[1024] stack
buffer with an unbounded strcpy(), so a malicious or MitM'd RTSP camera
returning an oversized sprop-parameter-sets in its DESCRIBE response
could overflow the stack (saved frame pointer / return address) for RCE
as the capture process user.
A real H.264 SPS/PPS base64 blob is small; refuse anything that would
not fit the buffer instead of copying it. The existing inner base64
parse loop was already bounded, so only this outer copy was unsafe.
Refs GHSA-wg5h-vcgv-74pv.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 8030901 commit 0014c75
1 file changed
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
370 | | - | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
371 | 381 | | |
372 | 382 | | |
373 | 383 | | |
| |||
0 commit comments