• Title: wp_list_users / wp_get_user (other user ID) fail with “not allowed … without authentication” even for administrator accounts — contradicts documented behavior

    Plugin: Easy MCP AI
    Plugin version: 1.7.16
    WordPress version: 7.1
    MCP client used for testing: Claude (Anthropic)
    Connection Diagnostic (easymcpai.com/diagnose) result: all checks passed except a skipped User-Agent/WAF check — reachability, REST namespace, MCP endpoint 401 challenge, and OAuth discovery all OK. Cloudflare WAF and BunnyCDN were detected in front of the site; noted below but I don’t believe they’re the cause (see “why we don’t think this is a WAF issue”).

    SUMMARY

    The built-in wp_list_users tool, and wp_get_user when passed any user ID other than the caller’s own, consistently fail with:

    • wp_list_users -> “Sorry, you are not allowed to access users without authentication.”
    • wp_get_user(other_id) -> “Sorry, you are not allowed to access user data without authentication.”

    This happens even when the MCP connection is authenticated as a WordPress Administrator — a role that has the list_users capability by default. This contradicts your own documentation: the wp_list_users tools page (https://easymcpai.com/tools/wp_list_users) shows a worked example listing OTHER users by role (admin, jane.doe, mike.w), and the FAQ states the tool “becomes available immediately — no coding required” after install + connect. Nothing in the docs indicates a self-only restriction.

    STEPS TO REPRODUCE

    1. Connect to the site via Easy MCP AI’s MCP server, authenticated as an Administrator-role account.
    2. Call wp_get_user with user_id: 0 (self) — succeeds, correctly returns the administrator’s own identity.
    3. Call wp_get_user again with the numeric ID of a different user — fails with “Sorry, you are not allowed to access user data without authentication.”
    4. Call wp_list_users (any parameters) — fails with “Sorry, you are not allowed to access users without authentication.”

    WHY WE DON’T THINK THIS IS A CAPABILITY/ROLE PROBLEM

    • The account’s identity and role are confirmed correct two ways: via the tool’s own self-lookup (wp_get_user(0)), and via a custom WordPress Ability that reads wp_get_current_user() directly. Both agree the account is an Administrator.
    • A custom diagnostic Ability (registered via the WordPress Abilities API, running in the same request context as Easy MCP AI’s tools) explicitly checked current_user_can(‘list_users’), user_can($user, ‘list_users’), and the user’s allcaps array — all three confirmed the capability IS present for this account.
    • We separately tested a non-administrator account (a custom “consultant” role built on core Contributor) after explicitly granting it an equivalent custom capability via a versioned admin_init migration, confirmed present the same way — identical failure, identical error message, regardless of role.
    • Every other tool on the same connection works correctly for the same account, including: several custom WordPress Abilities we’ve registered that resolve users internally via get_user_by()/WP_User_Query directly in PHP (bypassing the REST Users endpoint entirely), and — notably — your own built-in wp_get_user_meta tool, which correctly supports reading ANY user’s meta (not just self) with well-designed nuance: it lets a user read their own meta without edit_users, and explicitly blocks auth-sensitive keys (session_tokens, _application_passwords, etc.) for everyone including administrators. That tool lives in the same “Users” category as the two broken ones and clearly implements correct cross-user authorization elsewhere in the plugin, which makes a plugin-wide or role-wide explanation unlikely — this looks isolated to wp_list_users and wp_get_user specifically.

    WHY WE DON’T THINK THIS IS A WAF/CDN ISSUE

    Our site sits behind Cloudflare (WAF) and BunnyCDN, confirmed via your own Connection Diagnostic tool, which otherwise reported the connection healthy (reachability, REST namespace, MCP endpoint’s 401/WWW-Authenticate challenge, and OAuth discovery all OK). We considered whether a WAF rule blocking REST user-enumeration (a common WordPress hardening pattern) could be responsible, but the error we get back is a precisely WordPress/Easy-MCP-shaped JSON message, not a generic WAF block page or challenge response — which points to this being generated deliberately by PHP running on the site, not intercepted upstream.

    OUR WORKING THEORY

    Self-lookup via these tools succeeds, but requesting another user via the same tools fails with an “unauthenticated” message (not an “insufficient permission” message) despite capabilities being independently confirmed present. This pattern suggests wp_list_users and wp_get_user may be implemented as internal loopback requests to /wp-json/wp/v2/users that don’t carry the authenticated user’s context forward into that sub-request — so WordPress core’s WP_REST_Users_Controller permission checks see an anonymous request and return the “without authentication” message before any capability is evaluated. We did not get to a final trace confirming this exact mechanism (e.g. instrumenting rest_do_request() before/after the internal call), so we can’t say with certainty this is the cause — but every other explanation we were able to test for (capability gaps, role misconfiguration, WAF interference) has been ruled out.

    WHAT WE’D LIKE TO KNOW

    1. Given the documented behavior clearly expects cross-user results, and wp_get_user_meta demonstrates correct cross-user authorization already exists in the plugin, could the authenticated user’s context be passed through properly to wp_list_users and wp_get_user, consistent with how wp_get_user_meta and every custom Ability already behaves?
    2. If there’s a setting we’re missing that restricts these two tools specifically, we couldn’t find it — pointing us to it would also resolve this.

    Happy to share the diagnostic Ability’s code, the Connection Diagnostic output, or run further tests on request.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support malexandric

    (@malexandric)

    Hi @sinemac,

    Thank you for the exceptionally thorough report. Your instinct that the error is generated deliberately by PHP on the site was right, and your capability testing was solid. The culprit is probably just one layer away from where you were looking.

    That exact wording, “Sorry, you are not allowed to access users without authentication” and “access user data without authentication”, does not exist in WordPress core or in Easy MCP AI. I suspect this comes from Really Simple Security (formerly Really Simple SSL), specifically its “Prevent user enumeration” hardening feature. Could you check if you have that plugin active?

    If you do, please try going to Really Simple Security > Settings, then Hardening, and disable “Prevent user enumeration”.

    After that both tools should behave exactly as documented. If you prefer to keep the feature on for anonymous traffic, that is a reasonable choice, but with the current version of that plugin it will also keep blocking these two tools for authenticated MCP and Application Password clients, since its check runs before token authentication can identify the user.

    Let me know if this solves the issue. If not, we’ll dig further into it.

    Thread Starter Scott McCulloch

    (@sinemac)

    Thank you, @malexandric — that was it!!

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

You must be logged in to reply to this topic.