ipatests: webui: Use safe-loader for loading YAML configuration file

FullLoader class for YAML loader was introduced in version 5.1 which
also deprecated default loader. SafeLoader, however, stays consistent
across the versions and brings added security.

This fix is necessary as PyYAML > 5.1 is not available in downstream.

Related: https://pagure.io/freeipa/issue/9009

Signed-off-by: Michal Polovka <mpolovka@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
Michal Polovka authored and Rob Crittenden committed 2022-01-14 08:38:41 -05:00
1 parent 325415bb66
commit ff02041350
1 file changed
+1 -1
+1 -1
View File
@@ -191,7 +191,7 @@ class UI_driver:
if not NO_YAML and os.path.isfile(path):
try:
with open(path, 'r') as conf:
cls.config = yaml.load(stream=conf, Loader=yaml.FullLoader)
cls.config = yaml.safe_load(stream=conf)
except yaml.YAMLError as e:
pytest.skip("Invalid Web UI config.\n%s" % e)
except IOError as e: