I have installed ModSecurity in Apache server and using it as a reverse proxy to forward request to a NodeJS applicaiton.
I have followed this tutorial to configure ModSecurity in Apache, https://www.atlantic.net/vps-hosting/securing-your-apache-web-server-with-mod-security/
I then enabled SecRuleEngine
and set it value to On
.
Upon starting Nodejs Application and Apache Server with ModSecurity I can see that requests are routed to NodeJs application.
However, the nodejs application is adding #/
at the end of the domain i.e it becomes http://test.com/#/
SQLi
I tried performing SQLi by simply running ' or 1=1; --
for Username in a login field. Which is blocked by ModSecurity and I get Forbidden page.
XSS
When I visit,
http://test.com/#/%3Cscript%3Ealert(%E2%80%98XSS%E2%80%99)%3C/script%3E
ModSecurity doesn't block it, However If I remove #/
and visit
http://test.com/%3Cscript%3Ealert(%E2%80%98XSS%E2%80%99)%3C/script%3E
ModSecurity blocks it.
Can someone please help me understanding how to use modsecurity when NodeJS adds #/
in url?