• Customers are receiving a “403 Forbidden Error Page” error after a success payment via PayPal. The PayPal payment completes successfully and WooCommerce gets back what it is expecting and completes/updates the order on the site. The customer never gets to the order completed page; instead they are presented with the above error message.

    Note * if the default Root .htaccess file is used the issue disapears

    Steve

    https://wordpress.org/plugins/bulletproof-security/

Viewing 15 replies - 1 through 15 (of 44 total)
  • Plugin Author AITpro

    (@aitpro)

    Post the BPS Security Log entry for this so that I can see what is being blocked and post a whitelist rule.

    Thread Starter retailmakeover

    (@retailmakeover)

    No whitelist rules

    Log:

    [403 GET / HEAD Request: November 26, 2014 3:16 pm]
    Event Code: BFHS – Blocked/Forbidden Hacker or Spammer
    Solution: N/A – Hacker/Spammer Blocked/Forbidden
    REMOTE_ADDR: 76.68.77.74
    Host Name: PCNGON6232W-LP140-05-1279544650.dsl.bell.ca
    SERVER_PROTOCOL: HTTP/1.1
    HTTP_CLIENT_IP:
    HTTP_FORWARDED:
    HTTP_X_FORWARDED_FOR:
    HTTP_X_CLUSTER_CLIENT_IP:
    REQUEST_METHOD: GET
    HTTP_REFERER:
    REQUEST_URI: /checkout/order-received/11318?key=wc%5forder%5f5475eec17ef86&utm_nooverride=1&tx=30G81381E84930933&st=Completed&amt=1%2e13&cc=CAD&cm=a%3a2%3a%7bi%3a0%3bi%3a11318%3bi%3a1%3bs%3a22%3a%22wc%5forder%5f5475eec17ef86%22%3b%7d&item_number=
    QUERY_STRING:
    HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:33.0) Gecko/20100101 Firefox/33.0

    Plugin Author AITpro

    (@aitpro)

    Use the whitelist solution that is documented in this forum link below which I just updated a few minutes ago – see the UPDATE: added on 11-26-2014 Custom Code steps to save this whitelist rule permanently.
    http://forum.ait-pro.com/forums/topic/403-forbidden-error-woocommerce/#post-5144

    Plugin Author AITpro

    (@aitpro)

    Oh and I meant to explain what was being blocked. %22 is the double quotes code character and “order” is an SQL command. So in the Query String the combination of %22 and order used together match an SQL Injection attack pattern in this BPS security filter.

    RewriteCond %{QUERY_STRING} (;|<|>|'|"|\)|%0A|%0D|%22|%27|%3C|%3E|%00).*(/\*|union|select|insert|drop|delete|update|cast|create|char|convert|alter|declare|order|script|set|md5|benchmark|encode) [NC,OR]
    Plugin Author AITpro

    (@aitpro)

    Also there is no security risk by whitelisting this. The security filter is intentionally designed with overlap/redundancy for exactly these cases. It would take a combination of several matching code characters/SQL commands in order to perform a successful SQL Injection attack. So by removing “order” you are only removing 1 element of the attack and an attack using “order” and other elements of that attack would still be blocked/forbidden.

    Thread Starter retailmakeover

    (@retailmakeover)

    Thanks;

    Sorry; didn’t really understand what you meant by whitelisted. We are using your # WP AUTHOR ENUMERATION BOT PROBE PROTECTION code.

    Ok; so when I add the custom code from your link above and try and save it I’m taken to 404 page not found error.

    Steve

    Plugin Author AITpro

    (@aitpro)

    Are you adding the code in the forum link above in the correct BPS Root Custom Code text box?

    Edit: [bad info removed/deleted]

    Thread Starter retailmakeover

    (@retailmakeover)

    I am doing all of that. This is what is what I’m trying to save:

    # WP AUTHOR ENUMERATION BOT PROBE PROTECTION
    # Rewrites to author=999999 that does not actually exist
    # which results in a standard 404 error. To the hacker bot
    # it appears that this author does not exist without giving
    # any clues that the author does actually exist.

    RewriteCond %{QUERY_STRING} ^author=([0-9]){1,}$ [NC]
    RewriteRule ^(.*)$ $1?author=999999 [L]

    # BEGIN BPSQSE BPS QUERY STRING EXPLOITS
    # The libwww-perl User Agent is forbidden – Many bad bots use libwww-perl modules, but some good bots use it too.
    # Good sites such as W3C use it for their W3C-LinkChecker.
    # Use BPS Custom Code to add or remove user agents temporarily or permanently from the
    # User Agent filters directly below or to modify/edit/change any of the other security code rules below.
    RewriteCond %{HTTP_USER_AGENT} (havij|libwww-perl|wget|python|nikto|curl|scan|java|winhttp|clshttp|loader) [NC,OR]
    RewriteCond %{HTTP_USER_AGENT} (%0A|%0D|%27|%3C|%3E|%00) [NC,OR]
    RewriteCond %{HTTP_USER_AGENT} (;|<|>|’|”|\)|\(|%0A|%0D|%22|%27|%28|%3C|%3E|%00).*(libwww-perl|wget|python|nikto|curl|scan|java|winhttp|HTTrack|clshttp|archiver|loader|email|harvest|extract|grab|miner) [NC,OR]
    RewriteCond %{THE_REQUEST} (\?|\*|%2a)+(%20+|\\s+|%20+\\s+|\\s+%20+|\\s+%20+\\s+)HTTP(:/|/) [NC,OR]
    RewriteCond %{THE_REQUEST} etc/passwd [NC,OR]
    RewriteCond %{THE_REQUEST} cgi-bin [NC,OR]
    RewriteCond %{THE_REQUEST} (%0A|%0D|\\r|\\n) [NC,OR]
    RewriteCond %{REQUEST_URI} owssvr\.dll [NC,OR]
    RewriteCond %{HTTP_REFERER} (%0A|%0D|%27|%3C|%3E|%00) [NC,OR]
    RewriteCond %{HTTP_REFERER} \.opendirviewer\. [NC,OR]
    RewriteCond %{HTTP_REFERER} users\.skynet\.be.* [NC,OR]
    RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=http:// [NC,OR]
    RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=(\.\.//?)+ [NC,OR]
    RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=/([a-z0-9_.]//?)+ [NC,OR]
    RewriteCond %{QUERY_STRING} \=PHP[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} [NC,OR]
    RewriteCond %{QUERY_STRING} (\.\./|%2e%2e%2f|%2e%2e/|\.\.%2f|%2e\.%2f|%2e\./|\.%2e%2f|\.%2e/) [NC,OR]
    RewriteCond %{QUERY_STRING} ftp\: [NC,OR]
    RewriteCond %{QUERY_STRING} http\: [NC,OR]
    RewriteCond %{QUERY_STRING} https\: [NC,OR]
    RewriteCond %{QUERY_STRING} \=\|w\| [NC,OR]
    RewriteCond %{QUERY_STRING} ^(.*)/self/(.*)$ [NC,OR]
    RewriteCond %{QUERY_STRING} ^(.*)cPath=http://(.*)$ [NC,OR]
    RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
    RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
    RewriteCond %{QUERY_STRING} (\<|%3C).*embed.*(\>|%3E) [NC,OR]
    RewriteCond %{QUERY_STRING} (<|%3C)([^e]*e)+mbed.*(>|%3E) [NC,OR]
    RewriteCond %{QUERY_STRING} (\<|%3C).*object.*(\>|%3E) [NC,OR]
    RewriteCond %{QUERY_STRING} (<|%3C)([^o]*o)+bject.*(>|%3E) [NC,OR]
    RewriteCond %{QUERY_STRING} (\<|%3C).*iframe.*(\>|%3E) [NC,OR]
    RewriteCond %{QUERY_STRING} (<|%3C)([^i]*i)+frame.*(>|%3E) [NC,OR]
    RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [NC,OR]
    RewriteCond %{QUERY_STRING} base64_(en|de)code[^(]*\([^)]*\) [NC,OR]
    RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
    RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) [OR]
    RewriteCond %{QUERY_STRING} ^.*(\(|\)|<|>|%3c|%3e).* [NC,OR]
    RewriteCond %{QUERY_STRING} ^.*(\x00|\x04|\x08|\x0d|\x1b|\x20|\x3c|\x3e|\x7f).* [NC,OR]
    RewriteCond %{QUERY_STRING} (NULL|OUTFILE|LOAD_FILE) [OR]
    RewriteCond %{QUERY_STRING} (\.{1,}/)+(motd|etc|bin) [NC,OR]
    RewriteCond %{QUERY_STRING} (localhost|loopback|127\.0\.0\.1) [NC,OR]
    RewriteCond %{QUERY_STRING} (<|>|’|%0A|%0D|%27|%3C|%3E|%00) [NC,OR]
    RewriteCond %{QUERY_STRING} concat[^\(]*\( [NC,OR]
    RewriteCond %{QUERY_STRING} union([^s]*s)+elect [NC,OR]
    RewriteCond %{QUERY_STRING} union([^a]*a)+ll([^s]*s)+elect [NC,OR]
    RewriteCond %{QUERY_STRING} \-[sdcr].*(allow_url_include|allow_url_fopen|safe_mode|disable_functions|auto_prepend_file) [NC,OR]
    RewriteCond %{QUERY_STRING} (;|<|>|’|”|\)|%0A|%0D|%22|%27|%3C|%3E|%00).*(/\*|union|select|insert|drop|delete|update|cast|create|char|convert|alter|declare|script|set|md5|benchmark|encode) [NC,OR]
    RewriteCond %{QUERY_STRING} (sp_executesql) [NC]
    RewriteRule ^(.*)$ – [F]
    # END BPSQSE BPS QUERY STRING EXPLOITS

    Plugin Author AITpro

    (@aitpro)

    Oh wow. My mistake. I posted the wrong Custom Code text box in the forum topic above. Has now been corrected. Sorry about that. The correct BPS Root Custom Code text box is this one: CUSTOM CODE BPSQSE BPS QUERY STRING EXPLOITS:

    Plugin Author AITpro

    (@aitpro)

    Cut the BPS Query String Exploits code in the CUSTOM CODE BOTTOM HOTLINKING/FORBID COMMENT SPAMMERS/BLOCK BOTS/BLOCK IP/REDIRECT CODE text box and paste it into this Custom Code text box: CUSTOM CODE BPSQSE BPS QUERY STRING EXPLOITS.

    Click the Save Root Custom Code button.
    Go to the Security Modes page, click the Create secure.htaccess File AutoMagic button and activate Root folder BulletProof Mode.

    Thread Starter retailmakeover

    (@retailmakeover)

    Did that; as soon as you try to save the code you get a 404 error.

    Plugin Author AITpro

    (@aitpro)

    Ok use FTP or your web host control panel file manager and delete the BPS root .htaccess file. If you do not see the root .htaccess file then select/choose “Show hidden files”.

    You will then be able to do the Custom Code steps after deleting the root htaccess file.

    Thread Starter retailmakeover

    (@retailmakeover)

    I delete the .htaccess file, add the code, click save and I get a 404. I revert to the default .htaccess file fine; I then try adding the code to the custom root and as soon as I try saving I get a 404 error. I can update things like CUSTOM CODE BOTTOM HOTLINKING/FORBID but not the BPSQSE; all I get is a 404 error.

    Steve

    Plugin Author AITpro

    (@aitpro)

    Have you deleted the BPS Query String Exploits code out of the CUSTOM CODE BOTTOM HOTLINKING/FORBID COMMENT SPAMMERS/BLOCK BOTS/BLOCK IP/REDIRECT CODE text box?

    Plugin Author AITpro

    (@aitpro)

    Do these steps.
    Put the root htaccess file in Default Mode.
    Go to BPS Custom Code and double check all Custom Code text boxes.
    The Query String Exploits code should only be in this Custom Code text box: CUSTOM CODE BPSQSE BPS QUERY STRING EXPLOITS.
    If you see the Query String Exploits code in any other Custom Code text boxes then delete it.
    Then click the Save Root Custom Code button.
    Go to the Security Modes page, click the Create secure.htaccess File AutoMagic button and activate Root folder BulletProof Mode.

Viewing 15 replies - 1 through 15 (of 44 total)
  • The topic ‘403 error after PayPayl payment’ is closed to new replies.