-
Notifications
You must be signed in to change notification settings - Fork 209
Multiple memory issues in rtsp server #130
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't workingethEthernetEthernetlwipLightweight TCP/IPLightweight TCP/IPneeds clarificationNeeds clarification or inputs from the userNeeds clarification or inputs from the userprojectsProjects-related (demos, applications, examples) issue or pull-request.Projects-related (demos, applications, examples) issue or pull-request.
Description
Activity
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingethEthernetEthernetlwipLightweight TCP/IPLightweight TCP/IPneeds clarificationNeeds clarification or inputs from the userNeeds clarification or inputs from the userprojectsProjects-related (demos, applications, examples) issue or pull-request.Projects-related (demos, applications, examples) issue or pull-request.
Type
Projects
- StatusShow more project fieldsAnalyzed
Board: STM32F769I_EVAL
Compiler: arm-none-eabi-gcc v13
Describe the bug
A buffer overflow occurs in the RTSP server response construction. The server builds responses using repeated
sprintf,strcat, andstrlenappends without tracking the destination buffer's capacity. Additionally, the unsupportedRequire-header path copies unbounded request data until a Carriage Return (CR) character is encountered.How To Reproduce
Indicate the global behavior of your application project:
RTSP Streaming Server via LwIP.
The modules that you suspect to be the cause of the problem (Driver, BSP, MW ...):
Middleware/Application:
LwIP_StreamingServerFile:
Projects/STM32F769I_EVAL/Applications/LwIP/LwIP_StreamingServer/Src/rtsp_protocol.cThe use case that generates the problem:
Receiving a remote RTSP request containing a highly expanded header field, specifically an overly long
Requirevalue.How we can reproduce the problem:
Requirevalue that does not containimplicit-play, or include other fields that expand the response construction.response + strlen(response)until a CRLF sequence is reached, performing no checks against the remaining buffer capacity.Additional context
c2ecfd2dsnprintf,strncat).memset(response, 0, sizeof(&response))call, which currently clears only pointer-sized bytes rather than the full buffer whenresponseis passed as a pointer.