Make WordPress Core


Ignore:
Timestamp:
09/17/2026 08:57:16 PM (8 weeks ago)
Author:
desrosj
Message:

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

  • Posts, Post Types: Reject a supplied post ID on the create path in _wp_translate_postdata().
  • Editor: Constrain block template file resolution to the template directory.
  • Comments: Enforce target post permissions when updating notes via REST.
  • 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.
  • Media: Check read_post on the attachment's parent post.
  • Themes: Escape the theme installer preview route value.
  • 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, r63658, r63659, r63660, r63663, r63665, r63669, r63670, r63672, r63675 to the 5.9 branch.

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

Location:
branches/5.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.9

  • branches/5.9/src/wp-admin/includes/ajax-actions.php

    r56875 r63703  
    19651965        check_ajax_referer( 'getpermalink', 'getpermalinknonce' );
    19661966        $post_id = isset( $_POST['post_id'] ) ? (int) $_POST['post_id'] : 0;
     1967        if ( ! $post_id ) {
     1968                // Bypass call to get_preview_post_link() for unspecified post ID.
     1969                wp_die( '' );
     1970        }
     1971        if ( ! current_user_can( 'edit_post', $post_id ) ) {
     1972                wp_die( -1 );
     1973        }
    19671974        wp_die( get_preview_post_link( $post_id ) );
    19681975}
    … …  
    19761983        check_ajax_referer( 'samplepermalink', 'samplepermalinknonce' );
    19771984        $post_id = isset( $_POST['post_id'] ) ? (int) $_POST['post_id'] : 0;
    1978         $title   = isset( $_POST['new_title'] ) ? $_POST['new_title'] : '';
    1979         $slug    = isset( $_POST['new_slug'] ) ? $_POST['new_slug'] : null;
     1985        if ( ! $post_id ) {
     1986                // Bypass call to get_sample_permalink_html() for unspecified post ID.
     1987                wp_die( '' );
     1988        }
     1989        if ( ! current_user_can( 'edit_post', $post_id ) ) {
     1990                wp_die( -1 );
     1991        }
     1992        $title = isset( $_POST['new_title'] ) ? $_POST['new_title'] : '';
     1993        $slug  = isset( $_POST['new_slug'] ) ? $_POST['new_slug'] : null;
    19801994        wp_die( get_sample_permalink_html( $post_id, $title, $slug ) );
    19811995}
Note: See TracChangeset for help on using the changeset viewer.