• Hi there,

    Thank you very much for this plugin. It has been quite helpful for numerous websites.

    However, I’m running into an issue with setups on Dreamhost specifically. Any other host I’ve set up on has not had this issue (in fact I set one up today that works flawlessly). Much like these other tickets: https://ww.wp.xz.cn/support/topic/error-404-after-authorizing-with-gmail/
    https://ww.wp.xz.cn/support/topic/gmail-smtp-not-working-2/
    https://ww.wp.xz.cn/support/topic/forbidden-message-after-allowing-gmail/

    I receive a 404 error almost instantly after authorizing Gmail/Gsuite and being redirected back to my site. I asked hosting support to disable modsecurity, which they directed me to do myself (but was not labeled modsecurity, so I’m not entirely sure this actually happened). After that, when it didn’t work, I have asked hosting support, who stated: “Looking into this, the process is timing out at 120 seconds from our
    logs. Unfortunately I cannot investigate the site/issue because I don’t
    know the gmail settings, etc. Also, one thing to mention, please ensure
    that you are already logged into the gmail account in your browser before
    attempting to set it up and that you are only logged into ONE gmail
    account (if you have multiple accounts logged into your browser, please
    sign out of them and then try again).

    Also, there could be some issues with the plugin in general. You may want
    to contact the plugin developer to see if they can help you debug the
    issue. If they can give you debug information, please share it with us,
    so we can further investigate this with you.”

    I have told them that there is not an issue with the plugin as it works on other hosting services, and directed them to the other support topics linked here. Any other information I can give them/debugging information I can provide to them? I don’t want to keep modsecurity as a whole disabled on the domain since clearly that isn’t working either. Their own support states “Disabling and modifying of mod_security rules via .htaccess is not supported at this time.” ( https://help.dreamhost.com/hc/en-us/articles/215947927-How-do-I-enable-Extra-Web-Security-for-my-website- )

    Thanks for your help.

    • This topic was modified 5 years, 9 months ago by the9mm.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi @the9mm,

    Thanks for the details! When you get a chance, could you please let me know if you’re getting 404 in Google or on your site? The issue still looks like because of some firewall blocking the incoming request from Google, some parts of the URL are filtered and you’re redirected to 404 page. Could you please check the mod_security logs after authenticating with Google? The docs says, If you see 418 response codes in your access.log files, it means that the request was blocked by mod_security..

    Thanks!

    Thread Starter the9mm

    (@the9mm)

    Hi Sanjeev,

    The 404 error is on my site, not on Google. Here’s what is being returned to me in the access log:

    x.x.x.x - - [31/Aug/2020:12:33:16 -0700] "GET /wp-admin/options-general.php?page=wp-mail-smtp&tab=auth&code=[removed]&scope=https://mail.google.com/ HTTP/1.1" 404 34286 "https://accounts.google.com/signin/oauth/consentsummary?authuser=0&part=[removed]&approvedScope=https%3A%2F%2Fmail.google.com%2F" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36" 
    x.x.x.x - - [31/Aug/2020:12:33:17 -0700] "GET /wp-includes/css/admin-bar.min.css?ver=5.4.2 HTTP/1.1" 200 8455 "https://www.ecosourcellc.net/wp-admin/options-general.php?page=wp-mail-smtp&tab=auth&code=[removed]&scope=https://mail.google.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36" 
    x.x.x.x - - [31/Aug/2020:12:33:17 -0700] "GET /wp-includes/js/hoverintent-js.min.js?ver=2.2.1 HTTP/1.1" 200 5034 "https://www.domain.net/wp-admin/options-general.php?page=wp-mail-smtp&tab=auth&code=[removed]&scope=https://mail.google.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36" 
    x.x.x.x - - [31/Aug/2020:12:33:18 -0700] "GET /wp-includes/js/admin-bar.min.js?ver=5.4.2 HTTP/1.1" 200 5846 "https://www.domain.net/wp-admin/options-general.php?page=wp-mail-smtp&tab=auth&code=[removed]&scope=https://mail.google.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36" 
    x.x.x.x - - [31/Aug/2020:12:33:20 -0700] "POST /wp-admin/admin-ajax.php HTTP/1.1" 200 4630 "https://www.domain.net/wp-admin/options-general.php?page=wp-mail-smtp&tab=auth&code=[removed]&scope=https://mail.google.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36"

    Hi @the9mm,

    Thanks for the log. The URL in the first line is good and is expected, so there is something redirecting to the 404 pages. You might still need to contact your hosting provider to show these logs or you have some other security plugins that is causing this issue.

    Have a good one!

    Thread Starter the9mm

    (@the9mm)

    Hi Sanjeev,

    My hosting provider has stated:

    “I am so sorry for the continued issues. I investigated this with one of
    our security engineers about this and we find no evidence that this is
    being blocked by Mod_Security. We have specific logging for things
    blocked by modsec and it will record a “418” error to help us easily
    identify modsec issues. I checked our separate mod_sec logs as well and
    there are no entries for google, your IP, gmail, smtp. Unfortunately we
    are not sure what else could be causing it, but again, it is not modsec.
    It would be best to continue to have the plugin developer look into it
    more, possibly enabling verbose logging from the plugin to see what the
    process is actually doing, which results in the 404 error.”

    I have tried to run this while disabling all plugins, and resulted in the same issue. Initially BulletProof Security was capturing it as a 405 (which resulted in me having to disable that plugin and replace my htaccess with a default one), so while there may have been another plugin involved prior, I’m not seeing one now. Is there anything else I can enable or specifically ask for from my hosting provider to get to the bottom of this?

    A 405 error is a HEAD Request that was blocked. Maybe this was for something else? Post the BPS Security log 405 log entry so I can take a look at it. To allow/not block all HEAD Requests use this solution below. If you still have the BPS plugin installed then deactivate wp-admin BulletProof Mode to eliminate/confirm the BPS wp-admin htaccess file is causing the problem. If you do not still have the BPS plugin installed then delete the /wp-admin/.htaccess file if it exists. If BPS was blocking this then you would be seeing a 403 error and not a 404 error, but eliminate BPS htaccess files entirely to be sure that the BPS root or wp-admin htaccess files are not involved in the problem. Also copy the URL from the Apache error log entry and paste it into your Browser address bar. If you see a 404 error then most likely the problem is with the URL itself.

    1. Copy the code below into this BPS Root Custom Code text box: 9. CUSTOM CODE REQUEST METHODS FILTERED
    2. Click the Encrypt htaccess Code button first if your host server has ModSecurity installed. ModSecurity blocks saving BPS Custom Code unless it is encrypted before saving it.
    3. Click the Save Root Custom Code button.
    4. Go to the Security Modes tab page and click the Root Folder BulletProof Mode Activate button.

    # REQUEST METHODS FILTERED
    # If you want to allow HEAD Requests use BPS Custom Code and copy
    # this entire REQUEST METHODS FILTERED section of code to this BPS Custom Code
    # text box: CUSTOM CODE REQUEST METHODS FILTERED.
    # See the CUSTOM CODE REQUEST METHODS FILTERED help text for additional steps.
    RewriteCond %{REQUEST_METHOD} ^(TRACE|DELETE|TRACK|DEBUG) [NC]
    RewriteRule ^(.*)$ - [F]
    #RewriteCond %{REQUEST_METHOD} ^(HEAD) [NC]
    #RewriteRule ^(.*)$ /wp-content/plugins/bulletproof-security/405.php [L]

    Hi @the9mm, @aitpro

    Thanks for the details. Unfortunately, I don’t see any other reasons if there is no restriction by your hosting provider and especially if the incoming URL is correct. Please follow this troubleshooting guide to identify any conflict with theme/plugins or .htaccess rules.

    Have a good one!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘404 Upon Redirection back to Plugin Settings’ is closed to new replies.