CVE-2026-128082: AutoMapper Uncontrolled Recursion With Constructor Parameters Vulnerability
HIGHCVE-2026-128082 is a HIGH (CVSS 7.5) uncontrolled recursion with constructor parameters vulnerability (CWE-674: Uncontrolled Recursion) affecting AutoMapper libraries in the NuGet ecosystem. The issue involves uncontrolled recursion with constructor parameters. Remediation is available by upgrading affected packages to version 15.1.4, 16.3.0.
CVE-2026-128082 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2026-128082
To remediate this vulnerability, upgrade all affected AutoMapper dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade AutoMapper to 15.1.4
Upgrade AutoMapper to 16.3.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for AutoMapper
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-128082, inspect your project dependencies for AutoMapper:
inspect dependencies for AutoMapper
Analyze the terminal output to locate any version of AutoMapper in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 15.1.4), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-674: Uncontrolled Recursion, where the product does not properly control the amount of recursion that takes place, consuming excessive resources, such as allocated memory or the program stack. In AutoMapper, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-128082 Affected AutoMapper Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
AutoMapper
|
NuGet |
< 15.1.4
|
15.1.4
|
|
AutoMapper
|
NuGet |
≥ 16.0.0
< 16.3.0
|
16.3.0
|
References
Frequently Asked Questions
What is CVE-2026-128082?
Which AutoMapper versions are affected?
What version fixes CVE-2026-128082?
Is AutoMapper affected?
What is the CVSS score of CVE-2026-128082?
What CWE is associated with CVE-2026-128082?
How can I check NuGet dependencies for CVE-2026-128082?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-6vhm-j9h7-f9gh",
"modified" : "2026-11-13T19:21:02Z",
"published" : "2026-11-13T19:21:02Z",
"aliases" : [ "CVE-2026-128082" ],
"summary" : "AutoMapper: Uncontrolled Recursion with Constructor Parameters",
"details" : "### Summary\n`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.\n\n### Details\nThe 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.\n\nAffected:\n- destination types mapped through constructor parameters, including positional records\n- both an explicit `MaxDepth(n)` and the default limit of 64\n- `ConstructUsing` that maps recursively through `context.Mapper`\n\nWith `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.\n\n### PoC\nThe type only has a constructor with positional arguments, and `MaxDepth` is set to 10:\n\n```csharp\nusing AutoMapper;\n\n\n// Setup configuration - with MaxDepth set\nvar mapper = new MapperConfiguration(cfg =>\n {\n cfg.CreateMap<CircularClass, CircularClass>().MaxDepth(10);\n })\n .CreateMapper();\n\n// Create a deeply nested object (28,000+ levels)\nvar root = new CircularClass(null);\nvar current = root;\nfor (int i = 0; i < 30000; i++)\n{\n current.Next = new CircularClass(null);\n current = current.Next;\n}\n\n// STACK OVERFLOW even though the max depth is set\nvar mappedRoot = mapper.Map<CircularClass>(root);\n\n\npublic class CircularClass\n{\n public CircularClass(CircularClass? Next)\n {\n this.Next = Next;\n }\n\n public CircularClass? Next { get; set; }\n}\n```\n\n### Impact\nAny 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.\n\n### Patches\nFixed 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.\n\n### Workarounds\nIf 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.\n\n### Credits\nReported by @mcambria, who found it while writing a test to confirm their `MaxDepth` mitigation for CVE-2026-32933.\n\n### Related\n- CVE-2026-32933 (GHSA-rvv3-g6hj-g44x)\n- 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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "NuGet",
"name" : "AutoMapper"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "16.0.0"
}, {
"fixed" : "16.3.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "NuGet",
"name" : "AutoMapper"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "15.1.4"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/LuckyPennySoftware/AutoMapper/security/advisories/GHSA-6vhm-j9h7-f9gh"
}, {
"type" : "WEB",
"url" : "https://github.com/LuckyPennySoftware/AutoMapper/commit/4d51a4b8125b4d2302f2f1f455747c9648ad1acb"
}, {
"type" : "WEB",
"url" : "https://github.com/LuckyPennySoftware/AutoMapper/commit/639c2748cb9d3d07df8b86879ba7bcf211675c86"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/LuckyPennySoftware/AutoMapper"
}, {
"type" : "WEB",
"url" : "https://github.com/LuckyPennySoftware/AutoMapper/releases/tag/v15.1.4"
}, {
"type" : "WEB",
"url" : "https://github.com/LuckyPennySoftware/AutoMapper/releases/tag/v16.3.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-674" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-11-13T19:21:02Z",
"nvd_published_at" : null
}
}