GHSA-6VHM-J9H7-F9GH

Vulnerability from github – Published: 2026-11-13 19:21 – Updated: 2026-11-13 19:21
VLAI
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.
Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "NuGet",
        "name": "AutoMapper"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "16.0.0"
            },
            {
              "fixed": "16.3.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "NuGet",
        "name": "AutoMapper"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "15.1.4"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-128082"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-674"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-11-13T19:21:02Z",
    "nvd_published_at": null,
    "severity": "HIGH"
  },
  "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\u0027t 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 =\u003e\n    {\n        cfg.CreateMap\u003cCircularClass, CircularClass\u003e().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 \u003c 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\u003cCircularClass\u003e(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\u0027t 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.",
  "id": "GHSA-6vhm-j9h7-f9gh",
  "modified": "2026-11-13T19:21:02Z",
  "published": "2026-11-13T19:21:02Z",
  "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"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "AutoMapper: Uncontrolled Recursion with Constructor Parameters"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
How durations are calculated

Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation.

Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.

Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.