您的购物车目前是空的!
刚刚,老季收到了阿里云主机发来的邮件,提示我的网站出现了一个漏洞,具体信息为:wordpress后台插件更新模块任意目录遍历导致DOS漏洞。
漏洞描述:WordPress后台文件/wp-admin/includes/ajax-actions.php中,对代码插件路径的输入参数plugin未进行正确的规范化转义,导致黑客可传入特殊路径,造成拒绝服务。
Table of Contents
WordPress 新版已解决这个问题,升级到最新版即可。
修复步骤:
$plugin = urldecode( $_POST['plugin'] );
在这段代码后面加上:
$plugin = plugin_basename( sanitize_text_field( wp_unslash( $_POST['plugin'] ) ) );
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 ); }
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漏洞就修复好了!