Skip to main content

Posting the word "get" in forms results in 403 error on Passenger website

Comments

10 comments

  • cPRex Jurassic Moderator
    Hey there! Do you have ModSecurity enabled on the machine? If so, do you see anything in the Apache logs when this error happens?
    0
  • Fabius
    Hi! Yes, ModSecurity appears to be enabled for this domain. Here's a line from the logs from when I added that query string: 92.41.4.241 - - [03/Feb/2023:06:47:57 -0500] "GET /?test=foo%0D%0Aget+foo HTTP/2.0" 403 543 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15"
    0
  • cPRex Jurassic Moderator
    If you disable ModSecurity, are you able to post normally?
    0
  • Fabius
    Yes, turning off ModSecurity means it works! So, why is that? Is there a way to enable ModSecurity without it doing... whatever it is it's doing here?
    0
  • quietFinn
    You can find the rule id in ModSecurity log (/etc/apache2/logs/modsec_audit.log), and then add an exception to disable that rule for the domain in question. I use ConfigServer ModSecurity Control for that.
    0
  • Fabius
    My server doesn't have a /etc/apache2/logs/modsec_audit.log. /etc/apache2/logs leads to /usr/local/apache/domlogs but I don't have permission to see what's in there.
    0
  • quietFinn
    You need root access to be able to see that file.
    0
  • cPRex Jurassic Moderator
    @Fabius - if you don't have root access, you can ask your host if they can check the log and adjust that rule for you.
    0
  • Fabius
    Thanks both. I got in touch with the hosting service and they were able to look in the logs and disable the offending rule. It now all works! The only downside is they didn't tell us what the rule was, so we'll never know.
    0
  • cPRex Jurassic Moderator
    I'm glad they were able to help with that!
    0

Please sign in to leave a comment.