]> git.ipfire.org Git - thirdparty/snort3.git/commit
Pull request #3428: JS Norm: Check Content-Type
authorMike Stepanek (mstepane) <mstepane@cisco.com>
Tue, 24 May 2022 14:30:17 +0000 (14:30 +0000)
committerMike Stepanek (mstepane) <mstepane@cisco.com>
Tue, 24 May 2022 14:30:17 +0000 (14:30 +0000)
commitc0a43964f8a152af3bb1f8da2f50c39dc52a180c
tree4a85846aa7e254ad4ae10d58497809b6367625e8
parentb7b36014624cb2a95d1fd55478654da0c7eee8f1
Pull request #3428: JS Norm: Check Content-Type

Merge in SNORT/snort3 from ~OSERHIIE/snort3:js_content_type to master

Squashed commit of the following:

commit 457cf486d8846108cb3cda7ea9bf99aaae4c5985
Author: Oleksandr Serhiienko <oserhiie@cisco.com>
Date:   Tue May 17 22:59:38 2022 +0300

    http_inspect: implement general approach of checking Content-Type header

        Adding a general approach of checking Content-Type header values.
        Comparison uses normalized header value and returns appropriate
        code value if matched. The headers comparison is strict and precise.
        Additional header parameters, like charset, are ignored. Comparison
        happens against MIME type/subtupe only.

commit 79fae25f1bf59d6bcf34f2f6b92a2b8666ee830d
Author: Oleksandr Serhiienko <oserhiie@cisco.com>
Date:   Tue May 17 13:29:09 2022 +0300

    http_inspect: add Content-Type header validation for Enhanced JS Normalizer

        Avoid lookup for Inline JavaScript if media-type is not of HTML type.

        Accepted media-types follows:
            * application/xhtml+xml
            * text/html

        If Content-Type header is not specified, default media-type will be
        application/octet-stream which is not allowed. The normalization
        will be skipped.
src/service_inspectors/http_inspect/http_enum.h
src/service_inspectors/http_inspect/http_msg_body.cc
src/service_inspectors/http_inspect/http_msg_head_shared.cc
src/service_inspectors/http_inspect/http_msg_head_shared.h
src/service_inspectors/http_inspect/http_tables.cc