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·21 visits

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•GHSA-9J25-MM2H-2F76
9.9

CVE-2026-48750: Arbitrary File Write on Host via exec-output Symlink in Canonical LXD and Incus

Canonical LXD and LXC Incus contain an arbitrary file write vulnerability (CWE-73 / CWE-59) in the `/1.0/instances/<name>/exec` REST API endpoint. When an instance is unpacked from an image archive, top-level symbolic links are extracted directly onto the host filesystem within the instance storage directory. If a crafted image includes a symbolic link named `exec-output` pointing to an arbitrary host path, invoking the execution endpoint with `record-output: true` causes the privileged host daemon to follow the symlink and write command output files directly to the target host directory. An authenticated attacker with permissions to import images and execute commands can exploit this flaw to write controlled content to sensitive host directories such as `/etc/cron.d`, resulting in arbitrary code execution on the host as `root`.

Alon Barad
Alon Barad
1 views•12 min read
•about 1 hour ago•GHSA-VGHH-5RFX-XHQ8
9.9

CVE-2026-48749: Arbitrary Host File Read and Write via Malicious Image Symlink in Canonical LXD and Incus

CVE-2026-48749 (tracked as GHSA-vghh-5rfx-xhq8 for LXD and GHSA-2q3f-q5pq-g8wv for Incus) is a critical container escape vulnerability in the Canonical LXD and Linux Containers Incus system container managers. By importing a specially crafted container image archive containing duplicate tar member headers, an authenticated attacker can replace the instance rootfs directory with a symbolic link pointing to the underlying host root filesystem. When performing file operations on a stopped container, the privileged forkfile helper binary resolves the symbolic link without confinement and chroots directly into the host filesystem, granting arbitrary root-level file read and write access.

Amit Schendel
Amit Schendel
3 views•9 min read
•about 2 hours ago•GHSA-FMC8-P6Q7-75CC
9.9

GHSA-fmc8-p6q7-75cc: Argument Injection in Canonical LXD Backup Compression Leads to Host Root Code Execution

GHSA-fmc8-p6q7-75cc (associated with CVE-2026-48755) is a critical argument injection vulnerability in Canonical LXD (github.com/canonical/lxd). The vulnerability occurs during instance and storage volume backup operations when processing the user-supplied compression_algorithm configuration parameter. While LXD validates the primary executable token against an allowlist of supported compression binaries, it fails to sanitize or restrict subsequent tokens parsed via shellquote.Split. These additional arguments are passed directly to exec.Command. An authenticated attacker with privileges to trigger backups can inject command-line flags for utilities like zstd to read staged files from a container filesystem and write them to arbitrary paths on the underlying host filesystem, such as /etc/cron.d/, achieving root-level arbitrary code execution on the host.

Amit Schendel
Amit Schendel
6 views•10 min read
•about 3 hours ago•GHSA-PJFF-C2WC-F6JM
9.9

CVE-2026-48769: Arbitrary File Write and Remote Code Execution via Trusted Image Hash in Canonical LXD and Linux Containers Incus

A critical path traversal vulnerability caused by improper input validation (CWE-20) exists in the direct image download handler of Canonical LXD and Linux Containers Incus. When an authenticated user requests an image import using the URL source type, the daemon reads the image fingerprint from an untrusted HTTP response header (`Incus-Image-Hash` or `LXD-Image-Hash`) without validating that it conforms to a SHA-256 format. This unvalidated string is concatenated directly into a filesystem path via `filepath.Join` prior to file creation and cryptographic verification, allowing directory traversal sequences to write arbitrary files on the host filesystem as root.

Alon Barad
Alon Barad
7 views•10 min read
•about 7 hours ago•CVE-2026-9639
6.5

CVE-2026-9639: Authenticated Denial of Service via Nil-Pointer Dereference in Canonical LXD Custom Volume Backup Import

CVE-2026-9639 (GHSA-j93m-3j9p-m5m8) is a null pointer dereference vulnerability in Canonical LXD affecting versions 5.0.0 through 5.21.4 and 6.0 through 6.8. The flaw resides in the (*lxdBackend).CreateCustomVolumeFromBackup method within lxd/storage/backend_lxd.go. An authenticated attacker with the can_create_storage_volumes permission can upload a crafted custom volume backup tarball that omits the expires_at field on a snapshot entry, triggering an unhandled SIGSEGV panic and terminating the LXD daemon.

Amit Schendel
Amit Schendel
7 views•9 min read
•about 8 hours ago•CVE-2026-33050
8.8

CVE-2026-33050: OS Command Injection in GeoNode Vector Upload Handler

An operating system command injection vulnerability (CWE-78) exists in GeoNode versions prior to 5.1.0. The vulnerability occurs in the vector upload processing pipeline when handling user-supplied geospatial files. By supplying a crafted layer name containing shell metacharacters, an authenticated attacker with basic data upload privileges can execute arbitrary commands on the underlying server or container hosting the GeoNode application and Celery worker processes.

Alon Barad
Alon Barad
6 views•9 min read