kbandla / dpkt

fast, simple packet creation / parsing, with definitions for the basic TCP/IP protocols
Other
1.08k stars 270 forks source link

SCTP.unpack infinite loop #583

Closed K-Reddy1 closed 3 years ago

K-Reddy1 commented 3 years ago

Describe the bug When parsing a malformed SCTP packet with a chunk that either has a size labeled as 0, this will cause an infinite loop.

To Reproduce Parse the sctp packet I described below (one with improperly labeled chunk size).

Expected behavior I expected the raw data in this packet to still be parsed, rather than looping infinitely or raising an exception.

Details(please complete the following information):

(size of chunk is labeled as 0)

Additional context I submitted a pull request that addresses this issue. I am using this library for cybersecurity purposes, so parsing malformed packets is useful.

obormot commented 3 years ago

Fixed in https://github.com/kbandla/dpkt/pull/582 Thanks for the contribution @K-Reddy1!
Closing the ticket.