7.5high
AutoMapper Vulnerable to Denial of Service (DoS) via Uncontrolled Recursion
- Severity
- 7.5high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.77% (higher than 52% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-rvv3-g6hj-g44x
Description
AutoMapper is a convention-based object-object mapper in .NET. Versions prior to 15.1.1 and 16.1.1 are 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. Versions 15.1.1 and 16.1.1 fix the issue.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| LuckyPennySoftware AutoMapper | >= 16.0.0, < 16.1.1, < 15.1.1, before 15.1.1, from 16.0.0 before 16.1.1 | CVE List, NVD |
| AutoMapper (NuGet) | from 16.0.0 before 16.1.1, before 15.1.1 | GitHub Advisory Database |
All scores
| GitHub_M | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.
What each source says
CVE List
AutoMapper is a convention-based object-object mapper in .NET. Versions prior to 15.1.1 and 16.1.1 are 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. Versions 15.1.1 and 16.1.1 fix the issue.
GitHub Advisory Database
Summary
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.
Description
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.
Impact
- 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.
Proof of Concept (PoC)
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);
Recommended Mitigation
- 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.
NVD (es)
AutoMapper es un mapeador de objetos a objetos basado en convenciones en .NET. Las versiones anteriores a la 15.1.1 y 16.1.1 son vulnerables a un ataque de denegación de servicio (DoS). Al mapear grafos de objetos profundamente anidados, la biblioteca utiliza llamadas a métodos recursivas sin imponer un límite de profundidad máxima predeterminado. Esto permite a un atacante proporcionar un grafo de objetos especialmente diseñado que agota la memoria de pila del hilo, lo que desencadena una 'StackOverflowException' y provoca la terminación de todo el proceso de la aplicación. Las versiones 15.1.1 y 16.1.1 solucionan el problema.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-32933 changed 2026-03-20 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-rvv3-g6hj-g44x changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-32933 changed 2026-06-17 | Public domain |