GHSA-gpwp-5797-mjff: AutoMapper: Denial of Service via uncontrolled recursion that bypasses MaxDepth
Summary The default and explicit MaxDepth limits added for CVE-2026-32933 don't apply to several mapping paths. Mapping a deeply nested source through any of them recurses without bound and throws a StackOverflowException, which can't be caught and terminates the process.
Affected paths - Polymorphic maps: derived type maps (Include / IncludeBase) didn't inherit the base map's MaxDepth, and the default limit for self-referential maps was only applied to the base map. A chain of derived objects was mapped without a limit, even with MaxDepth set on the base map. - Runtime-typed members: members typed as object or an interface aren't seen by self-reference detection, so the default limit isn't applied. - Dictionary and dynamic sources: mapping a nested Dictionary<string, object> or ExpandoObject (for example, deserialized JSON) onto typed destinations recurses with no depth tracking. MaxDepth has no effect. - Recursive type converters: ConvertUsing that calls context.Mapper.Map ignores MaxDepth.
Impact An application that maps attacker-influenced, deeply nested data through one of these paths can be crashed. On a 1 MB stack (the Windows default), a few thousand levels of nesting are enough.
Fix - Derived type maps inherit MaxDepth, and the default limit is applied to them. - Every runtime map call checks for sufficient stack, and fails with a catchable InsufficientExecutionStackException instead of overflowing.
Workarounds Set MaxDepth explicitly on derived maps and on maps reached through object or interface members. There is no configuration workaround for dictionary or dynamic sources, or for recursive type converters, other than limiting input depth before mapping.
Related - CVE-2026-32933 (GHSA-rvv3-g6hj-g44x) - GHSA-6vhm-j9h7-f9gh: MaxDepth not enforced through constructor parameters and positional records, fixed in the same releases.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
nuget/AutoMapperto a version that resolves this vulnerability.Fixed in 15.1.4 - Upgrade
Upgrade
nuget/AutoMapperto a version that resolves this vulnerability.Fixed in 16.3.0 - Configuration
Set MaxDepth explicitly on derived maps and on maps reached through object or interface members.
AutoMapper MaxDepth = explicit depth limit - Compensating control
Limit input depth before mapping dictionary or dynamic sources, and before mapping through recursive type converters.
Event History
Frequently Asked Questions
Which applications are realistically exposed to remote denial of service?
Applications are exposed when they map attacker-influenced, deeply nested input through a polymorphic map, an object- or interface-typed member, a Dictionary<string, object> or ExpandoObject source, or a recursive ConvertUsing converter. A successful trigger causes an uncatchable StackOverflowException that terminates the process.
Does setting MaxDepth protect all of the affected mapping scenarios?
No. MaxDepth on a base map is not inherited by derived maps using Include or IncludeBase, and it has no effect for nested dictionary or dynamic sources or recursive ConvertUsing converters. Object- and interface-typed members also bypass the default self-reference depth limit.
What input does an attacker need to provide?
The attacker needs to cause the application to map deeply nested data through one of the affected paths. Nested JSON that is deserialized into a Dictionary<string, object> or ExpandoObject is one example described in the advisory.