#505: Segfault with malformed rtcp packet (Open)
| Reported by: | Release: | 1.2 | |
|---|---|---|---|
| Priority: | Critical | Milestone: | 1.2.1 |
| Component: | SIP | Assigned to: | |
| Attachment: | rtp.c.diff [application/octet-stream] |
Hi,
I’m using the current release (1.2.1) of Callweaver and these days we had several segfaults due to malformed rtcp packets. The segfault was systematic with each buggy packet.
The problem is in corelib/rtp.c , there is not enough control with provided block length. With buggy packets (could be a DoS attack) the length value could be over 10000 (more than 10 times too big).
I’ve made a patch to correct it (attached file)
The patch ignores wrong block but not whole packet. The beginning of the packet is parsed and this permits to see in debug mode partial information about jitter and rtp packet loss because the support of rtcp is not full in callweaver.
I’ve tested the patch for 1 week in production without any issue.
Don’t hesitate to give me feedback about any issue with the patch.
Changelog:
- Release: set to 1.2
- Milestone: set to 1.2.1
- Priority: changed from Major to Critical
- Milestone: changed from 1.2.1 to Generic future releases
- Assigned user: set to mjagdis
- Milestone: changed from Generic future releases to 1.2.1
- Component: changed from core to SIP
- Assigned user: reset (from mjagdis)
This patch works perfectly for more than 4 month in production on several servers without any issue.
![Home ticket #505 [home]](/images/logo.png?1180520111)

RSS Feeds
Hi,
I’ve seen the same problem on trunk, the patch would also work on it.
I’m surprised this patch isn’t included in source code.
For information, the patch included with the first post is running on some systems for 2 months without any problem.
It’s seems important to me to mention this could be used in DoS attacks.
Regards
Eric