CVE-2026-128082 — Vulnerability in AutoMapper — CVE Details
AutoMapper: Uncontrolled Recursion with Constructor Parameters
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.67%). Schedule for your next planned update.
Does your project use an affected AutoMapper version?
Paste your packages.lock.json to check it for CVE-2026-128082 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Summary
MaxDepth, whether set explicitly or applied by default (64) to self-referential type maps, was not enforced when the recursion goes through constructor parameters. Mapping a deeply nested source to a destination built through its constructor, such as a positional record, recurses without bound and throws a StackOverflowException. That exception can't be caught and terminates the process. This bypasses the mitigation for CVE-2026-32933.
Details
The type depth used by MaxDepth was incremented only after the destination object was created. Constructor parameters, including child objects of the same type, are mapped while the destination is created, so each level recursed before its parent was counted, and the depth check never tripped.
Affected:
- destination types mapped through constructor parameters, including positional records
- both an explicit
MaxDepth(n)and the default limit of 64 ConstructUsingthat maps recursively throughcontext.Mapper
With MaxDepth(10), a 100-level chain was mapped to all 100 levels. On a 1 MB stack (the Windows default), the process crashed at between 1,000 and 2,000 levels.
PoC
The type only has a constructor with positional arguments, and MaxDepth is set to 10:
using AutoMapper;
// Setup configuration - with MaxDepth set
var mapper = new MapperConfiguration(cfg =>
{
cfg.CreateMap<CircularClass, CircularClass>().MaxDepth(10);
})
.CreateMapper();
// Create a deeply nested object (28,000+ levels)
var root = new CircularClass(null);
var current = root;
for (int i = 0; i < 30000; i++)
{
current.Next = new CircularClass(null);
current = current.Next;
}
// STACK OVERFLOW even though the max depth is set
var mappedRoot = mapper.Map<CircularClass>(root);
public class CircularClass
{
public CircularClass(CircularClass? Next)
{
this.Next = Next;
}
public CircularClass? Next { get; set; }
}
Impact
Any application that maps attacker-influenced, deeply nested data to a destination type built through a constructor, with a recursive member, can be crashed. Setting MaxDepth as recommended for CVE-2026-32933 doesn't protect these mappings.
Patches
Fixed in 16.3.0 and 15.1.4. The depth is now counted before the destination is created, so constructor mapping stops at the same depth as property mapping.
Workarounds
If the destination type has a parameterless constructor and settable properties, cfg.DisableConstructorMapping() makes AutoMapper map through the properties, where MaxDepth is enforced. Positional records have no workaround other than limiting input depth before mapping, or upgrading.
Credits
Reported by @mcambria, who found it while writing a test to confirm their MaxDepth mitigation for CVE-2026-32933.
Related
- CVE-2026-32933 (GHSA-rvv3-g6hj-g44x)
- GHSA-gpwp-5797-mjff: other paths that bypassed
MaxDepth(polymorphic maps, runtime-typed members, dictionary and dynamic sources, recursive type converters), fixed in the same releases.
Advisory Timeline
- First published November 13, 2026 (13 days ago).
- Last revised November 13, 2026 — 0 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
dotnet add package AutoMapper --version 16.3.0
dotnet add package AutoMapper --version 15.1.4
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (2)
Affects 1 ecosystem: NuGet (1).
| Package | Fixed In |
|---|---|
| AutoMapper NuGet · Affected: 16.0.0, 16.1.0, 16.1.1, 16.2.0 | 16.3.0 |
| AutoMapper NuGet · Affected: 1.1.0.118, 1.1.1, 1.1.2, 10.0.0 (+226 more) | 15.1.4 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-674
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
References
- https://github.com/LuckyPennySoftware/AutoMapper/security/advisories/GHSA-6vhm-j9h7-f9ghWEB
- https://github.com/LuckyPennySoftware/AutoMapper/commit/4d51a4b8125b4d2302f2f1f455747c9648ad1acbWEB
- https://github.com/LuckyPennySoftware/AutoMapper/commit/639c2748cb9d3d07df8b86879ba7bcf211675c86WEB
- https://github.com/LuckyPennySoftware/AutoMapperPACKAGE
- https://github.com/LuckyPennySoftware/AutoMapper/releases/tag/v15.1.4WEB
- https://github.com/LuckyPennySoftware/AutoMapper/releases/tag/v16.3.0WEB
Frequently Asked Questions
- What is CVE-2026-128082?
- AutoMapper: Uncontrolled Recursion with Constructor Parameters. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
- How do I check if my project is affected by CVE-2026-128082?
- CVE-2026-128082 affects AutoMapper. It has a 0.7% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-128082 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This is a below-median EPSS score — only 47% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2026-102529HIGH
HtmlSanitizer: CSS Removal DoS
- CVE-2026-128081HIGH
AutoMapper: Denial of Service via uncontrolled recursion that bypasses MaxDepth
- CVE-2026-32933HIGH
AutoMapper Vulnerable to Denial of Service (DoS) via Uncontrolled Recursion
- CVE-2026-63184HIGH
Refitter: Unrestricted OpenAPI references permit build-host SSRF and file inclusion