forked from kubeflow/kubeflow
-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
Summary
Unvalidated annotation JSON from ImageStream annotations is persisted into ConfigMap data without sufficient validation, which can lead to config poisoning or parser failures downstream.
Details
In components/odh-notebook-controller/controllers/notebook_runtime.go, the opendatahub.io/runtime-image-metadata annotation value from ImageStreams is read and parsed, but the parsed metadata is stored into the pipeline-runtime-images ConfigMap without:
- Enforcing a maximum payload size
- Validating required fields (e.g.,
display_name) - Strict schema validation (only JSON parseability is checked)
A user who can edit ImageStream annotations can inject malformed or oversized payloads that propagate into notebook runtime configuration.
Affected file: components/odh-notebook-controller/controllers/notebook_runtime.go
Affected lines: ~80-88, 185-208
CWE: CWE-20 – Improper Input Validation
Suggested Remediation
- Enforce a maximum size limit on the raw annotation JSON before parsing (e.g., 16 KB).
- Validate required fields (e.g.,
display_name) afterjson.Unmarshal. - Return an error (and skip the entry) when validation fails, rather than silently storing invalid data.
- Update
parseRuntimeImageMetadatato return(string, error)and propagate errors to the call site.
References
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels