Skip to content

Commit e71aa4b

Browse files
committed
Fixes #19189: BaseScript.load_yaml() should use SafeLoader
1 parent 44cb1a9 commit e71aa4b

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

netbox/extras/scripts.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -528,14 +528,9 @@ def load_yaml(self, filename):
528528
"""
529529
Return data from a YAML file
530530
"""
531-
try:
532-
from yaml import CLoader as Loader
533-
except ImportError:
534-
from yaml import Loader
535-
536531
file_path = os.path.join(settings.SCRIPTS_ROOT, filename)
537532
with open(file_path, 'r') as datafile:
538-
data = yaml.load(datafile, Loader=Loader)
533+
data = yaml.load(datafile, Loader=yaml.SafeLoader)
539534

540535
return data
541536

0 commit comments

Comments
 (0)