PHP execution causing 403 forbidden

Hi, when I turn on the Prevent PHP execution function under Defender it blocks much of the theme rendering css etc. I end up with about 128 403 error codes. I turn it off and the site returns to normal. What is the issue?

  • Rupok

    Hi Dublinate, hope you had a wonderful day.

    I also enabled "Prevent PHP Execution" in my test site but I didn't get any error like this. 128 403 errors are really weird and critical. Can you try activating any default WordPress theme and check if the issue is still there? I need to make sure if this is Generic on your site or Theme specific.

    I could tell you better about the issue if I could see it live, check your current configuration and make some tests on your site. Would you mind allowing Support Access so we can have a closer look at this?

    To enable support access you can follow this guide here:
    http://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    Have a nice day. Cheers!
    Rupok

  • Dublinate

    Hi Rupok,

    Thanks for getting back to me; I can assure you that this is site specific.

    Previously the site was running a custom made theme and was using the defender plugin as well as a securi plugin.

    The old site had a lot of security and restrictions placed on it; plugins and wordpress were not getting regularly or promptly updated to the latest versions by the old webmaster.

    We were given the job to up date the site to a new modern theme and when we loaded and activated the theme first it wasn't working correctly and I saw these errors under developer mode in Chrome. These errors are theme specific see here:

    Failed to load resource: the server responded with a status of 403 (Forbidden) http://www.sanlorenzos.ie/wp-content/themes/nouveau/css/style_dynamic.php

    For some reason the activation of the "Prevent PHP execution" in defender stops the loading of these files. There are about 11 errors of this type. (128 may have been my memory playing tricks)

    We deactivated all security on the site and removed those plugins and the theme worked correctly. The site was updated and re-launched and has been working fine. So I have begun to harden and secure the site again. When the activation of the prevent PHP execution feature in Defender was turned on is when the errors returned.

    The new theme uses a child theme, could this be the issue?

    The server is running an old version of PHP (5.3) but will be updated to 5.6 soon.

    I have granted you access as requested.

    I have not tested a standard theme (none are loaded) as I said above; it seems to be only blocking theme specific files.

    Regards

    David

  • Nithin

    Hi Dublinate,

    Hope you are doing good today. :slight_smile:

    The new theme uses a child theme, could this be the issue?

    I checked this in my test website, with a child theme enabled, and I'm not able to replicate this. I also did a quick switch to a default theme in your website, and the 404 error was gone. This mostly has to do with Defenders hardening procedure, and what the plugin does is prevent any arbitrary PHP code to execute within the theme. This is to contain any damage, if there is any attack.

    I checked one of these files which was generating 404, /js/default_dynamic.php rather than a simple JS script, the script seems to require wp-config.php and other files in order to execute. Maybe this is what is causing this, since it's a premium theme, I'm not sure about it's workflow. I have pinged the developer regarding this, and asked to give a look. He would be able to give you a clear idea regarding this.

    Please do note developers work round the clock, and it may take a while to get a response. Either myself or the developer will update regarding this.

    I hope this helps. Please let us know if you need any further help. Have a nice day. :slight_smile:

    Kind Regards,
    Nithin