mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +00:00
Fix handling of IP packets with bogus IP header lengths
Credit to OSS-Fuzz for discovery https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=34711 (Link to details becomes public 30 days after patch release)
This commit is contained in:
parent
f861a194f9
commit
0e34f2e02f
5 changed files with 24 additions and 1 deletions
|
@ -235,6 +235,13 @@ bool IPAnalyzer::AnalyzePacket(size_t len, const uint8_t* data, Packet* packet)
|
|||
|
||||
packet->proto = proto;
|
||||
|
||||
// Double check the lengths one more time before forwarding this on.
|
||||
if ( packet->ip_hdr->TotalLen() < packet->ip_hdr->HdrLen() )
|
||||
{
|
||||
Weird("bogus_IP_header_lengths", packet);
|
||||
return false;
|
||||
}
|
||||
|
||||
switch ( proto ) {
|
||||
case IPPROTO_NONE:
|
||||
// If the packet is encapsulated in Teredo, then it was a bubble and
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue