Possibility to bypass 401
-
Hey,
we are using your plugin for one of our clients. It was possible there to bypass the 401 by adding%2f%2f
at the end of the URL ->/wp-json%2f%2f
We investigated the issues further and found out that the PHP get passed different PATH_INFOS for NGINX and Apache: empty vs /wp-json/
When coming then to your code in
/wp-content/plugins/disable-json-api/classes/disable-rest-api.php
on line93
–is_route_allowed
gets called and in our NGINX case the$currentRoute
variable was set to''
– instead of'/'
in Apache. The problem with this was that''
was neither matched by the allowed routes nor by the disallowed routes, why defaulttrue
got returned and visitors were able to get a valid response even though they shouldnt.So the fix on our side was the following in the
is_route_allowed
function at top:if( empty( $currentRoute ) ) {
$currentRoute = '/';
}Would be great if you could apply a fix here.
All the best
Lukas from Sunlime Web Innovations GmbH
- You must be logged in to reply to this topic.