The vulnerability lies within the NodeRestriction admission controller in Kubernetes, which is responsible for enforcing security policies on node objects. The core of the issue is a missing authorization check in the admitNode function. Before the patch, this function failed to validate whether a node was attempting to modify its own ownerReferences field.
An attacker with control over a node could send a patch request to modify their node object, adding an ownerReference that points to another resource. If this referenced resource did not exist or was later deleted, the Kubernetes garbage collector would see the node as an orphaned object and delete it. This would effectively allow a node to cause its own deletion, leading to a denial of service.
The provided patch directly addresses this flaw by introducing a new check within the admitNode function. It compares the ownerReferences of the old and new node objects in an update operation. If they are not identical, the request is rejected with a "Forbidden" error. This ensures that nodes can no longer manipulate their ownerReferences and trigger their own deletion through this mechanism.