GHSA-6vhm-j9h7-f9gh

Suggest an improvement
Source
https://github.com/advisories/GHSA-6vhm-j9h7-f9gh
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-6vhm-j9h7-f9gh/GHSA-6vhm-j9h7-f9gh.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-6vhm-j9h7-f9gh
Aliases
  • CVE-2026-128082
Published
2026-11-13T19:21:02Z
Modified
2026-11-13T19:30:06Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
AutoMapper: Uncontrolled Recursion with Constructor Parameters
Details

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
  • ConstructUsing that maps recursively through context.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.
Database specific
{
    "cwe_ids": [
        "CWE-674"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-11-13T19:21:02Z",
    "nvd_published_at": null,
    "severity": "HIGH"
}
References

Affected packages

NuGet / AutoMapper

Package

Name
AutoMapper
View open source insights on deps.dev
Purl
pkg:nuget/AutoMapper

Affected ranges

Type
ECOSYSTEM
Events
Introduced
16.0.0
Fixed
16.3.0

Affected versions

16.*
16.0.0
16.1.0
16.1.1
16.2.0

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-6vhm-j9h7-f9gh/GHSA-6vhm-j9h7-f9gh.json"

NuGet / AutoMapper

Package

Name
AutoMapper
View open source insights on deps.dev
Purl
pkg:nuget/AutoMapper

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
15.1.4

Affected versions

1.*
1.1.0.118
1.1.1
1.1.2
2.*
2.0.0
2.1.1
2.1.262
2.1.265
2.1.266
2.1.267
2.2.0
2.2.1-ci10
2.2.1-ci1000
2.2.1-ci11
2.2.1-ci15
2.2.1-ci16
2.2.1-ci17
2.2.1-ci4
2.2.1-ci5
2.2.1-ci6
2.2.1-ci7
2.2.1-ci8
2.2.1-ci9
2.2.1-ci9000
2.2.1-ci9001
2.2.1-ci9002
2.2.1-ci9003
2.2.1-ci9004
2.2.1-ci9005
2.2.1-ci9006
2.2.1
2.2.24-ci
2.2.25-ci
3.*
3.0.0-ci1026
3.0.0-ci1028
3.0.0-ci1029
3.0.0-ci1031
3.0.0-ci1032
3.0.0-ci1033
3.0.0-ci1034
3.0.0-ci1035
3.0.0-ci1036
3.0.0-ci1037
3.0.0-ci1038
3.0.0-ci1039
3.0.0-ci1040
3.0.0-ci1041
3.0.0-ci1042
3.0.0-ci1043
3.0.0-ci1053
3.0.0
3.1.0-ci1014
3.1.0-ci1016
3.1.0-ci1017
3.1.0-ci1018
3.1.0-ci1019
3.1.0-ci1020
3.1.0-ci1021
3.1.0-ci1022
3.1.0-ci1023
3.1.0-ci1024
3.1.0-ci1026
3.1.0-ci1027
3.1.0-ci1032
3.1.0-ci1033
3.1.0-ci1034
3.1.0-ci1035
3.1.0-ci1036
3.1.0-ci1037
3.1.0-ci1038
3.1.0-ci1043
3.1.0-ci1044
3.1.0-ci1045
3.1.0-ci1046
3.1.0-ci1047
3.1.0-ci1048
3.1.0-ci1049
3.1.0-ci1050
3.1.0-ci1051
3.1.0-ci1053
3.1.0-ci1056
3.1.0-ci1058
3.1.0
3.1.1-ci1000
3.1.1-ci1003
3.1.1
3.2.0-ci1000
3.2.0-ci1001
3.2.0-ci1002
3.2.0-ci1003
3.2.0-ci1004
3.2.0-ci1005
3.2.0-ci1008
3.2.0-ci1009
3.2.0-ci1010
3.2.0-ci1011
3.2.0-ci1014
3.2.0-ci1015
3.2.0-ci1016
3.2.0-ci1017
3.2.0-ci1021
3.2.0-ci1022
3.2.0-ci1023
3.2.0-ci1024
3.2.0-ci1025
3.2.0-ci1026
3.2.0-ci1027
3.2.0-ci1028
3.2.0-ci1029
3.2.0-ci1030
3.2.0-ci1033
3.2.0-ci1034
3.2.0-ci1035
3.2.0-ci1036
3.2.0-ci1037
3.2.0-ci1038
3.2.0-ci1039
3.2.0-ci1040
3.2.0-ci1041
3.2.0-ci1042
3.2.0-ci1043
3.2.0
3.2.1-ci1000
3.2.1-ci1001
3.2.1-ci1002
3.2.1
3.3.0-ci1000
3.3.0-ci1001
3.3.0-ci1002
3.3.0-ci1003
3.3.0-ci1004
3.3.0-ci1005
3.3.0-ci1006
3.3.0-ci1007
3.3.0-ci1008
3.3.0-ci1009
3.3.0-ci1016
3.3.0-ci1017
3.3.0-ci1018
3.3.0-ci1019
3.3.0-ci1020
3.3.0-ci1021
3.3.0-ci1022
3.3.0-ci1023
3.3.0-ci1024
3.3.0-ci1025
3.3.0-ci1026
3.3.0-ci1027
3.3.0-ci1028
3.3.0-ci1029
3.3.0-ci1030
3.3.0-ci1031
3.3.0-ci1032
3.3.0-ci1033
3.3.0
3.3.1
4.*
4.0.0-alpha1
4.0.0-ci1002
4.0.0-ci1004
4.0.0-ci1006
4.0.0-ci1007
4.0.0-ci1014
4.0.0-ci1015
4.0.0-ci1017
4.0.0-ci1018
4.0.0-ci1019
4.0.0-ci1020
4.0.0-ci1021
4.0.0-ci1026
4.0.0-ci1031
4.0.0-ci1032
4.0.0-ci1034
4.0.0-ci1036
4.0.0-ci1038
4.0.0-ci1046
4.0.0-ci1049
4.0.0-ci1050
4.0.0-ci1051
4.0.0-ci1052
4.0.0-ci1053
4.0.0-ci1054
4.0.0-ci1056
4.0.0-ci1057
4.0.0-ci1061
4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
4.1.0
4.1.1
4.2.0
4.2.1
5.*
5.0.0-beta-1
5.0.0
5.0.1
5.0.2
5.1.0
5.1.1
5.2.0
6.*
6.0.0
6.0.1
6.0.2
6.1.0
6.1.1
6.2.0
6.2.1
6.2.2
7.*
7.0.0-alpha-0001
7.0.0
7.0.1
8.*
8.0.0
8.1.0
8.1.1
9.*
9.0.0
10.*
10.0.0
10.1.0
10.1.1
11.*
11.0.0
11.0.1
12.*
12.0.0
12.0.1
13.*
13.0.0
13.0.1
14.*
14.0.0
15.*
15.0.0
15.0.1
15.1.0
15.1.1
15.1.2
15.1.3

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-6vhm-j9h7-f9gh/GHSA-6vhm-j9h7-f9gh.json"