Skip to content

Need to create a new transformation function called removeComments #408

Closed
@rcbarnett-zz

Description

@rcbarnett-zz

MODSEC-254: The current transformation function replaceComments is not sufficient for two cases -

  1. It is replaced with a space char which can cause false negatives when the SQL comments are inserted directly into SQL keywords like this -

?param=UNI/blah/ON+SEL/blah/ECT

The resulting payload would become -

UNI ON SEL ECT

And this would evade signatures that look for these keywords.

  1. If the payloads has unterminated SQL comments like this -

?param=1'UNION/!0SELECT user,2,3,4,5,6,7,8,9/!0from/!0mysql.user/-

The resulting payload would become -

1'UNION

We need a new tfns called removeComments that simply strips any /.../, or /* strings in place but does not remove any other text and does not replace it with spaces

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions