Loading advisory.
Loading advisory.
AutoMapper Vulnerable to Denial of Service (DoS) via Uncontrolled Recursion
AutoMapper is vulnerable to a Denial of Service (DoS) attack. When mapping deeply nested object graphs, the library uses recursive method calls without enforcing a default maximum depth limit.
Published 2026-03-13 20:57 UTC · Modified 2026-09-10 03:50 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score. How tiers work
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| AutoMapper | NuGet | >= 16.0.0, < 16.1.1 < 15.1.1 versions 16.0.0, 16.1.0, 1.1.0.118, 1.1.1, 1.1.2, 10.0.0, 10.1.0, 10.1.1, 11.0.0, 11.0.1, 12.0.0, 12.0.1, 13.0.0, 13.0.1, 14.0.0, 15.0.0, 15.0.1, 15.1.0, 2.0.0, 2.1.1 and 209 more | 16.1.1, 15.1.1 | dotnet add package AutoMapper --version 16.1.1dotnet add package AutoMapper --version 15.1.1 |
AutoMapper is vulnerable to a Denial of Service (DoS) attack. When mapping deeply nested object graphs, the library uses recursive method calls without enforcing a default maximum depth limit. This allows an attacker to provide a specially crafted object graph that exhausts the thread's stack memory, triggering a StackOverflowException and causing the entire application process to terminate.
The vulnerability exists in the core mapping engine. When a source object contains a property of the same type (or a type that eventually points back to itself), AutoMapper recursively attempts to map each level.
Because there is no default limit on how many levels deep this recursion can go, a sufficiently nested object (approximately 25,000+ levels in standard .NET environments) will exceed the stack size. Since StackOverflowException cannot be caught in modern .NET runtimes, the application cannot recover and will crash immediately.
Availability: An attacker can crash the application server, leading to a complete Denial of Service.
Process Termination: Unlike standard exceptions, this terminates the entire process, not just the individual request thread.
The following C# code demonstrates the crash by creating a nested "Circular" object graph and attempting to map it:
class Circular { public Circular Self { get; set; } }
// Setup configuration
var config = new MapperConfiguration(cfg => {
cfg.CreateMap<Circular, Circular>();
});
var mapper = config.CreateMapper();
// Create a deeply nested object (28,000+ levels)
var root = new Circular();
var current = root;
for (int i = 0; i < 30000; i++) {
current.Self = new Circular();
current = current.Self;
}
// This call triggers the StackOverflowException and crashes the process
mapper.Map<Circular>(root);
Secure Defaults: Implement a default MaxDepth (e.g., 32 or 64) for all mapping operations.
Configurable Limit: Allow users to increase this limit if necessary, but ensure it is enabled by default to protect unsuspecting developers.
No public exploit code known to Helm's sources (Nuclei templates, Metasploit, Exploit-DB and PoC-in-GitHub). That does not mean none exists.
EPSS went from 0.006 on 2026-11-24 to 0.008 on 2026-11-26, over 2 recorded scores.
| Date | Score | Previous | Model |
|---|---|---|---|
| 2026-11-24 | 0.006 | first score | v2026.06.15 |
| 2026-11-26 | 0.008 | 0.006 | v2026.06.15 |