WordPress后台插件更新模块任意目录遍历导致DOS漏洞补丁

刚刚,老季收到了阿里云主机发来的邮件,提示我的网站出现了一个漏洞,具体信息为:wordpress后台插件更新模块任意目录遍历导致DOS漏洞。

漏洞描述:WordPress后台文件/wp-admin/includes/ajax-actions.php中,对代码插件路径的输入参数plugin未进行正确的规范化转义,导致黑客可传入特殊路径,造成拒绝服务。

方法一:升级到最新版本

WordPress 新版已解决这个问题,升级到最新版即可。

方法二:使用下面方法进行手动修复。

修复步骤:

  • 1.在文件ajax-actions.php的3068行附近:

$plugin = urldecode( $_POST['plugin'] );

在这段代码后面加上:

$plugin = plugin_basename( sanitize_text_field( wp_unslash( $_POST['plugin'] ) ) );
  • 2.在文件ajax-action.php中大概30004行:

if ( $plugin_update_data === true ) {      wp_send_json_error( $status );  }

修改为:

if ( $plugin_update_data === true ) {  $status['error'] = __( 'Plugin update failed.' );  wp_send_json_error( $status );  }
  • 3.找到3025行:

if ( is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->get_error_code() ) {    $status['error'] = $wp_filesystem->errors->get_error_message();      }  wp_send_json_error( $status );   }  }

修改为:

if ( is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->get_error_code() ) {       $status['error'] = $wp_filesystem->errors->get_error_message();     }  wp_send_json_error( $status );  } else {  // An unhandled error occured  $status['error'] = __( 'Plugin update failed.' );  wp_send_json_error( $status );  }  }

好了,修改保存上传之后,wordpress后台插件更新模块任意目录遍历导致DOS漏洞就修复好了!

腾讯云限时秒杀【点击购买】

搬瓦工,CN2高速线路,1GB带宽,电信联通优化KVM,延迟低,速度快,建站稳定,搬瓦工BandwagonHost VPS优惠码BWH26FXH3HIQ,支持<支付宝> 【点击购买】!

Vultr$3.5日本节点,512M内存/500G流量/1G带宽,电信联通优化,延迟低,速度快【点击购买】!

阿里云香港、新加坡VPS/1核/1G/25G SSD/1T流量/30M带宽/年付¥288【点击购买】