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/http-server-body: avoid FP on toserver direction #10879

Closed

Conversation

catenacyber
Copy link
Contributor

@catenacyber catenacyber commented Apr 17, 2024

Link to redmine ticket:
https://redmine.openinfosecfoundation.org/issues/6948

Describe changes:

  • detect/http-server-body: avoid false positive on toserver direction

SV_BRANCH=OISF/suricata-verify#1784

Ticket: 6948

http.response_body keyword did not enforce a direction, and thus
could match on files sent with POST requests
@@ -124,6 +124,9 @@ static int DetectHttpServerBodySetupSticky(DetectEngineCtx *de_ctx, Signature *s
return -1;
if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0)
return -1;
// file data is on both directions, but we only take the one to client here
s->flags |= SIG_FLAG_TOCLIENT;
s->flags &= ~SIG_FLAG_TOSERVER;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to do as flow:to_client

I did not want to error on s->flags & SIG_FLAG_TOSERVER as we can have s->flags = SIG_FLAG_TOSERVER | SIG_FLAG_TOCLIENT
But not 100% sure...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense.

Could you add a SV test that checks the engine analysis as well? Similar to https://github.com/OISF/suricata-verify/tree/master/tests/rules

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@victorjulien victorjulien added this to the 8.0 milestone Apr 18, 2024
@jasonish jasonish mentioned this pull request Apr 19, 2024
@victorjulien
Copy link
Member

Merged in #10921, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants