Forum Replies Created

Viewing 15 replies - 91 through 105 (of 218 total)
  • No, there should be no delay.

    Does your hosting account allow SSH access to the command-line on the server? You usually have this access, since you do not need root-level access.

    If so, then you can log in and confirm what is happening.

    Issue command

    telnet yourdomain 80

    Telnet is an old-style terminal connection, not normally run on port 80 (http).
    But on port 80, it simply creates a connection to the web-server after translating the domain to an IP address (if it can). The same name to IP-address translation WordFence would have to do, through WordPress.

    You should see something like

    Trying {your ip address}...
    Connected to yourdomain..
    Escape character is '^]'.

    If it manages to connect and does not time-out or fail, you can in fact now “talk” to your web-server, just like a browser or WordFence would.

    For example, if you type command

    GET /

    you are doing what a browser would do, calling for your home-page (except you are missing a lot of headers and cookies).. But your web-server should now spew out a goop of HTML code. Either with your actual home-page, or with complaints about bad access, redirect to https, or other things.

    Either way, if you can connect you should be OK. If you can “talk” to it, even better as a test. (It does not matter what response it gives you to “GET /”.

    Notice, that if they entered your host-name into the /etc/hosts file with your public IP address, that might not work, since that was your problem to begin with. That the server does not know it’s public address (which is what DNS returns already).
    You will see the translated IP address when you do the ‘telnet’ command, or you can simply say ‘cat /etc/hosts’ and check it’s contents.

    If your server is behind NAT, they will have to enter the host/domain name in /etc/hosts with it’s internal IP address, or maybe even with the loopback (127.0.0.1) address to force the server to know, that when someone calls your domainname from inside the server itself, it should NOT try to connect via the public address (the Internet), but just call itself.

    BUT.. Your hosting support folks should have confirmed all this before even reporting back to you.. They know the problem, and should test the solution before telling you it is fixed. Otherwise, they must have assigned you to the latest support trainee. πŸ™‚

    If they cannot successfully do the telnet type test sitting on the server’s command line, then WordPress/WordFence will not be able to either.

    @solwininfotech,

    Your plugin has been changed, yes. But not entirely for the better.

    Your new code now has multiple new problems.

    Putting a big

    if (!is_wp_error($user) && is_object($user)) {

    bracket around all your code and totally eliminating the get_user_by() (never actually translating the $username string) call might seem like a good idea, but not in reality.

    All that bracket does is to protect YOURSELF from getting into the situation WordFence was in. That someone upstream passes YOU values that are not what you think. But it adds new issues.

    Problem 1. The Authentication process starts by WordPress sending

    (null, $username, $userpassword)

    NULL.. As in, the first filter function will not have a WP_User at all as a parameter, but a ‘null’. The filter is responsible for filtering on $username/$userpassword and checking or looking up the username, when no $user structure has been found yet.
    Or in the case, that the $username is for example a banned/illegal name, a filter might not try to look up the $username at all, but will simply return WP_User_Error.

    A WP_User object is not found until the first filter translates the $username into a WP_User object. Then if the user and $userpassword is accepted by that particular filter, the filter passes a WP_User (rather than a WP_User_Error/WP_Error) as a return value.

    Given that you are bracketing your entire function, that simply means that if you are first to be called from wp_authenticate(), you become a pass-though. Doing nothing at all. You never look up or otherwise check the $username.

    This particular issue you are somewhat protected from, since WordPress initially inserts 3-4 internal ‘authenticate’ filters, which most likely would have translated $username before you ever get called. Why it might have appeared to work, when you tested it. But that is not an assumption that is really safe to make, since you are supposed to be able to handle NULL.

    Problem 2. You are now returning NULL.

    If there is a next filter in the chain AFTER you, like here WordFence, they might save the overall filter-result from your return value, because they are also responsible for accepting NULL as a first parameter. The next filter might then translate/validate/invalidate $username and return a correct value. But if you are alone or last in a filter-chain, you would be returning NULL to wp_authenticate() as the final filtering result..

    NULL is not a valid return value from any ‘authenticate’ filter. No more valid than the earlier value of ‘false’.

    wp_authenticate() in fact checks for NULL explicitly, and considers it a failure of the filter process that should not happen. It reacts by failing the whole login process, and declaring the login invalid.

    Tell the User Blocker folks this:

    Look at the very first line in their filter:

    $user = get_user_by('login', $username);

    get_user_by() can return ‘false’.

    Which first makes their next line of code
    $user_id = $user->ID;
    wrong, because they assume that they will always receive a WP-User and try to get a UserID from a boolean (not an Object).

    Second, it also makes their subsequent return value of ‘return $user;’ wrong, because that means they are passing an invalid value downstream to the next plugin, in this case WordFence.

    As @wfalaa stated, only WP_User or a WP_User_Error objects are valid. No booleans allowed.

    Thread Starter Caleb

    (@crudhunter)

    Hmm,

    wfSchema is the “definition” of what your table structures need to be for a specific version. That is how brand-new tables for a brand-new install are created (createAll() ).

    So there should never be a delay for a new version, where wfSchema (createAll()) create tables all wrong, and then the later code in that same version has to “upgrade” the wrong tables into compliance with what the code actually needs. Upgrade code cannot reliably do that. It is built to transition from one version of tables/plugin to the next.

    That just leaves the code ripe to be hit by other bugs. Such as here the bug that the “upgrade” code does not actually work because of the historic mismatch usage of “prefix/networkprefix/base_prefix/get_blog_prefix”, which works only half the time.

    Yes, the start scans remotely should theoretically work around that problem, because the “call” then comes from WordFence’s server out on the internet, not from your server locally.
    Since users (and yourself) can find the site through the domain name, so should the WordFence servers. You should then be able to see the calls from the WordFence domain into your server in your site access-logs (they will not show in WordFence’s Live Traffic).

    Can’t say why the remote calls are not starting. Thats another issue, that will have to be debugged from the WordFence side. Especially, if your Diagnostics page is not complaining that it cannot call WordFence servers.

    All that said, WordFence uses “call backs” to do other things besides Scans, so if call-back for scans are failing (No Route to Host), SO ARE THESE OTHER THINGS. And since they are internal tasks, not obvious like a Scan, you don’t see these failures easily.

    So even if the “Start scans remotely” was working to get Scans started, you should still get the call-back thing fixed. As in, get your Diagnostics page to show clean, with everything green.

    The way WordPress works by default, is that it’s internal “scheduling” process, called “WP-Cron” gets called during normal user visits. It will wake up when a user visit a page, and suddenly start doing various maintenance things, while that user waits to see their page. πŸ™‚
    That works OK for things that complete in split seconds, but you sure would not want a user to get caught by suddenly running a long “WordFence Scan”, while they wait to see your page.

    To prevent that from happening, WordFence does not merely use Wp-Cron, but starts it’s various tasks by instead “calling back” to the server to create it’s own “visit”, where things like the file-scan can happen in peace and quiet, leaving your normal users to go about their own business.

    THAT then means that your site has to be able to call itself to accomplish various tasks. If it tries to “call home”, but the call cannot go through, tasks start failing.

    Your diagnostics output state directly, that this cannot happen because of an issue with your hosting setup.

    “Failed to connect to (domain here) port 80: No route to host“.

    Your site’s server cannot figure out how to find itself. It cannot translate your domain-name into a “route” (path through the networks) back to it’s own IP address. It is usually caused by a local configuration issue, which I have seen on some server/hosting setups.

    It for example can happen, if your server is behind a NAT (Network Address Translation) where it has a different IP-address internally from what it is known as on the global Internet).
    That can make it seem alive to the external world, so you get visitors from outside, but when you try to use the external IP address (what your domain-name translates to) to call the server from itself, it fails because the server does not know that this IP address is actually itself. It essentially knows only it’s internal address.

    There are various configuration changes that can fix that, including fixing routing, adding IP to interface directly, adding your host-domain-name to the local /etc/hosts file – but pointing to the loopback interface instead, …, …
    BUT, unless you have root access to your server all those methods are unavailable to you directly. If you are on a shared hosting setup, you can NEVER have root access. Your hosting company would have to fix their setup.

    On a VPS or Dedicated server, where you are in 100% control and have root-access, the simplest methods is usually to just add a line to the /etc/hosts file, pointing your domain/server name to loopback (127.0.0.1), since that affects only the local server. It usually fixes it, assuming that your web-server is listening on Loopback.

    Starting scans remotely should theoretically work around this by making the WordFence server(s) call your site instead. It is a workaround for the call-back problem, but for scans only. If that does not happen, I guess that is another problem.

    First off, even before knowing the root cause of the blocks.
    If you are seeing this message, you have something catching wrong on logins.
    So, you can eliminate the problem temporarily, by going to your Options page and unchecking “Enable login security”.

    With Login Security turned off, these blocks and this message cannot happen. You can then keep the rest of WordFence’s security measures running while you figure all this out. Not letting yourself wide-open to the world by having the whole plugin disabled. πŸ™‚

    Secondly, the only thing that can produce this particular error message, is if WordFence (rightly or falsely) believes that users are trying to login with a banned user name.

    So you might want to check the content of your banned user list.
    (Setting on Options page: Immediately block the IP of users who try to sign in as these usernames).

    Third, if your banned user list is not containing any goofy things, have you by any chance enabled any other security/login related plugins recently? Such as “User Blocker” or any other plugins that can add to the authentication chain in WordPress?

    I am seeing repeated accesses by GoogleBot with this WordFence parameter as well:

    /?wordfence_logHuman=1&hid=xxxxxx

    For that one there is no excuse of “redirect” like for the previous incident linked above. the LogHuman test comes out attached to page headers, and gets caught by GoogleBot and others on some of their accesses. Probably for Google on some of the test-site accesses.

    It is another case of side-effects from WordFence injecting Javascript based links into random pages just for internal purposes.

    It is a decidedly bad idea to modify a site’s page code with goofy links/parameters that should not be there. I prefer to control my own page content and links, thank you very much.

    On the PHP version.

    No, WordFence does not require higher than the PHP5 version.
    A minimum version requirement is what you get, if something (like WordFence or WordPress) uses functionality that was never developed in PHP of lower versions. Like written in code that earlier versions do not support. Like when they started supporting Classes, or when Namespaces was introduced. If some code uses Namespaces, then obviously it cannot run on a PHP version so old, that it does not know what a Namespace is. Hence a “minimum version” requirement. πŸ™‚

    In either case, it is NEVER valid for a PHP interpreter to crash. It can return errors, if it does not support a function of if your code it is interpreting has bugs, but is should NEVER, EVER crash. NEVER.. When the PHP interpreter out-right crashes, you have by definition found a bug in the PHP interpreter itself.

    But PHP is not a single entity.. It is the PHP interpreter plus a long list of PHP modules of varying qualities, each of which are enabled or disabled for various reasons, made by different people, and can crash for each their own buggy reasons.. Supporting Phar archives, MB strings, various conversions modules, …, …..

    Do a PHP info (run PHP -info, call phpinfo(), or you can call it by just clicking the “Click to view your system’s configuration in a new window” link at the bottom of WordFence Diagnostics page. See all the PHP modules you have enabled.

    So, many PHP5 versions work just fine, IF you have the right modules installed, and that particular versions is not buggy. πŸ™‚
    Similarly for all PHP 7. PHP 7.0.22 does not work, PHP 7.1.8/9 does.
    but But if one of the PHP versions fail, like in your case, time to try moving up. πŸ™‚

    You should open a new issue with your failing scans issue.
    This particular forum topic has already been marked as “Resolved”, and scanning is a separate thing.

    It is not a vulnerability or a new type of attack.. It is a parameter your local WordFence use to call itself, that under normal conditions should NOT become visible to the outside.
    Unfortunately there are conditions where WordFence panics and spews it out into page code using Javascript, where visitors, Google, and other bots can find the link.

    In either case, the parameter is there by accident, not an attack it itself. When someone OTHER THAN your own server calls with it, it means that they have found and called the query link, but calling it is not a security risk. It is part of slightly abnormal “normal business”. πŸ™‚
    Mostly a nuisance with Google Search Console when GoogleBot finds it, since they now are thinking your site uses query args it does not.

    Given the Epoch timestamps you show, these links were caught/seen/called on

    Saturday, August 19, 2017 4:10:09.600 AM GMT-06:00 DST
    and
    Saturday, August 19, 2017 6:24:14.490 AM GMT-06:00 DST

    so these particular ones obviously just recently happened.

    I think you are seeing another unfortunate side-effect of this case, which you might wanna read through:

    https://wordpress.org/support/topic/syncattackdata-query-parameters/

    Your error output from the Diags page mostly tells you what is wrong.

    “wp_remote_post() test back to this server failed! Response was: 403 Forbidden”

    “403 Forbidden” means that your server and/or site is blocking being accessed by ITSELF, so WordFence cannot do callbacks to initiate parts of the scanning. That will also (sometimes silently) affect other portions of WordFence functionality,

    You will need to find out what is blocking it. Your server access logs might help.

    Most likely the permission settings for your system is blocking it.

    Go to the WordFence -> Tools -> Diagnostics tab and look at the top items there to confirm that they are all marked as OK regarding writing to filesystem and configurations.
    If they are not all marked with OK or check marks, your file-system need a permission adjustment.

    No.. A simple mysqlrepair will not fix that. It needs manual intervention, as per the link I gave you.

    It will not be fixed by a simple backup and restore/move thing.
    The backup should include the bad Data dictionary content, and should move the corruption right over.

    You will need to fix it.
    It’s not too difficult. Especially with only a few tables to fix.

    The root-cause (what ultimately started the failure) is not in WordFence, but in the User-Blocker plugin. Poor coding can cause User-Blocker to at times pass on values that should not exist in the authentication path.

    @solwininfotech’s answer from earlier of simply passing you on to the next layer in the filter chain was wrong. They did not actually look at the problem before throwing it “over the fence” to WordFence.

    Their code has an obvious flaw. 2 minutes or less of looking at their code should tell them where it can go haywire.

    You have hit one of the unfortunate side-effects of having multiple plugins trying to manipulate the same thing.

    That said, I would suggest a tiny future improvement in WordFence, where it validates whether other plugins might pass them unexpected/invalid values. That would prevent the PHP errors from being reported in WordFence.
    That would not fix the root-flaw, though. That must come from User-Blocker.

    After some research it seems that at least a good part of these files (like the wp-admin/uploader stuff) are part of the WordPress APS package used when you install WordPress via a management system like Plesk on a server rather than by installing manually.

    The files are part of the Plesk theme/plugin uploader system so are in fact likely safe & can be ignored.

    Might want to risk white-listing them then.

Viewing 15 replies - 91 through 105 (of 218 total)