Make WordPress Core


Ignore:
Timestamp:
09/17/2026 09:15:04 PM (10 hours ago)
Author:
desrosj
Message:

Security: Backport the WordPress 7.1.1 security fixes to the 4.7 branch.

  • Posts, Post Types: Reject a supplied post ID on the create path in _wp_translate_postdata().
  • XML-RPC: Reject writes to internal-only builtin post types.
  • Administration: Add authorization check to wp_ajax_sample_permalink().
  • Customize: Improve header_image_data theme mod sanitization.
  • Plugins: Require network plugin authority to Ajax-activate a network-only plugin.
  • Formatting: Prevent wpautop() moving a paragraph into an attribute of a blockquote.

Merges r63657, r63659, r63660, r63665, r63669, r63672 to the 4.7 branch.

Props xknown, westonruter, jorbin, vortfu, batmoo, davidbinda, jeremyfelt, johnbillion, peterwilsoncc, lancewillett, jonsurrell, dmsnell, whyisjake, buffer1024, joehoyle, rafiem.

Location:
branches/4.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

  • branches/4.7/src/wp-admin/includes/post.php

    r54566 r63715  
    2323        if ( empty($post_data) )
    2424                $post_data = &$_POST;
     25
     26        /*
     27         * A raw `ID` on the create path (no `post_ID`) is an attempt to overwrite an
     28         * existing post while bypassing the per-post capability checks below, which only
     29         * run on the update path. Reject it outright: legitimate post creation never
     30         * carries an `ID`.
     31         */
     32        if ( ! $update && ! empty( $post_data['ID'] ) ) {
     33                if ( 'page' === $post_data['post_type'] ) {
     34                        return new WP_Error( 'edit_others_pages', __( 'Sorry, you are not allowed to edit pages as this user.' ) );
     35                } else {
     36                        return new WP_Error( 'edit_others_posts', __( 'Sorry, you are not allowed to edit posts as this user.' ) );
     37                }
     38        }
    2539
    2640        if ( $update )
Note: See TracChangeset for help on using the changeset viewer.