Skip to content
Leaked secrets Write-up Advanced

So I Became A Node: Exploiting Bootstrap Tokens In Azure Kubernetes Service

A Kubernetes bootstrap token was leaked from an AKS pod that shared the host network namespace, allowing an attacker to authenticate as a node and request a signed kubelet certificate. With that certificate, the attacker could access secrets and service accounts available to a single node, which the authors claim is often enough to compromise the whole cluster.

Paul Barbé Follow

Published on synacktiv.com

Rédigé par Paul Barbé, Kévin Schouteeten - 23/04/2024 - dans Pentest - Téléchargement

Paul Barbé, Kévin Schouteeten (@Scouty__), on synacktiv.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

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

How it worked

Root cause

Likely the pod was configured with hostNetwork: true, which let it capture traffic containing the bootstrap token, and the token had permissions to create certificate signing requests that were auto-approved.

Impact

An attacker could obtain a node certificate and access secrets and service accounts available to that node, which could lead to full cluster compromise.

What the attacker needed

Access to a pod with host network namespace; bootstrap token present in the pod's traffic

How it was found

  1. Retrieve a bootstrap token from an AKS pod that shares the host network namespace.
  2. Use the bootstrap token to authenticate to the API server.
  3. Create a certificate signing request with the required node identity fields.
  4. The CSR is automatically approved and signed by the kubelet signer.
  5. Use the signed certificate to authenticate as a node.

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 write-up has not been written yet. The Original tab links to the source.

Kubernetes clusters use certificates to prove who is talking to the API server. A bootstrap token is a temporary password that lets a new machine join the cluster and get its own certificate. If an attacker steals that token, they can pretend to be a new node and ask for a certificate, then use it to read secrets that belong to that node.

What is Leaked secrets?

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.

More from Microsoft (Azure)

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Leaked secrets and credentials

The lesson behind this report.

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.