Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#24564 closed defect (bug) (duplicate)

wp_insert_post checks permissions of the current user, not the author

Reported by: rmccue Owned by:
Priority: normal Milestone:
Component: Security Version:
Severity: normal Keywords:
Cc: Focuses:

Description

In wp_insert_post(), current_user_can() is called twice to check permissions (publish_posts for setting the slug and the assign terms capability for taxonomies.

This global state should be removed from wp_insert_post() in favour of user_can() using the post's author.

Change History (3)

#1 @rmccue
13 years ago

(From a quick look, this also applies to wp_insert_attachment() as well.)

#2 @dd32
13 years ago

  • Milestone Awaiting Review
  • Resolutionduplicate
  • Status newclosed

Duplicate of #19373.

#3 @nacin
13 years ago

#19373 (as a new level of API, realistically) is the preferred path forward. The change proposed here actually has security issues with it.

Note: See TracTickets for help on using tickets.