← Back to CVE Explorer

CVE-2026-54164

Full vulnerability record from the local CVENow database.

Description

API Platform Core is a system to create hypermedia-driven REST and GraphQL APIs. In versions prior to 4.1.30, 4.2.26 and 4.3.12, the serializer's AbstractItemNormalizer does not validate the resource type returned when resolving relation IRIs, allowing type confusion where a resource of an unintended type can be silently assigned to a relation property. An attacker who can submit write requests (POST/PUT/PATCH) to an API Platform endpoint with writable relations can supply a relation IRI pointing to a resource of a different type than the relation's declared class. Because getResourceFromIri() does not pass an $operation to IriConverter::getResourceFromIri(), the is_a type guard at IriConverter.php:86 is skipped. For untyped relation properties (legacy @var-only style), the wrong-typed object is silently assigned, corrupting invariants and potentially feeding downstream logic that assumes the declared type (CWE-843). For typed properties (modern PHP 8.x), the substitution is blocked by Symfony's PropertyAccessor with an InvalidTypeException. This issue has been fixed in versions 4.1.30, 4.2.26 and 4.3.12.

Severity
MEDIUM
CVSS score
6.5 (v3.1)
Vulnerability status
Deferred
Source identifier
Published
2026-07-01 20:17:10.657000
Last modified
2026-10-25 16:10:00.147000
View original CVE JSON
{
  "id": "CVE-2026-54164",
  "sourceIdentifier": "[email protected]",
  "published": "2026-07-01T20:17:10.657",
  "lastModified": "2026-10-25T16:10:00.147",
  "vulnStatus": "Deferred",
  "cveTags": [],
  "descriptions": [
    {
      "lang": "en",
      "value": "API Platform Core is a system to create hypermedia-driven REST and GraphQL APIs. In versions prior to 4.1.30, 4.2.26 and 4.3.12, the serializer's AbstractItemNormalizer does not validate the resource type returned when resolving relation IRIs, allowing type confusion where a resource of an unintended type can be silently assigned to a relation property. An attacker who can submit write requests (POST/PUT/PATCH) to an API Platform endpoint with writable relations can supply a relation IRI pointing to a resource of a different type than the relation's declared class. Because getResourceFromIri() does not pass an $operation to IriConverter::getResourceFromIri(), the is_a type guard at IriConverter.php:86 is skipped. For untyped relation properties (legacy @var-only style), the wrong-typed object is silently assigned, corrupting invariants and potentially feeding downstream logic that assumes the declared type (CWE-843). For typed properties (modern PHP 8.x), the substitution is blocked by Symfony's PropertyAccessor with an InvalidTypeException. This issue has been fixed in versions 4.1.30, 4.2.26 and 4.3.12."
    },
    {
      "lang": "es",
      "value": "API Platform Core es un sistema para crear API REST y GraphQL impulsadas por hipermedia. En versiones anteriores a 4.1.30, 4.2.26 y 4.3.12, el AbstractItemNormalizer del serializador no valida el tipo de recurso devuelto al resolver IRIs de relación, permitiendo una confusión de tipos donde un recurso de un tipo no intencionado puede ser asignado silenciosamente a una propiedad de relación. Un atacante que puede enviar solicitudes de escritura (POST/PUT/PATCH) a un endpoint de API Platform con relaciones escribibles puede proporcionar un IRI de relación apuntando a un recurso de un tipo diferente al de la clase declarada de la relación. Debido a que getResourceFromIri() no pasa una $operation a IriConverter::getResourceFromIri(), la guarda de tipo is_a en IriConverter.php:86 es omitida. Para propiedades de relación sin tipo (estilo heredado solo @var), el objeto de tipo incorrecto es asignado silenciosamente, corrompiendo invariantes y potencialmente alimentando lógica posterior que asume el tipo declarado (CWE-843). Para propiedades tipadas (PHP 8.x moderno), la sustitución es bloqueada por el PropertyAccessor de Symfony con una InvalidTypeException. Este problema ha sido solucionado en las versiones 4.1.30, 4.2.26 y 4.3.12."
    }
  ],
  "affected": [
    {
      "source": "[email protected]",
      "affectedData": [
        {
          "vendor": "api-platform",
          "product": "core",
          "versions": [
            {
              "version": "< 4.1.30",
              "status": "affected"
            },
            {
              "version": ">= 4.2.0, < 4.2.26",
              "status": "affected"
            },
            {
              "version": ">= 4.3.0, < 4.3.12",
              "status": "affected"
            }
          ]
        }
      ]
    }
  ],
  "metrics": {
    "cvssMetricV31": [
      {
        "source": "[email protected]",
        "type": "Secondary",
        "cvssData": {
          "version": "3.1",
          "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N",
          "baseScore": 6.5,
          "baseSeverity": "MEDIUM",
          "attackVector": "NETWORK",
          "attackComplexity": "LOW",
          "privilegesRequired": "LOW",
          "userInteraction": "NONE",
          "scope": "UNCHANGED",
          "confidentialityImpact": "NONE",
          "integrityImpact": "HIGH",
          "availabilityImpact": "NONE"
        },
        "exploitabilityScore": 2.8,
        "impactScore": 3.6
      }
    ],
    "ssvcV203": [
      {
        "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
        "ssvcData": {
          "timestamp": "2026-07-02T15:50:13.142519Z",
          "id": "CVE-2026-54164",
          "options": [
            {
              "exploitation": "poc"
            },
            {
              "automatable": "no"
            },
            {
              "technicalImpact": "partial"
            }
          ],
          "role": "CISA Coordinator",
          "version": "2.0.3"
        }
      }
    ]
  },
  "weaknesses": [
    {
      "source": "[email protected]",
      "type": "Secondary",
      "description": [
        {
          "lang": "en",
          "value": "CWE-843"
        }
      ]
    }
  ],
  "references": [
    {
      "url": "https://github.com/api-platform/core/security/advisories/GHSA-9rjg-x2p2-h68h",
      "source": "[email protected]"
    },
    {
      "url": "https://github.com/api-platform/core/security/advisories/GHSA-9rjg-x2p2-h68h",
      "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0"
    }
  ]
}