aboutsip / pkts

Pure java based pcap library capable of reading and writing to/from pcaps.
Other
196 stars 91 forks source link

Update SipParser to allow for LF terminated SIP headers #110

Closed radonsky closed 4 years ago

radonsky commented 5 years ago

In our production system we caught a pcap that had a To: SIP header separated from the From: header by LF character (0x0A) instead of the usual CRLF (0x0D0A) combination. This caused this library to end up in a sort-of an infinite loop that caused our service's CPU to be pegged, essentially rendering our service useless.

W're not sure LF separators are allowed, but in order to fix this issue we decided to update the SipParser to consider LF to be a valid separator of SIP headers. This PR shows the changes that we made.

jonbo372 commented 4 years ago

Yeah, in rfc3261 it is not allowed but was in 2543.

from RFC3261 (page 256):

  o  In RFC 2543, lines in a message could be terminated with CR, LF,
      or CRLF.  This specification only allows CRLF.