Skip to content

Make the permission_callback argument required #68

@johnbillion

Description

@johnbillion

Reference: https://core.trac.wordpress.org/ticket/50075 plus its comments. Observe that this design deficiency directly led to security vulnerabilities in at least three very popular plugins.

The tl;dr is that it was a mistake for the permission_callback argument to not be required when registering a REST API endpoint, for a few reasons:

  • It makes it easy for a developer to overlook permissions as they aren't required to explicitly implement a permissions check
  • It makes it easy for a typo in the property name to go unnoticed (arguably more of a schema validation problem, but still)

The same concerns apply to the permission_callback argument when registering an ability. This argument should be made mandatory and registration of an ability should fail hard when not present.

Metadata

Metadata

Assignees

Type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions