Health check errors silently dropped when channel buffer full
When KMS operations fail, the plugin sends the error to a fixed-size buffered channel using a non-blocking send, and errors are silently discarded once that buffer is full. Under sustained KMS failure the health check state can become stale, so the health endpoint may report healthy while KMS is actually down.
- Disclosed after 16 days
Component: pkg/plugin/plugin.go:153-156, pkg/plugin/plugin_v2.go:156-158 Affected Version: aws-encryption-provider @ 4341c70 (all versions) Found by: Source audit TLP: TLP:Amber
Summary
When KMS operations fail, the error is sent to a buffered channel (healthCheckErrc, size 100) via a non-blocking send. When the buffer is full, errors are silently dropped. Under sustained KMS failure, the health check goroutine's error state becomes stale, and /healthz may report healthy when KMS is actually down.
Vulnerable Code
// pkg/plugin/plugin.go:152-156 (also plugin_v2.go:155-159)
if err != nil {
select {
case p.healthCheck.healthCheckErrc <- err:
default:
// ERROR SILENTLY DROPPED
}
The channel is created with a fixed buffer:
// pkg/plugin/shared_health_check.go:34
healthCheckErrc: make(chan error, errcBufSize), // errcBufSize = 100
Root Cause
The non-blocking send pattern is intentional — it prevents Encrypt/Decrypt from blocking when the error channel is full. However, the silent drop means the SharedHealthCheck.Start() goroutine (which reads from this channel and calls RecordErr) may miss recent errors. If errors arrive faster than the goroutine consumes them (which happens under sustained failure), health state becomes stale.
Suggested Fix
Replace channel-based error propagation with direct RecordErr calls (already used in Health() method), or log when errors are dropped:
select {
case p.healthCheck.healthCheckErrc <- err:
default:
p.healthCheck.RecordErr(err) // update state directly when channel full
}
Platform
All platforms. Source audit finding.
Impact
Impact
- Under sustained KMS failure (>100 errors queued), new errors are dropped
- Health check timestamp (
lastTs) isn't updated from dropped errors /healthzreports stale status, potentially masking ongoing outages- Kubernetes may not detect the provider is non-functional
- The existing
TestHealthManyRequeststest verifies non-blocking behavior but doesn't verify state correctness after drops
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
The non-blocking send to a fixed-size error channel discards errors when the buffer is full, so the health-check goroutine never records them and its state goes stale.
Impact
Under sustained KMS failure the health endpoint could report a stale healthy status, potentially masking an ongoing outage and preventing Kubernetes from detecting that the provider is non-functional.
What the attacker needed
Sustained KMS failure; more than 100 errors queued
The fix
Error propagation should be changed to call the record-error method directly (as the Health method already does), or at least log errors when the channel is full.
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.
The program keeps a small queue of recent error messages so a background checker can read them. If the queue fills up, new errors are thrown away without any warning, so the checker keeps believing everything is fine. That means a monitoring page can say the service is healthy even though the thing it depends on has stopped working.
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.