Project

General

Profile

Actions

Bug #9515

open
JL JL

pop3: parser stops when a status line is split across segments

Bug #9515: pop3: parser stops when a status line is split across segments

Added by Jeff Lucovsky about 10 hours ago.

Status:
New
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

If the first line of a POP3 server response arrives in two TCP segments, the parser stops for the rest of the flow. No more POP3 transactions are logged, and app_layer.error.pop3.parser goes up by one.

Example, one server segment per line:

C: LIST\r\n
S: +OK 2 mes
S: sages\r\n1 100\r\n2 200\r\n.\r\n
C: QUIT\r\n
S: +OK bye\r\n

LIST is logged without a response and QUIT is not logged. The same response in one segment is parsed normally.

Cause: find_end_of_header (rust/src/pop3/pop3.rs:151-155) returns Needed::Unknown when the line has no CRLF yet. parse_response only waits for more data on Needed::Size and returns an error otherwise (rust/src/pop3/pop3.rs:466-473).

Fix: wait for more data when the line has no CRLF yet, and cap the line at 512 octets including the CRLF (RFC 2449 section 4), raising an event and stopping when a line is longer.

Affected: main. main-8.0.x has the same code but has not been tested.

No data to display

Actions

Also available in: PDF Atom