From: Mike Stepanek (mstepane) Date: Thu, 31 Mar 2022 18:22:07 +0000 (+0000) Subject: Pull request #3335: Script opening tag pattern. X-Git-Tag: 3.1.27.0~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e6a2a72823f3ac663ea8e6de6f106bc9c7eaf6b;p=thirdparty%2Fsnort3.git Pull request #3335: Script opening tag pattern. Merge in SNORT/snort3 from ~OSHUMEIK/snort3:js_otag to master Squashed commit of the following: commit 947e12e2db32df20c1de86abb9e39648697d0b67 Author: Oleksii Shumeiko Date: Thu Mar 31 16:20:19 2022 +0300 utils: harden script opening tag sequence --- diff --git a/src/utils/js_tokenizer.l b/src/utils/js_tokenizer.l index d61b21555..d881ce2c7 100644 --- a/src/utils/js_tokenizer.l +++ b/src/utils/js_tokenizer.l @@ -1006,7 +1006,7 @@ LITERAL_NAN NaN LITERAL {LITERAL_NULL}|{LITERAL_THIS}|{LITERAL_BOOLEAN}|{LITERAL_DECIMAL}|{LITERAL_HEX_INTEGER}|{LITERAL_UNDEFINED}|{LITERAL_INFINITY}|{LITERAL_NAN} HTML_COMMENT_OPEN "<"+"!--" -HTML_TAG_SCRIPT_OPEN "<"+(?i:script) +HTML_TAG_SCRIPT_OPEN "<"+(?i:script)[\x9\xA\xC\x20\x2f\x3e] HTML_TAG_SCRIPT_CLOSE "<"+(?i:\/script>) /* from 0x000 to 0x10FFFD to match undefined tokens */ diff --git a/src/utils/test/js_normalizer_test.cc b/src/utils/test/js_normalizer_test.cc index d6a04bc55..717a96769 100644 --- a/src/utils/test/js_normalizer_test.cc +++ b/src/utils/test/js_normalizer_test.cc @@ -1664,14 +1664,14 @@ static const char unexpected_tag_expected7_ext[] = static const char unexpected_tag_buf8[] = "var a = 1;\n" - "var str = 'something \\ something';\n" + "var str = 'something \\