Skip to content

fix: replace yaml.load with yaml.safe_load to prevent deserialization…#1343

Merged
dholt merged 1 commit intoNVIDIA:masterfrom
dholt:fix/psirt-yaml-deserialization
Apr 27, 2026
Merged

fix: replace yaml.load with yaml.safe_load to prevent deserialization…#1343
dholt merged 1 commit intoNVIDIA:masterfrom
dholt:fix/psirt-yaml-deserialization

Conversation

@dholt
Copy link
Copy Markdown
Contributor

@dholt dholt commented Apr 27, 2026

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:

  • 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.

… 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.
Copilot AI review requested due to automatic review settings April 27, 2026 23:39
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ResourceOp manifest from yaml.load to yaml.safe_load.
  • Replace YAML parsing in the Kubeflow config update script (both outer ConfigMap YAML and embedded spawner_ui_config.yaml) from yaml.load(..., Loader=yaml.FullLoader) to yaml.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.

@dholt dholt merged commit 742f923 into NVIDIA:master Apr 27, 2026
30 of 31 checks passed
@dholt dholt deleted the fix/psirt-yaml-deserialization branch April 27, 2026 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants