Skip to content
代码片段 群组 项目
未验证 提交 10667b34 编辑于 作者: Stan Hu's avatar Stan Hu
浏览文件

Add two more classes allowed for YAML deserialization

The soft enforcement of the Rails 6.1.6.1 security update in
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92400 picked up
two more classes that were serialized in the database with YAML:

1. `Gitlab::Color`: This is used when a label is stored with an issue
    event in the `web_hook_logs` table
    (https://gitlab.com/gitlab-org/gitlab/-/issues/368844).

2. `BigDecimal`: This is used for storing x/y coordinates for image
   diff notes (https://gitlab.com/gitlab-org/gitlab/issues/368846).

Changelog: fixed
上级 eb752ced
No related branches found
No related tags found
无相关合并请求
...@@ -535,6 +535,7 @@ class Application < Rails::Application ...@@ -535,6 +535,7 @@ class Application < Rails::Application
config.after_initialize do config.after_initialize do
config.active_record.yaml_column_permitted_classes = [ config.active_record.yaml_column_permitted_classes = [
Symbol, Date, Time, Symbol, Date, Time,
BigDecimal, # https://gitlab.com/gitlab-org/gitlab/issues/368846
Gitlab::Diff::Position, Gitlab::Diff::Position,
# Used in: # Used in:
# app/models/concerns/diff_positionable_note.rb # app/models/concerns/diff_positionable_note.rb
...@@ -545,7 +546,8 @@ class Application < Rails::Application ...@@ -545,7 +546,8 @@ class Application < Rails::Application
ActiveModel::Attribute.const_get(:FromDatabase, false), # https://gitlab.com/gitlab-org/gitlab/-/issues/368072 ActiveModel::Attribute.const_get(:FromDatabase, false), # https://gitlab.com/gitlab-org/gitlab/-/issues/368072
# Used in app/services/web_hooks/log_execution_service.rb: log_execution # Used in app/services/web_hooks/log_execution_service.rb: log_execution
ActiveSupport::TimeWithZone, ActiveSupport::TimeWithZone,
ActiveSupport::TimeZone ActiveSupport::TimeZone,
Gitlab::Color # https://gitlab.com/gitlab-org/gitlab/-/issues/368844
] ]
# on_master_start yields immediately in unclustered environments and runs # on_master_start yields immediately in unclustered environments and runs
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册