Project

General

Profile

Actions

Bug #9475

open
JL JL

pop3: parser stops when a RETR end marker arrives after the body

Bug #9475: pop3: parser stops when a RETR end marker arrives after the body

Added by Jeff Lucovsky about 10 hours ago.

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

Description

The POP3 parser stops when the end of a RETR response arrives in a later segment than the end of its counted message body. After that, no POP3 transactions are logged for the flow, and app_layer.error.pop3.parser goes up by one.

Example, one server segment per line:

C: RETR 1\r\n
S: +OK 5 octets\r\nxy
S: z\r\n
S: .\r\n
C: QUIT\r\n
S: +OK bye\r\n

The QUIT transaction is not logged. The same happens when the ".\r\n" itself is split, for example "z\r\n." followed by "\r\n". Normal traffic can hit this when a message body ends near a segment boundary.

Cause: when the counted body ends, the RETR transaction is marked complete (rust/src/pop3/pop3.rs:347) before the ".\r\n" is seen, and the bytes that follow are parsed as the start of a new response, which fails.

Fix: keep the transaction open after the body, and only look for ".\r\n" until it arrives.

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