Project

General

Profile

Actions

Bug #4562

closed

Memory leak in Protocol change during protocol detection

Added by Philippe Antoine over 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Target version:
Affected Versions:
Effort:
Difficulty:
Label:
Needs backport to 6.0

Description

Found by my fuzzing before oss-fuzz

Reproducer is
suricata -r oppchange.pcap -k none -c suricata.yaml
with attached pap

Key steps are
- first packet from server where protocol does not get recognized (like HTTP/1.2)
- second packet from client where protocol gets recognized like GET /
+ So Suricata calls TCPProtoDetectTriggerOpposingSide as it wants to parse the first data with the now recognized protocol
+ So this first parsing succeeds and ends up calling AppLayerRequestProtocolChange(hstate->f, dp, ALPROTO_HTTP2);
+ And TCPProtoDetect is not over and finishes by calling AppLayerParserParse with the data from the second packet * AppLayerParserParse creates a new state and leaks the old one, trusting its caller to clean the memory * But TCPProtoDetect does not clean the memory :-/


Files

oppchange.pcap (482 Bytes) oppchange.pcap Philippe Antoine, 07/16/2021 12:12 PM

Related issues 1 (0 open1 closed)

Copied to Suricata - Bug #4637: Memory leak in Protocol change during protocol detectionClosedShivani BhardwajActions
Actions #1

Updated by Philippe Antoine over 3 years ago

  • Status changed from New to In Review

Gitlab

Actions #2

Updated by Jeff Lucovsky over 3 years ago

  • Copied to Bug #4637: Memory leak in Protocol change during protocol detection added
Actions #4

Updated by Philippe Antoine about 3 years ago

  • Private changed from Yes to No
Actions

Also available in: Atom PDF