Skip to content

Commit e757f63

Browse files
authored
Merge pull request #901 from greenbone/update_grammar_regex
Change: Make a Grammar plugin regex more generic and extend it.
2 parents 3f42ee1 + 19e8e81 commit e757f63

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

tests/plugins/test_grammar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def test_grammar10(self):
321321
self.assertIsInstance(results[0], LinterError)
322322
self.assertEqual(
323323
"VT/Include has the following grammar problem:\n"
324-
"- Hit: may allows an\n"
324+
"- Hit: may allows\n"
325325
'- Full line: script_tag(name:"impact", value:"Successful '
326326
"exploitation may allows an attacker to run arbitrary code on the "
327327
'affected IP cameras.");',

troubadix/plugins/grammar.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,10 @@ def get_grammer_pattern() -> re.Pattern:
179179
# server-site template injection -> server-side template injection
180180
r"cross[\s-]+side[\s-]+(request[\s-]+forgery|scripting)|"
181181
r"server[\s-]+site[\s-]+(request[\s-]+forgery|template)[\s-]+injection|"
182-
# e.g. "Successful exploitation may allows an attacker to run arbitrary"
183-
r"(could|may|will)\s+allows\s+an?\s+|"
182+
# e.g.:
183+
# Successful exploitation may allows an attacker to run arbitrary
184+
# An error in INSTALL_JAR procedure might allows remote authenticated
185+
r"(could|may|will|might|should|can)\s+allows\s+|"
184186
# nb: Next few could happen when copy'n'paste some text parts around
185187
# like e.g.:
186188
# is prone to a to a remote denial-of-service vulnerability

0 commit comments

Comments
 (0)