Make WordPress Core

Opened 4 years ago

Closed 2 years ago

#56079 closed defect (bug) (invalid)

Internal rest_do_request calls for posts/CPTs with status of anything but "published" should not need authentication

Reported by: mkormendy Owned by:
Priority: normal Milestone:
Component: REST API Version:
Severity: normal Keywords:
Cc: Focuses: rest-api

Description (last modified by sabernhardt)

If I am performing an internal rest_do_request() call to a local REST endpoint, I shouldn't need to provide authentication to access posts or custom post types with a status of anything other than "published".

It's an INTERNAL request, it should ALREADY be authenticated by the code running internally already.

Change History (2)

#1 @sabernhardt
3 years ago

  • Component General → REST API
  • Description modified (diff)

#2 @TimothyBlynJacobs
2 years ago

  • Milestone Awaiting Review
  • Resolution → invalid
  • Status new → closed

Thanks for the ticket @mkormendy.

I appreicate while this would be helpful for you. But this is simply not how the REST API has been designed. An internal request shouldn't behave differently from a global one. Changing that at this point would be a security issue. For instance, the Batch API utilizes rest_do_request and relies on endpoints to perform their authentication checks.

Note: See TracTickets for help on using tickets.