Skip to content
Access control Write-up Advanced

The Machine With Many Faces: Post-Exploitation Identity Misuse in SPIFFE/SPIRE

An attacker with root on a Kubernetes node can spoof the cgroup path of a co-located workload so the SPIRE agent issues that workload's SVID to an attacker-controlled process. This lets the attacker impersonate the victim workload and access services that trust its identity.

Eviatar Garzi Follow

Published on unit42.paloaltonetworks.com

This research demonstrates post-exploitation techniques that could allow an attacker with root access on a compromised Kubernetes node to misuse an open standard and reference implementation for machine identity known as SPIFFE/SPIRE to impersonate co-located workloads and harvest SPIFFE Verifiable Identity Documents…

Eviatar Garzi, on unit42.paloaltonetworks.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 SPIRE agent trusts cgroup metadata read from /proc for the calling process without verifying that the process genuinely belongs to that cgroup, so root can rewrite the path.

Impact

An attacker with root on a node could impersonate any co-located workload and access services or resources trusted under that identity; the text notes this technique has not been observed in the wild.

What the attacker needed

Root access on a Kubernetes node; SPIRE agent running on that node; a co-located workload with a registration entry

The fix

Should be fixed by treating node root as fully trusted for all identities on that node and reducing exposure through node hardening, restricted root access, no privileged containers or host access, and avoiding weak selectors.

How it was found

  1. Create a registration entry for a target pod and confirm its identity can be fetched from the pod but not from the host.
  2. Find the target pod's PID and read its cgroup path from /proc.
  3. Create a mock cgroup path mirroring the target's and write the attacker shell's PID into its cgroup.procs file.
  4. Request a JWT SVID from the local SPIRE agent socket and receive the target workload's identity.

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.

SPIRE hands out short-lived digital ID cards (called SVIDs) to programs so they can prove who they are. To decide which ID card a program gets, the local SPIRE agent looks at the program's process details, including a Linux grouping called a cgroup. If someone already has full administrator (root) rights on the machine, they can fake those details and receive another program's ID card.

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.

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.