- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我将文件名设置为“abc_1.pdf”,其中“1”是模型属性的值。但是 brakeman 扫描仪将此视为安全问题。我需要通过引用具有模型属性的文件名来跟踪文件。能否请您告诉我,解决此安全问题的正确方法是什么?
谢谢。
最佳答案
查看答案 here由 gem 所有者
Brakeman assumes any information in the database is potentially dangerous. This may not be true - perhaps in your application the value used in the file name cannot be set by the user. Also, it may be that your application makes sure to sanitize or restrict the value, which Brakeman cannot know about. Brakeman can only produce warnings about potentially dangerous code, which means there will always be some false positives.
As far as I know, there is no standard way to safely access files from Rails when using untrusted input. Dangerous values include "." and "/" which can be used for directory traversal attacks.
I am afraid I cannot tell you how to fix this issue because it depends on your application and you will have to determine if it is actually an exploitable vulnerability or not. Sorry!
我想这意味着如果您对自己的代码有把握,请将此警告添加到忽略文件
关于ruby-on-rails - Brakeman:文件名警告中使用的模型属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16528350/
我有代码。users_controller.rb def show @user = User.find_by id: params[:id] @microposts = @user
我将文件名设置为“abc_1.pdf”,其中“1”是模型属性的值。但是 brakeman 扫描仪将此视为安全问题。我需要通过引用具有模型属性的文件名来跟踪文件。能否请您告诉我,解决此安全问题的正确方法
我收到很多错误如下 Unescaped model attribute near line 20: show_errors(Objective.new(objective_params), :name
我正在尝试为我的 Rails 项目配置 Brakeman,我希望它忽略某些目录和文件。我找不到指定要排除的路径的选项。有谁知道这是否可能? 最佳答案 现在支持跳过整个目录。参见 https://www
我正在尝试为我的 Rails 项目配置 Brakeman,我希望它忽略某些目录和文件。我找不到指定要排除的路径的选项。有谁知道这是否可能? 最佳答案 现在支持跳过整个目录。参见 https://www
在我的 Rails 应用程序中,我收到来自 brakeman 的以下安全警告。使用模型属性调用的不安全反射方法常量化。这是我的代码正在执行的操作。 chart_type = Chart.where(
我在 Rails 4.2 的应用程序中使用 brakeman 进行安全扫描。它给出了置信度为高的报告,警告类型为危险发送。以下是我遇到问题的 Controller 方法: class Accounts
我在 Rails 4.2 的应用程序中使用 brakeman 进行安全扫描。它给出了置信度为高的报告,警告类型为危险发送。以下是我遇到问题的 Controller 方法: class Accounts
当我使用 Brakeman 工具扫描我的代码时,我收到一条警告消息。它表明存在对以下查询的Unscoped 调用: @applicant = Applicant.find(params[:id]) 这
Rails 应用程序中的模型有一个 url 列,用户可以在其中输入外部站点的地址。 网址显示在页面上。单击时,除了路由到该 url 之外,我还需要在应用程序中执行一些操作。所以我定义了一个 Contr
我正在将 Brakeman 添加到 Rails 产品中,但遇到了问题。我希望它忽略我的 Gemfile 和 Gemfile.lock 但是当我用像 这样的命令运行它时 brakeman --skip-
我在 Rails 5.2 应用程序中使用以下 gem。 # /Gemfile group :development do gem 'guard' gem 'guard-spring' ge
我刚刚开始使用 Rails,所以我使用 Brakeman了解我的新手代码中的潜在漏洞。它在我的 show.js.erb 文件中抛出关于以下代码的高置信度“动态渲染路径”警告: $('#media-fr
我想知道 brakeman 是否涵盖/扫描 OWASP 前 10 大安全漏洞: 这是 OWASP 前 10 名: https://www.owasp.org/index.php/Top_10_2013
我是一名优秀的程序员,十分优秀!