Skip to content

APIServer does not validate parent resource apiGroup and apiVersion in scoped resource paths #444

@JoseSzycho

Description

@JoseSzycho

APIServer does not validate parent resource apiGroup and apiVersion in scoped resource paths

Description

The Milo APIServer is not validating the apiGroup and apiVersion segments when accessing project-scoped or organization-scoped resources. This allows requests with invalid or arbitrary values to succeed and return data.

Steps to Reproduce

  1. Make a request with valid parent resource path:
kubectl --kubeconfig datumstaging get --raw \
  /apis/resourcemanager.miloapis.com/v1alpha1/projects/test-mdqzir/control-plane/apis/dns.networking.miloapis.com/v1alpha1/dnszoneclasses
  1. Make a request with invalid parent resource apiGroup and apiVersion:
kubectl --kubeconfig datumstaging get --raw \
  /apis/invalidGroup/invalidVersion/projects/test-mdqzir/control-plane/apis/dns.networking.miloapis.com/v1alpha1/dnszoneclasses

Expected Behavior

The second request should return a 404 Not Found or 400 Bad Request error since invalidGroup/invalidVersion is not a valid apiGroup/apiVersion combination.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions