Skip to content

Access log include double quote at the user-agent field #1453

Closed
@Pjack

Description

@Pjack

Hi

I use some tool to do penetration test and see if modsecurity v3 will block the request successful.
In some testing case, user-agent includes double-quote in it, ie:

int2.diamond.trendmicro.com 118.163.170.73 - - [24/May/2017:07:38:35 +0000] "POST /api/v1/logs/ HTTP/1.1" 403 0- "'"<script>alert(1);</script>" 14956115151.000000 - /var/log/modsec/20170524/20170524-0738/20170524-073835-14956115151.000000 0 9454.000000 md5:d87287f684b5e55193b7402d421835bd

Modsecurity blocked the request succesfully, however, it will output the origin user-agent string into the access log too.
It cause our log parser (fluentd + elastisearch) failed in this case, and we don't have good solution for it.
I would like to support libmodsecurity can convert the double-quote as \x22 , so does other character between 0x7F-0x1F. I see this idea in nginx's access log.

https://serverfault.com/questions/584881/parseable-nginx-accesslog-files-with-delimiters

Thanks!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions