From 37c3b4ef80f7596cb30df1c475f9fca5a2591a25 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Tue, 15 Dec 2020 00:30:20 -0500 Subject: [PATCH] Validate provisioner userdata with SafeLoader Given the issues with FullLoader and its eventual deprecation, just use SafeLoader instead. Any well-formatted Userdata document should conform. --- client-cli/pvc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client-cli/pvc.py b/client-cli/pvc.py index 99a69bf3..56e29d56 100755 --- a/client-cli/pvc.py +++ b/client-cli/pvc.py @@ -3320,7 +3320,7 @@ def provisioner_userdata_add(name, filename): userdata = filename.read() filename.close() try: - yaml.load(userdata, Loader=yaml.FullLoader) + yaml.load(userdata, Loader=yaml.SafeLoader) except Exception as e: click.echo("Error: Userdata document is malformed") cleanup(False, e) @@ -3397,7 +3397,7 @@ def provisioner_userdata_modify(name, filename, editor): filename.close() try: - yaml.load(userdata, Loader=yaml.FullLoader) + yaml.load(userdata, Loader=yaml.SafeLoader) except Exception as e: click.echo("Error: Userdata document is malformed") cleanup(False, e)