3
0

More than 1 year has passed since last update.

`bootsnap`を`1.16.0`にバージョンアップしたら`Psych::DisallowedClass`エラーが発生した

Posted at

事象

bootsnapをバージョン1.16.0にバージョンアップしたら以下のエラーが発生しました。

Psych::DisallowedClass:
 Tried to load unspecified class: Time

原因

rubyYAMLパーサーライブラリPsychにおいて、バージョン4.0.0以降セキュリティ脆弱性対策としてYAML.load_fileメソッドの挙動がデフォルトでsafe_modeという厳格なパースを行うように変更されている様です。
※ これまでの挙動と同じにするにはYAML.unsafe_load_fileを使う必要がある様です。

上記に付随してbootsnapでも DateTimeの値とエイリアスを適切に拒否する様に対応がされました。

Psych::DisallowedClass:
 Tried to load unspecified class: Time

対応

調査したところcommitteeというライブラリでYAML.load_fileを呼び出しておりエラーが発生していました。
committeeでは5.0.0Psych4.0.0に対応されていたのでバージョンアップしたら解消されました。

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0