Every uncached /avatar/:hash request spawns a goroutine that refreshes the Gravatar image. If the refresh sits in the 10-slot worker queue longer than three seconds, the handler times out and stops listening for the result, so that goroutine blocks forever trying to send on an unbuffered channel. Sustained traffic with random hashes keeps tripping this timeout, so goroutine count grows linearly, eventually exhausting memory and causing Grafana to crash on some systems.
The product does not properly control the allocation and maintenance of a limited resource.
| Name | Vendor | Start Version | End Version |
|---|---|---|---|
| Grafana | Grafana | 3.0.0 (including) | 11.6.9 (excluding) |
| Grafana | Grafana | 12.0.0 (including) | 12.0.8 (excluding) |
| Grafana | Grafana | 12.1.0 (including) | 12.1.5 (excluding) |
| Grafana | Grafana | 12.2.0 (including) | 12.2.3 (excluding) |
| Grafana | Grafana | 12.3.0 (including) | 12.3.0 (including) |
Mitigation of resource exhaustion attacks requires that the target system either:
The first of these solutions is an issue in itself though, since it may allow attackers to prevent the use of the system by a particular valid user. If the attacker impersonates the valid user, they may be able to prevent the user from accessing the server in question.
The second solution is simply difficult to effectively institute – and even when properly done, it does not provide a full solution. It simply makes the attack require more resources on the part of the attacker.