Skip to content

Commit a3b484b

Browse files
Grouped backports to the 4.3 branch.
- Media: Prevent CSRF setting attachment thumbnails. Merges [55764] to the 4.3 branch. Props dd32, isabel_brison, martinkrcho, matveb, ocean90, paulkevan, peterwilsoncc, timothyblynjacobs, xknown, youknowriad. git-svn-id: https://develop.svn.wordpress.org/branches/4.3@55776 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 8ba5163 commit a3b484b

File tree

7 files changed

+31
-5
lines changed

7 files changed

+31
-5
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "WordPress",
3-
"version": "4.3.30",
3+
"version": "4.3.31",
44
"description": "WordPress is web software you can use to create a beautiful website or blog.",
55
"repository": {
66
"type": "svn",

src/wp-admin/about.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,27 @@
108108
</h2>
109109

110110
<div class="changelog point-releases">
111-
<h3><?php echo _n( 'Maintenance and Security Release', 'Maintenance and Security Releases', 30 ); ?></h3>
111+
<h3><?php echo _n( 'Maintenance and Security Release', 'Maintenance and Security Releases', 31 ); ?></h3>
112+
<p>
113+
<?php
114+
printf(
115+
/* translators: %s: WordPress version number */
116+
__( '<strong>Version %s</strong> addressed one security issue.' ),
117+
'4.3.31'
118+
);
119+
?>
120+
<?php
121+
printf(
122+
/* translators: %s: HelpHub URL */
123+
__( 'For more information, see <a href="%s">the release notes</a>.' ),
124+
sprintf(
125+
/* translators: %s: WordPress version */
126+
esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
127+
sanitize_title( '4.3.31' )
128+
)
129+
);
130+
?>
131+
</p>
112132
<p>
113133
<?php
114134
printf(

src/wp-admin/includes/ajax-actions.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2059,6 +2059,10 @@ function wp_ajax_set_attachment_thumbnail() {
20592059
wp_send_json_error();
20602060
}
20612061

2062+
if ( false === check_ajax_referer( 'set-attachment-thumbnail', '_ajax_nonce', false ) ) {
2063+
wp_send_json_error();
2064+
}
2065+
20622066
$post_ids = array();
20632067
// For each URL, try to find its corresponding post ID.
20642068
foreach ( $_POST['urls'] as $url ) {

src/wp-includes/js/media/views/frame/video-details.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ VideoDetails = MediaDetails.extend({
104104

105105
wp.ajax.send( 'set-attachment-thumbnail', {
106106
data : {
107+
_ajax_nonce: wp.media.view.settings.nonce.setAttachmentThumbnail,
107108
urls: urls,
108109
thumbnail_id: attachment.get( 'id' )
109110
}

src/wp-includes/media.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2977,7 +2977,8 @@ function wp_enqueue_media( $args = array() ) {
29772977
/** This filter is documented in wp-admin/includes/media.php */
29782978
'captions' => ! apply_filters( 'disable_captions', '' ),
29792979
'nonce' => array(
2980-
'sendToEditor' => wp_create_nonce( 'media-send-to-editor' ),
2980+
'sendToEditor' => wp_create_nonce( 'media-send-to-editor' ),
2981+
'setAttachmentThumbnail' => wp_create_nonce( 'set-attachment-thumbnail' ),
29812982
),
29822983
'post' => array(
29832984
'id' => 0,

src/wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* @global string $wp_version
66
*/
7-
$wp_version = '4.3.30-src';
7+
$wp_version = '4.3.31-src';
88

99
/**
1010
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)