In PyYAML before 5.1, the yaml.load() API could execute arbitrary code if used with untrusted data. The load() function has been deprecated in version 5.1 and the 'UnsafeLoader' has been introduced for backward compatibility with the function.
https://security.gentoo.org/glsa/202003-45
https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load%28input%29-Deprecation
https://github.com/yaml/pyyaml/pull/74
https://github.com/yaml/pyyaml/issues/193