fix: replace yaml.load with yaml.safe_load to prevent deserialization…#1343
Merged
dholt merged 1 commit intoNVIDIA:masterfrom Apr 27, 2026
Merged
fix: replace yaml.load with yaml.safe_load to prevent deserialization…#1343dholt merged 1 commit intoNVIDIA:masterfrom
dholt merged 1 commit intoNVIDIA:masterfrom
Conversation
… RCE (NVBug 6119291) Fixes insecure YAML deserialization vulnerability reported via Intigriti (NVIDIA-WHT18LD0). yaml.load() with FullLoader (or no Loader) allows Python object construction tags (!!python/object/new:...) enabling arbitrary code execution. Affected files: - scripts/k8s/update_kubeflow_config.py (2 sinks: outer + inner yaml.load) - workloads/examples/k8s/kubeflow-pipeline-deploy/triton_ops.py (1 sink: no Loader) Fix: replace all instances with yaml.safe_load() which disables Python-specific type constructors entirely.
There was a problem hiding this comment.
Pull request overview
This PR mitigates insecure YAML deserialization by replacing yaml.load(...) usages with yaml.safe_load(...), preventing construction of arbitrary Python objects from YAML content in Kubernetes/Kubeflow-related tooling.
Changes:
- Replace YAML parsing in the Kubeflow Triton pipeline
ResourceOpmanifest fromyaml.loadtoyaml.safe_load. - Replace YAML parsing in the Kubeflow config update script (both outer ConfigMap YAML and embedded
spawner_ui_config.yaml) fromyaml.load(..., Loader=yaml.FullLoader)toyaml.safe_load.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| workloads/examples/k8s/kubeflow-pipeline-deploy/triton_ops.py | Uses yaml.safe_load when turning the Service manifest string into a Kubernetes resource dict. |
| scripts/k8s/update_kubeflow_config.py | Uses yaml.safe_load for both the main config YAML and the embedded UI config YAML to prevent unsafe constructors. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
michael-balint
approved these changes
Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes insecure YAML deserialization vulnerability. yaml.load() with FullLoader (or no Loader) allows Python object construction tags (!!python/object/new:...) enabling arbitrary code execution.
Affected files:
Fix: replace all instances with yaml.safe_load() which disables Python-specific type constructors entirely.