Skip to content
DoS Write-up Intermediate

From Stackoverflow to CVE, with some laughs along the way

A YAML parsing flaw in the go-yaml library allowed a crafted YAML document to cause high CPU and memory usage when parsed by the Kubernetes API server, leading to denial of service. An attacker could exploit this by sending such YAML directly to the API server, potentially without authentication in some configurations.

raesene.github.io

Published on raesene.github.io

A couple of weeks ago I was on Stackoverflow and noticed an interesting post with one of my watched tags. The post described a problem where the user had submitted a YAML manifest to their Kubernetes server and caused very high CPU/memory usage, indicating that there could be an application Denial of service issue.

raesene, on raesene.github.io

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 YAML parser did not limit the expansion of recursive entities, allowing a small document to consume excessive resources.

Impact

An attacker could cause a denial of service on the Kubernetes API server, potentially without authentication in some configurations, affecting availability.

What the attacker needed

Ability to send YAML to the API server; possibly unauthenticated access

The fix

The issue was fixed in go-yaml v2 and Kubernetes patch releases; additionally, restrict anonymous access and avoid exposing the API server to the internet.

How it was found

  1. Obtain a YAML document that defines recursive entities (a YAML bomb).
  2. Send the YAML directly to the Kubernetes API server using curl, bypassing local parsing by kubectl.
  3. Observe high CPU and memory usage on the server, indicating a denial of service.

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.

A denial-of-service (DoS) attack makes a computer or service unavailable by overwhelming it with work. Here, a specially crafted YAML file (a text format for configuration) could make the Kubernetes server use too much CPU and memory, slowing or crashing it. The problem was in a library that reads YAML, and it could be triggered by sending the file directly to the server.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.