JNCIA-DevOps Data Serialization Practice Question
An automation scripter needs to load a YAML configuration file in Python. To prevent arbitrary code execution vulnerabilities associated with untrusted files, which function should always be called?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
yaml.safe_load()
yaml.safe_load() restricts loading to simple Python types like scalars, lists, and dicts, preventing instantiation of arbitrary Python objects.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
yaml.safe_load()
Why this is correct
Correct. yaml.safe_load() restricts the loader to standard data types, mitigating security risks.
- ✗
yaml.load()
Why it's wrong here
Incorrect. yaml.load() is unsafe and can execute arbitrary Python code if given malicious YAML input.
- ✗
yaml.secure_load()
Why it's wrong here
Incorrect. secure_load is not a function in PyYAML.
- ✗
yaml.restricted_load()
Why it's wrong here
Incorrect. restricted_load is not a standard PyYAML function.
About these practice questions
This JNCIA-DevOps question is part of Courseiva's 307-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed August 2026 · checked against the official Juniper Networks exam blueprint
This JNCIA-DevOps practice question is part of Courseiva's free Juniper Networks certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the JNCIA-DevOps exam.