Type ConfusionWeakness · CWE-843

CVE-2026-54164

MEDIUM · 6.5 CVSS v3.1 Published 2026-07-01
Mitigation only
No fix yet — a mitigation exists. There is no fixed release. A documented workaround reduces exposure in the meantime.
See remediation →
71/100
Remediation priority · Elevated
Remotely reachable Zero-click 7 weeks old

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
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.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

API Platform Core's AbstractItemNormalizer fails to validate resource types when resolving relation IRIs, allowing an attacker to assign a resource of the wrong type to a relation property. This occurs because getResourceFromIri() doesn't pass the $operation to IriConverter::getResourceFromIri(), bypassing the is_a type guard. For untyped relations (legacy @var style), the wrong-typed object is silently assigned; for typed PHP 8.x properties, it's blocked by Symfony's PropertyAccessor.

MitigationUpgrade API Platform Core to version 4.1.30, 4.2.26, or 4.3.12 or later. Restrict write access to API endpoints with writable relations until patched.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
Low
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
None

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify the installed API Platform Core version
    Run `composer show api-platform/core` or check your composer.lock file for the api-platform/core package version
    Affected if The installed version is earlier than 4.1.30, 4.2.26, or 4.3.12 (or does not match one of these release lines)
  2. Verify whether your API resources have relation properties
    Search your entity or API resource classes for properties that represent relationships to other resources, such as ManyToOne, OneToMany, ManyToMany annotations or attributes
    Affected if Your API resources contain relation properties exposed through API Platform
  3. Determine if relations use legacy @var typing or typed PHP 8.x properties
    Inspect your relation properties in the resource classes: look for `@var` docblock annotations on relation fields versus PHP 8 typed properties using `#[ORM\ManyToOne]` or `#[ORM\OneToMany]` with type hints
    Affected if Relations use legacy @var style annotations without PHP 8 typed properties (the vulnerability affects untyped relations)
  4. Check for writable API endpoints on resources with relations
    Review your API Platform configuration or OpenAPI/Swagger documentation to identify which endpoints accept POST, PUT, or PATCH requests on resources that contain relation properties
    Affected if Writable API endpoints exist for resources that include relation properties

You are affected if you run API Platform Core versions earlier than 4.1.30/4.2.26/4.3.12 AND your application exposes writable API endpoints on resources with relations that use legacy @var style typing.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Mitigation available No clean upgrade yet — mitigate in the meantime
Mitigation

Upgrade API Platform Core to version 4.1.30, 4.2.26, or 4.3.12 or later. Restrict write access to API endpoints with writable relations until patched.

Recommended fix High confidence

Upgrade to API Platform Core 4.1.30 (for 4.1.x), 4.2.26 (for 4.2.x), or 4.3.12 (for 4.3.x)

  1. 1. Identify the current API Platform Core version in your project (check composer.json or composer.lock)
  2. 2. For PHP 8.0-8.1 projects: Upgrade to API Platform Core 4.1.30 using: composer require api-platform/core:4.1.30 --no-interaction
  3. 3. For PHP 8.2+ projects with API Platform 4.2.x: Upgrade to version 4.2.26 using: composer require api-platform/core:4.2.26 --no-interaction
  4. 4. For PHP 8.2+ projects with API Platform 4.3.x: Upgrade to version 4.3.12 using: composer require api-platform/core:4.3.12 --no-interaction
  5. 5. Run composer update api-platform/core to install the fixed version
  6. 6. Run your test suite to verify the upgrade does not break existing functionality
  7. 7. Deploy the updated version to your production environment
Caveat Minor version upgrades may include deprecation warnings; review the CHANGELOG for any breaking changes between your current version and the target fixed version

Generated from the published advisory — verify against the referenced sources before acting.

Have this fixed Scoped from the published advisory
  • Consultation2.0 h
  • Implementation4.0 h
  • Testing4.0 h
  • Review / QA2.0 h
12.0 hours of engineering $2,080
Get help mitigating

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $3,328.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2026-54164 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2026-54164 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data