Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detect/bsize: Validate against content buffer when available #4953

Closed
wants to merge 3 commits into from

Conversation

jlucovsky
Copy link
Contributor

Continuation of #4950

This PR adds additional validation when using the bsize keyword. If a content keyword immediately precedes bsize, then the bsize value is checked to see if a match is possible using the operation (=, <, >, <>) and the value.

An error is raised if bsize value prevents a match, e.g., the content length exceeds the bsize value.

Link to redmine ticket: 3682

Describe changes:

  • Rewords commits to remove markdown.

Companion Suricata PR #233

This commit updates the bsize documentation

1. Describe what happens when "content" immediately precedes "bsize"
2. Include the operators and
3. Include examples using the operators.
This commit causes the signature to be invalid if a content keyword
immediately precedes bsize and the bsize value is incompatible with the
content length.
This commit adds test cases that validate behavior when "content"
immediately precedes "bsize".
src/tests/detect-bsize.c Show resolved Hide resolved
src/detect-bsize.c Show resolved Hide resolved
src/detect-bsize.c Show resolved Hide resolved
@jlucovsky
Copy link
Contributor Author

Continued in #4963

@jlucovsky jlucovsky closed this May 20, 2020
victorjulien added a commit to victorjulien/suricata that referenced this pull request Jan 13, 2022
Pruning of StreamBufferBlocks could remove blocks that fell entirely
after the target offset due to a logic error. This could lead to data
being evicted that was still meant to be processed in theapp-layer
parsers.

Bug: OISF#4953.
jlucovsky pushed a commit to jlucovsky/suricata that referenced this pull request Jan 14, 2022
Pruning of StreamBufferBlocks could remove blocks that fell entirely
after the target offset due to a logic error. This could lead to data
being evicted that was still meant to be processed in theapp-layer
parsers.

Bug: OISF#4953.
(cherry picked from commit 78f5e08)
jlucovsky pushed a commit to jlucovsky/suricata that referenced this pull request Jan 15, 2022
Pruning of StreamBufferBlocks could remove blocks that fell entirely
after the target offset due to a logic error. This could lead to data
being evicted that was still meant to be processed in theapp-layer
parsers.

Bug: OISF#4953.
(cherry picked from commit 78f5e08)
inashivb pushed a commit to inashivb/suricata that referenced this pull request Jan 18, 2022
Pruning of StreamBufferBlocks could remove blocks that fell entirely
after the target offset due to a logic error. This could lead to data
being evicted that was still meant to be processed in theapp-layer
parsers.

Bug: OISF#4953.
(cherry picked from commit 78f5e08)
inashivb pushed a commit to inashivb/suricata that referenced this pull request Jan 18, 2022
Pruning of StreamBufferBlocks could remove blocks that fell entirely
after the target offset due to a logic error. This could lead to data
being evicted that was still meant to be processed in theapp-layer
parsers.

Bug: OISF#4953.
(cherry picked from commit 78f5e08)
inashivb pushed a commit to inashivb/suricata that referenced this pull request Jan 18, 2022
Pruning of StreamBufferBlocks could remove blocks that fell entirely
after the target offset due to a logic error. This could lead to data
being evicted that was still meant to be processed in theapp-layer
parsers.

Bug: OISF#4953.
(cherry picked from commit 78f5e08)
inashivb pushed a commit to inashivb/suricata that referenced this pull request Jan 20, 2022
Pruning of StreamBufferBlocks could remove blocks that fell entirely
after the target offset due to a logic error. This could lead to data
being evicted that was still meant to be processed in theapp-layer
parsers.

Bug: OISF#4953.
(cherry picked from commit 78f5e08)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants