CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-54164

CVE-2026-54164: Missing IRI Type Validation in API Platform Core Enables Resource Type Confusion

Alon Barad
Alon Barad
Software Engineer

Aug 7, 2026·6 min read·1 visit

Executive Summary (TL;DR)

API Platform Core failed to validate resource types retrieved via relation IRIs, causing Type Confusion in environments with untyped properties.

CVE-2026-54164 is a class/type confusion vulnerability (CWE-843) in API Platform Core. When processing relationships via Internationalized Resource Identifiers (IRIs) in write requests, the framework's normalizer fails to verify if the resolved resource matches the expected type. For PHP applications utilizing untyped properties, the mismatched object is silently assigned, breaking domain logic and data integrity.

Vulnerability Overview

API Platform Core is a widely adopted PHP framework designed to build hypermedia-driven REST and GraphQL APIs. One of its key capabilities is handling relational structures via Internationalized Resource Identifiers (IRIs). During write requests such as POST, PUT, or PATCH, the framework parses these incoming identifiers and resolves them to active database entity instances.

This vulnerability, tracked as CVE-2026-54164, lies within the deserialization routine of relations in the AbstractItemNormalizer. When parsing external representation payloads, the class resolves relation values through an IRI converter. However, it fails to perform an essential class-matching assertion on the retrieved entity, creating a path for type confusion.

The attack surface exists on all writable endpoints that accept links or associations to other entities. If an application utilizes looser PHP constructs like untyped variables, this failure to validate types leads to silent assignment of mismatched entities into relational slots. This bypasses the structural assumptions established in database models and business logic.

Root Cause Analysis

To map an IRI such as /api/foos/1 back to a PHP entity, the serializer's AbstractItemNormalizer invokes IriConverter::getResourceFromIri(). By design, the IriConverter class possesses a type-checking check via the is_a() function to confirm compatibility with the target resource class. Crucially, this type-checking condition only fires if an explicit operational context is supplied to the converter.

In vulnerable versions of API Platform Core, both the AbstractItemNormalizer::getResourceFromIri() and AbstractItemNormalizer::denormalizeRelation() methods request entity resolution without providing this vital operation argument. Because of this omission, the validation routines within the converter are completely skipped during standard deserialization of related resources.

When a mismatched IRI is supplied, the serializer relies on Symfony's PropertyAccessor component to assign the resolved object to the parent model. If the property uses modern PHP native types, Symfony's accessor triggers an exception and aborts. However, if the property is untyped or relies strictly on PHPDoc annotations, the PHP engine silently permits the assignment, resulting in type confusion.

Code Analysis

Comparing the vulnerable implementation against the patched codebase illustrates the type validation failure. In vulnerable iterations of src/Serializer/AbstractItemNormalizer.php, the IRI resolution was executed with no secondary type verification.

// Vulnerable Implementation
private function getResourceFromIri(string $data, array $context, string $resourceClass): ?object
{
    try {
        // The resolved object is returned directly without validating its type against $resourceClass
        return $this->iriConverter->getResourceFromIri($data, $context + ['fetch_data' => true]);
    } catch (ItemNotFoundException $e) {
         // ...
    }
}

The corresponding fix introduces an explicit assertion directly inside the normalizer. This ensures that even when the underlying IRI converter does not enforce type validation, the deserialization loop halts on type mismatches.

// Patched Implementation
private function getResourceFromIri(string $data, array $context, string $resourceClass): ?object
{
    try {
        $item = $this->iriConverter->getResourceFromIri($data, $context + ['fetch_data' => true]);
 
        // Explicit type-confusion guard added in the patch
        if (!is_a($item, $resourceClass)) {
            throw new InvalidArgumentException(\sprintf('The iri "%s" does not reference the correct resource.', $data));
        }
 
        return $item;
    } catch (ItemNotFoundException $e) {
         // ...
    }
}

This implementation uses is_a() to perform the verification. This ensures that polymorphically compatible models, such as subclasses of the target relation, continue to deserialize correctly while rejecting unrelated types.

Exploitation Methodology

An attacker seeking to exploit this flaw first performs passive reconnaissance on the API to map write-enabled endpoints that contain object relations. If an endpoint accepts relation writes but maps them to properties without strict PHP type declarations, it is highly susceptible to this attack.

To perform the injection, the attacker constructs a payload targeting a valid entity, such as Target. The Target model expects a relation pointing to a class of type Foo. However, the attacker replaces the IRI with a reference to class Bar, pointing to /type-confusion/bars/1.

Upon submission, the normalizer processes the request. Because the internal validation guard is missing, the normalizer deserializes the Bar instance and successfully binds it to the parent property. The target application then persists the state or forwards the model to downstream domain operations, where the presence of the unexpected type triggers logical errors.

Impact Assessment

The severity of CVE-2026-54164 is scored at 6.5 (Medium) using the CVSS v3.1 scoring standard. The attack vector is Network, execution complexity is low, and privileges required are low, meaning any authenticated client authorized to interact with the API can trigger the issue.

The integrity impact of this vulnerability is classified as High. By causing type confusion, an attacker can substitute sensitive reference models with irrelevant or unauthorized models, violating business rules and data constraints. If the system relies on entity types to execute state changes, this confusion could lead to security control bypasses.

No direct evidence suggests active exploitation of this flaw in the wild. Its EPSS score sits at a low 0.00195, suggesting limited automated targeting. However, because applications relying on legacy structures fail silently, the vulnerability poses a silent threat to legacy PHP applications.

Remediation & Defenses

The most robust remediation is to upgrade API Platform Core to a patched release. The fix is available in versions 4.1.30, 4.2.26, and 4.3.12. Upgrading is performed via Composer by running composer update api-platform/core.

As a critical defensive practice, developers must migrate legacy codebase elements away from loose variable declarations. Properties must use native PHP strict types rather than relying solely on PHPDoc annotations. This forces Symfony's PropertyAccessor to reject type-mismatched assignments natively, creating a fallback security barrier.

// Secure configuration using strict typing
class Target
{
    // Strictly typed property naturally blocks assignment of mismatched classes
    public ?App\Entity\Foo $relation = null;
}

Additionally, applications that implement custom serializers should ensure they explicitly validate all objects returned from the IRI converter against their expected target classes. Static analysis tools, such as PHPStan or Psalm, should be integrated into continuous deployment pipelines to discover and enforce strict property type-hints across entity schemas.

Fix Analysis (2)

Technical Appendix

CVSS Score
6.5/ 10
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N
EPSS Probability
0.19%
Top 91% most exploited

Affected Systems

API Platform Core

Affected Versions Detail

Product
Affected Versions
Fixed Version
API Platform Core
api-platform
< 4.1.304.1.30
API Platform Core
api-platform
>= 4.2.0, < 4.2.264.2.26
API Platform Core
api-platform
>= 4.3.0, < 4.3.124.3.12
AttributeDetail
CWE IDCWE-843
Attack VectorNetwork
CVSS v3.16.5 (Medium)
EPSS Score0.00195
Exploit Statuspoc
CISA KEVNot Listed

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
CWE-843
Access of Resource Using Incompatible Type ('Type Confusion')

The product allocates or accesses a resource of one type, but later accesses that resource using a type that is incompatible with the original type.

Known Exploits & Detection

GitHub Security AdvisoryThe advisory details vulnerability mechanics and references core test suites demonstrating the type confusion exploit.

Vulnerability Timeline

Initial security patch committed by core developer.
2026-06-03
Official bugfix releases (v4.1.30, v4.2.26, and v4.3.12) tagged and published.
2026-06-13
Security advisory publicly disclosed under GHSA-9rjg-x2p2-h68h.
2026-07-01
National Vulnerability Database (NVD) processes and updates the CVE entry.
2026-07-02

References & Sources

  • [1]GitHub Security Advisory GHSA-9rjg-x2p2-h68h
  • [2]NVD - CVE-2026-54164
  • [3]CVE-2026-54164 on CVE.org

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•16 minutes ago•CVE-2026-56818
6.5

CVE-2026-56818: Denial of Service via Memory Pinning in Netty Redis Array Aggregator

A vulnerability in Netty's Redis codec allows remote unauthenticated attackers to cause a memory-pinning Denial of Service (DoS) due to the failure to release partial aggregate state when specific error conditions occur in RedisArrayAggregator. When processing Redis Serialization Protocol (RESP) messages, the aggregator fails to clear internal queues and release retained direct byte buffers on exception paths triggered by exceeded maxElements or invalid length properties. If the pipeline does not explicitly tear down the connection upon detecting a decoder error, subsequent elements continue utilizing the stale context, allowing memory blocks to remain indefinitely pinned.

Amit Schendel
Amit Schendel
1 views•5 min read
•about 2 hours ago•GHSA-WVPP-8HX9-P66J
9.8

GHSA-WVPP-8HX9-P66J: Arbitrary Command Execution via Option Guard Bypass in GitPython

An unsafe option guard bypass vulnerability exists in GitPython before version 3.1.58. When keyword arguments are passed to Git commands with split_single_char_options=False, GitPython's argument validation helper fails to inspect the combined short-option value. This discrepancy allows short-option token smuggling or clustering manipulation, enabling remote attackers to bypass option blocklists and execute arbitrary system commands.

Alon Barad
Alon Barad
3 views•8 min read
•about 3 hours ago•GHSA-WG23-69C2-GJC8
9.1

GHSA-WG23-69C2-GJC8: Passkey Login Replay Vulnerability in Craft CMS

GHSA-WG23-69C2-GJC8 is a critical security vulnerability discovered in the native Passkey (WebAuthn) login implementation of Craft CMS. The vulnerability allows an attacker to bypass WebAuthn's core cryptographic challenge-response and signature-counter replay protections. By intercepting a single successful passkey login request body, an attacker can replay the identical request payload to generate additional authenticated active sessions, resulting in complete account takeover.

Alon Barad
Alon Barad
2 views•6 min read
•about 4 hours ago•GHSA-JFM3-95JQ-Q3RF
7.5

GHSA-jfm3-95jq-q3rf: Algorithmic Complexity Denial of Service and Path-Delimiter Injection in league/commonmark Footnote Extension

An architectural flaw in the Footnote extension of league/commonmark allows unauthenticated remote attackers to trigger severe denial of service conditions through algorithmic complexity exploitation (O(N^2) CPU and memory exhaustion) and path-delimiter injection leading to unexpected application-level crashes.

Alon Barad
Alon Barad
2 views•8 min read
•about 5 hours ago•GHSA-MH25-X5HQ-WRQP
7.5

GHSA-MH25-X5HQ-WRQP: Algorithmic Complexity Denial of Service in league/commonmark UniqueSlugNormalizer

An algorithmic complexity vulnerability in the UniqueSlugNormalizer component of the league/commonmark PHP library allows unauthenticated remote attackers to trigger severe CPU resource consumption and Denial of Service (DoS) by submitting a Markdown document containing a high volume of duplicate headings. The slug generation loop resets its sequential search index back to 1 for every collision, resulting in a quadratic execution path. This flaw affects versions from 2.0.0-beta1 up to and including 2.8.3, and is patched in version 2.9.0.

Alon Barad
Alon Barad
1 views•6 min read
•about 6 hours ago•GHSA-MJ63-M3RC-8PPR
5.3

GHSA-MJ63-M3RC-8PPR: Quadratic-Time Complexity in league/commonmark XML Pretty-Printing

A Denial of Service vulnerability exists in the league/commonmark package for PHP when using the XML rendering subsystem. Due to unconstrained indentation based on AST depth, rendering deeply nested elements leads to asymmetric resource consumption (quadratic output size complexity).

Amit Schendel
Amit Schendel
2 views•7 min read