psych is vulnerable to Deserialization of Untrusted Data
48
Medium Risk
Psych resolves the !ruby/encoding tag by calling ::Encoding.find directly instead of using the restricted class loader, so safe_load returns an Encoding object even when no classes are permitted. The container tags !ruby/hash, !map:, !ruby/hash-with-ivars, !ruby/array, !seq:, and !ruby/string load the class named in the tag without checking that it is a subclass of the expected Hash, Array, or String, so a crafted document can allocate any permitted class and then call replace, push, or []= on the uninitialized instance, or write instance variables onto it, skipping init_with and returning an instance whose state holds types the class never accepts. The fix registers Encoding with the class loader and rejects tags whose target is not a subclass of the expected Hash, Array, or String.
You are affected if you are using a version that falls within the vulnerable range and you parse untrusted YAML with Psych.safe_load or the default safe Psych.load.
psych is vulnerable to Deserialization of Untrusted Data in versions 2.0.0 - 5.4.0.
Upgrade the psych library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.