• Resolved behroozjanfada

    (@behroozjanfada)


    Hi,

    About an hour ago I noticed some suspicious activity on one of my websites. Someone had managed to create a user with administrator access. Fortunately, I noticed it quickly and stopped it. I found the attacker’s IP and filtered the log of his activity on the server.

    The attacker made 48 consecutive POST requests to /wp-json/wp-statistics/v2/online. I don’t know much about this, but I’m guessing it was a SQL injection. Maybe something similar to this:

    https://wpscan.com/vulnerability/a0e40cfd-b217-481c-8fc4-027a0a023312/

    After that the attacker managed to register, and changed their role to admin and login. As far as I can see, fortunately they didn’t do any damage. After this, the attacker tried to do the same thing on another of my sites, which I quickly stopped. Please check if the plugin is vulnerable in this way or not.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi @behroozjanfada,

    Thank you for opening the thread and sharing your concerns.

    I have escalated this to our team for further review and investigation. I will get back to you as soon as we have an update.

    Thank you for your patience and understanding!

    — Matthew

    Thread Starter behroozjanfada

    (@behroozjanfada)

    Hi @mhdizmni

    Thank you for your reply.

    Any news on this? The attacker performed the exact same attack on my 3rd webshop an hour ago.

    Dear @behroozjanfada,

    We’re working on adding timestamp validation to incoming requests to help prevent repeated calls and protect against potential abuse or attacks.

    This enhancement is expected to be in place within 1–2 weeks, and I’ll keep you updated once it’s live.

    In the meantime, I recommend switching to Server-Side Tracking and restricting access to the WP REST API for WP Statistics. You can do this by adding the following code snippet to your active theme’s functions.php file:

    add_filter('rest_endpoints', function ($endpoints) {
    if (isset($endpoints['/wp-statistics/v2'])) {
    unset($endpoints['/wp-statistics/v2']);
    }
    foreach ($endpoints as $route => $details) {
    if (strpos($route, '/wp-statistics/v2') === 0) {
    unset($endpoints[$route]);
    }
    }

    return $endpoints;
    });

    This will disable access to all REST API routes under the wp-statistics/v2 namespace, helping to reduce unwanted or repeated requests.

    — Matthew

    Thread Starter behroozjanfada

    (@behroozjanfada)

    Hi @mhdizmni

    I’ve applied your workaround since then, which results in inaccurate stats.

    Is timestamp validation implemented in the new update? If so, I can remove rest_endpoints filter from my functions file.

    Hi @behroozjanfada,

    I’m pleased to inform you that we’ve released version 14.13.2. This update includes the implementation of timestamp validation for incoming requests.

    Please update to the latest version and enjoy the improvements!

    — Matthew

    Thread Starter behroozjanfada

    (@behroozjanfada)

    Alright, Thank you @mhdizmni 🙏😍

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

The topic ‘Vulnerability through /wp-json/wp-statistics/v2/online’ is closed to new replies.