Project

General

Profile

Actions

Optimization #7251

open

dcerpc: mimic gap behavior if invalid data is sent to protocol parser

Added by Shivani Bhardwaj over 1 year ago. Updated 1 day ago.

Status:
In Review
Priority:
Normal
Target version:
Effort:
Difficulty:
low
Label:

Description

Let's assume that the RFC XXX of a Protocol P defines that its:
  • header is 4 bytes in total
  • byte 1 tells protocol version
  • byte 2 tells the type of request/response
  • bytes 3 and 4 of its header tell how big the entire fragment is
  • rest of the bytes are the fragment data

Request 1:

--------------------------
|       Header (4B)      |  <- this tells that the total length of the fragment is 20 bytes
--------------------------
|                        |
|                        |
|         DATA           |
|                        |
--------------------------

Observation: Request 1 is hence completed.

Request 2:

--------------------------
|                        |
|                        |
|         DATA           |
|                        |
--------------------------

Observation: The header of this request gives a protocol version and request type that are invalid so the protocol parser rejects it and returns an error.

Behavior to be implemented: In case of Request 2, the parser should mimic gap behavior i.e. skip over the invalid data for as long as it lasts.

Challenges:

  • No way to know the length of the invalid data beforehand.

Possible solutions:

  • Maybe Applayer:: API can be extended to have a fn that allows to skip over data until a certain byte pattern is found. To be discussed.
  • The protocol parser can itself just not do anything w the data and ask for more data until it has valid data.

Related issues 1 (1 open0 closed)

Related to Suricata - Bug #7254: dcerpc: parser does not support multiple PDUsIn ReviewPhilippe AntoineActions
Actions #1

Updated by Victor Julien 12 months ago

  • Target version changed from 8.0.0-beta1 to 8.0.0-rc1
Actions #2

Updated by Victor Julien 9 months ago

  • Target version changed from 8.0.0-rc1 to 9.0.0-beta1
Actions #3

Updated by Shivani Bhardwaj about 1 month ago

  • Status changed from Assigned to In Progress
Actions #4

Updated by Shivani Bhardwaj about 1 month ago

  • Difficulty set to low
Actions #5

Updated by Shivani Bhardwaj about 1 month ago

  • Status changed from In Progress to In Review
Actions #6

Updated by Philippe Antoine 24 days ago

I am not sure I understand this ticket :
If

The header of this request gives a protocol version and request type that are invalid

Then we should just error and stable parsing for the rest of the flow...

Actions #9

Updated by Philippe Antoine 1 day ago

  • Related to Bug #7254: dcerpc: parser does not support multiple PDUs added
Actions #10

Updated by Philippe Antoine 1 day ago

I think this issue should be rejected in favor of #7254

Actions

Also available in: Atom PDF