pfSense HTTP_REFERER error

I’m just sharing this so my spent frustration can possibly help someone else.    If you’re setting up pfSense in a VM container, or otherwise can’t access pfSense via a local LAN IP for initial setup, then this information might save you some headache.    Every time the devs were asked about this, or to make it easier on people in this situation, their answer was to set up a machine on the local LAN.   Not overly helpful.

The error that this will help with, will be similar to:

An HTTP_REFERER was detected other than what is defined in System -> Advanced (http://192.168.0.1:8080/). You can disable this check if needed in System -> Advanced -> Admin.

So, as long as you have console access to pfSense (or access via SSH) then we can work around this error.    Since the error message suggests changing a setting in the Webconfigurator, which obviously you can’t access, it’s not very helpful either.

So, this is pretty straightforward.   From the pfSense console, enter 8 (or the option for Shell).

Then, type the below, pressing ENTER after each double-backslash that you see below, and then enter at the very end.

sed -i -e '/<webgui>/a\\
<nodnsrebindcheck>yes</nodnsrebindcheck>\\
<nohttpreferercheck>yes</nohttpreferercheck>\\
' /conf/config.xml

There should be no feedback after this is done.    Then, type exit, hit enter and use the option to reboot.

The only other command you might need, is only applicable if you can’t get the login screen to appear.    Be forewarned, that if you use this command below that you should get your configuration done and restart as soon as possible.   This command disables the firewall completely.   Type the below after using option 8 (for Shell) from the pfSense main menu:

pfctl -d

 

Well, I hope this helps someone.  Whenever I waste time on something like this, I like to try to save someone else some time!

Shoot me a comment if this helped you out!

–Josh

Leave a Reply

Your email address will not be published. Required fields are marked *