Skip to content
Access control Disclosed report Intermediate

Node Validation Admission does not observe all oldObject fields

The Validating Admission webhook for Node objects incorrectly populates the oldObject field in AdmissionReview requests with the same values as the new object for several fields, including labels, taints, and schedulability. This allows users to bypass validating admission controls and modify these fields, potentially steering workloads or disrupting scheduling.

ariellima Follow with rogbas

Originally disclosed on HackerOne

Medium 6.5 View original
  • Fixed in 6 months
  • Paid in 56 days
  • Disclosed after 7 months

Summary:

The Validating Admission webhook for Node Objects is passing oldObject fields incorrectly on AdmissionReview.Request. It was identified initially in metadata.labels, but a list of impacted fields follows below:

oldNode.Spec.PodCIDRs oldNode.Spec.ProviderID oldNode.Spec.ConfigSource oldNode.Status.Config oldNode.ObjectMeta oldNode.Status.Capacity oldNode.Spec.Unschedulable oldNode.Status oldNode.Spec.Taints

Those fields are being set with the same values as the new node object, potentially allowing users to bypass validating admission to update node labels, taints, and others.

Kubernetes Version:

v1.19.x

Component Version:

Validation Webhook for Nodes

Steps To Reproduce:

  1. Create a Validating Webhook Configuration for Node updates
  2. Create an admission Webhook that outputs the content of oldNode and newNode from the admissionReview obejct
  3. Run a patch that changes one of the fields mentioned above.
  4. Look at the log output and compare the old and newObject CRs -- you will notice that the patch you just made appears on the new AND oldObject CRs logged.

Supporting Material/References:

Validating Webhook we created -> https://github.com/ArielLima/managed-cluster-validating-webhooks/blob/nodelabels-webhook/pkg/webhooks/node/node.go#L145-L179

Dummy Validating Webhook -> https://github.com/openshift/generic-admission-server/pull/40/files#diff-ce34cccb3b86fc2740015cfa93de7e314262e3db76d54708d5e1c302e6986436R39

Potential issue location -> https://github.com/kubernetes/kubernetes/blob/c970a46bc1bcc100bbbfabd5c12bd4c5d87f8aea/pkg/apis/core/validation/validation.go#L4792-L4794

Impact

Even though a validating admission webhook thinks that it is restricting actors from mutating certain fields like taints, labels, and schedulability it is not.
Some examples of actions you could perform:

  1. change labels to steer workloads
  2. change labels to prevent scheduling any workload
  3. change taints to push pods off a node

The original report as published on HackerOne, by ariellima. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely, the code that constructs the AdmissionReview request for Node updates copies the new object into the oldObject field for certain fields instead of using the actual previous state.

Impact

A validating admission webhook that intends to restrict changes to node labels, taints, or schedulability may fail to do so, allowing an actor to steer workloads, prevent scheduling, or push pods off a node.

What the attacker needed

Kubernetes v1.19.x; Validating webhook for Node updates; Ability to patch Node objects

How it was found

  1. Create a Validating Webhook Configuration for Node updates.
  2. Create an admission webhook that outputs the content of oldNode and newNode from the admissionReview object.
  3. Run a patch that changes one of the fields mentioned above.
  4. Compare the logged old and new objects; the patch appears in both.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A validating admission webhook is a security check that runs before changes to a Kubernetes object are saved. It compares the old and new versions to decide if the change is allowed. Here, the old version was incorrectly filled with the new values, so the check could not see what actually changed and let forbidden modifications through.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More from Kubernetes

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.