Skip to content

Security fix + WordPress.org Plugin Check compliance

Latest

Choose a tag to compare

@iOSDevSK iOSDevSK released this 09 Aug 11:04

Security: unvalidated redirect_uri on the OAuth authorization form

/mcpfowo/v1/auth/authorize-submit accepted any client_id and redirect_uri from the POST body without checking them against a registered client. It then minted an authorization code bound to that URI and redirected the browser there with the code in the query string.

An attacker could host a form pointing at the endpoint with a redirect_uri they control. An administrator who submitted credentials to it would hand over a valid authorization code, exchangeable for an access token — an open redirect and an authorization code leak in one.

Both authorize() and authorize_submit() now share a validate_client_redirect_uri() check requiring a registered client and an exact match against its registered URIs. authorize_submit() validates before processing credentials. The authorize() endpoint already validated correctly; only the form submission path was exposed.

If you use the OAuth flow, update.

OAuth discovery returned 404

/.well-known/oauth-authorization-server served the correct JSON with a 404 status whenever no static file existed — the handler runs on template_redirect, after WordPress has already resolved the request as a 404. OAuth clients discard that. It now sends an explicit 200, and matches the parsed URL path so a query string or trailing slash no longer breaks discovery.

Activation no longer writes a static discovery file into the web root; stale copies from earlier versions are removed on activate and deactivate.

WordPress.org Plugin Check

The distributed package passes wp plugin check with zero errors and zero warnings, including experimental checks and low-severity findings.

  • wc_get_tax_rates built its WHERE clause by concatenation and interpolated it into $wpdb->prepare(), hiding the placeholders from analysis. Rewritten as one literal query with every placeholder visible, plus object caching.
  • Removed set_time_limit() / ini_set() from tools/list and deleted the unused McpPhpProxy class.
  • Globally scoped functions now carry the plugin prefix.
  • client-setup.md moved to documentation/; mcp-proxy.php is no longer bundled, since a command-line script cannot carry a direct-access guard. Both remain in this repository.
  • Tested up to is 7.0 and lives only in readme.txt.