Skip to content

Commit e19cab5

Browse files
fix: prevent SSRF
1 parent 58e7419 commit e19cab5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

includes/gutenberg/feedzy-rss-feeds-gutenberg-block.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ public function feedzy_register_rest_route() {
285285
'methods' => 'POST',
286286
'callback' => array( $this, 'feedzy_rest_route' ),
287287
'permission_callback' => function () {
288-
return is_user_logged_in();
288+
return current_user_can( 'manage_options' );
289289
},
290290
'args' => array(
291291
'url' => array(
@@ -398,12 +398,12 @@ public function feedzy_rest_route( $data ) {
398398
*/
399399
public function feedzy_sanitize_feeds( $input ) {
400400
if ( count( $input ) === 1 ) {
401-
$feed = esc_url( $input[0] );
401+
$feed = wp_http_validate_url( $input[0] );
402402
return $feed;
403403
} else {
404404
$feeds = array();
405405
foreach ( $input as $item ) {
406-
$feeds[] = esc_url( $item );
406+
$feeds[] = wp_http_validate_url( $item );
407407
}
408408
return $feeds;
409409
}

0 commit comments

Comments
 (0)