Home/Research/Post

GHSA-gpwp-5797-mjff: AutoMapper: Denial of Service via uncontrolled recursion that bypasses MaxDepth

  • Severity: HIGH
  • CVE: CVE-2026-128081
  • Ecosystems: nuget, nuget
  • Packages: AutoMapper, AutoMapper

### 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` 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
Se…

Source: GitHub Security Advisories · 2026-11-13