【问题标题】:Security Advisory: GHSA-cfjv-5498-mph5 actionview (RubyGems)安全公告:GHSA-cfjv-5498-mph5 actionview (RubyGems)
【发布时间】:2021-01-03 01:06:07
【问题描述】:

最近我收到一封来自 GitHub 的邮件,其中包含以下安全公告。 它说:

我们在您拥有安全警报访问权限的存储库中发现了一个易受攻击的依赖项。 安全咨询 GHSA-cfjv-5498-mph5

Rails 版本:6.0.3.2

【问题讨论】:

    标签: ruby-on-rails ruby github rubygems actionview


    【解决方案1】:

    做了一些 RnD 并检查邮件中的附加链接。我知道这个问题与 Action View 的翻译助手有关。

    出现此问题When an HTML-unsafe string is passed as the default for a missing translation key named html or ending in _html

    为了解决这个问题,我将我的 rails 版本从 6.0.3.2 更新为 6.0.3.3

    如果您不想更新 Rails 版本,可以通过使用 html_escape 帮助器(别名为 h)手动转义默认翻译来修复其影响:

    <%= t("welcome_html", default: h(untrusted_user_controlled_string)) %>

    此问题出现在 action_view 版本 >= 6.0.0.0, <= 6.0.3.2 and <= 5.2.4.3 已解决6.0.3.3 and 5.2.4.4

    参考:https://github.com/advisories/GHSA-cfjv-5498-mph5

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-11-26
      • 1970-01-01
      • 1970-01-01
      • 2010-10-04
      • 2016-11-11
      • 2023-02-02
      • 2020-06-26
      相关资源
      最近更新 更多