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

2016年9月18日 建站技术 浏览 3,655 抢沙发 A+

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

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

修复步骤:

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漏洞就修复好了!

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: