# CVE-2026-49858: API Platform Core: Cross-user attribute leak in JSON:API and HAL item normalizers due to missing isCacheKeySafe gate

> Attackers can view hidden API attributes by exploiting cache key collisions in JSON:API and HAL normalizers, leaking sensitive data across users.

- **Severity:** Medium 5.9 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 1 Jul 2026
- **Updated:** 2 Jul 2026
- **Also known as:** GHSA-pjhx-3c3w-9v23

## What is CVE-2026-49858?

CVE-2026-49858 is a medium-severity vulnerability in api-platform/hal, published on 1 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

API Platform Core is a system to create hypermedia-driven REST and GraphQL APIs. In versions from 2.6.0 prior to 4.1.29, 4.2.26, and 4.3.12, a missing isCacheKeySafe gate in the JSON:API and HAL item normalizers causes a cross-user attribute leak.  #[ApiProperty(security: ...)] is evaluated per request to decide whether a property is exposed. The componentsCache arrays in ApiPlatform\JsonApi\Serializer\ItemNormalizer and ApiPlatform\Hal\Serializer\ItemNormalizer are keyed on $context['cache_key'], which is set unconditionally before delegating to the parent normalizer. The component structure (attributes, relationships, links) computed for one request can therefore be reused for a subsequent request whose user has a different set of accessible properties. A user with lower privileges may end up seeing the structure of properties that the security predicate would otherwise have hidden for them. This issue has been fixed in versions 4.1.29, 4.2.26, and 4.3.12.

Weakness: CWE-639 (Authorization Bypass Through User-Controlled Key), CWE-524 (Use of Cache Containing Sensitive Information)

## Which versions are affected by CVE-2026-49858?

18 open source packages ship an affected version, including api-platform/hal, api-platform/core and api-platform/json-api.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `api-platform/hal` | Packagist | From 4.0.0 | 4.1.29 |
| `api-platform/hal` | Packagist | From 4.0.0 | 4.1.29 |
| `api-platform/hal` | Packagist | From 4.2.0 | 4.2.25 |
| `api-platform/hal` | Packagist | From 4.2.0 | 4.2.25 |
| `api-platform/hal` | Packagist | From 4.3.0 | 4.3.8 |
| `api-platform/hal` | Packagist | From 4.3.0 | 4.3.8 |
| `api-platform/core` | Packagist | From 2.6.0 | 4.1.29 |
| `api-platform/core` | Packagist | From 2.6.0 | 4.1.29 |
| `api-platform/core` | Packagist | From 4.2.0 | 4.2.25 |
| `api-platform/core` | Packagist | From 4.2.0 | 4.2.25 |
| `api-platform/core` | Packagist | From 4.3.0 | 4.3.8 |
| `api-platform/core` | Packagist | From 4.3.0 | 4.3.8 |
| `api-platform/json-api` | Packagist | From 4.0.0 | 4.1.29 |
| `api-platform/json-api` | Packagist | From 4.0.0 | 4.1.29 |
| `api-platform/json-api` | Packagist | From 4.2.0 | 4.2.25 |
| `api-platform/json-api` | Packagist | From 4.2.0 | 4.2.25 |
| `api-platform/json-api` | Packagist | From 4.3.0 | 4.3.8 |
| `api-platform/json-api` | Packagist | From 4.3.0 | 4.3.8 |

## How do I fix CVE-2026-49858?

Upgrade api-platform/hal to a fixed version for your release line: 4.1.29, 4.2.25 or 4.3.8.

## Is CVE-2026-49858 being exploited?

There is no known exploitation of CVE-2026-49858 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-49858 and fix it if it is affected.

What it is: CVE-2026-49858 is a medium-severity vulnerability in api-platform/hal, published on 1 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-49858 in the wild and no public exploit code.

Affected packages and fixed versions:
- api-platform/hal (Packagist): affected from 4.0.0; fixed in 4.1.29
- api-platform/hal (Packagist): affected from 4.0.0; fixed in 4.1.29
- api-platform/hal (Packagist): affected from 4.2.0; fixed in 4.2.25
- api-platform/hal (Packagist): affected from 4.2.0; fixed in 4.2.25
- api-platform/hal (Packagist): affected from 4.3.0; fixed in 4.3.8
- api-platform/hal (Packagist): affected from 4.3.0; fixed in 4.3.8
- api-platform/core (Packagist): affected from 2.6.0; fixed in 4.1.29
- api-platform/core (Packagist): affected from 2.6.0; fixed in 4.1.29
- api-platform/core (Packagist): affected from 4.2.0; fixed in 4.2.25
- api-platform/core (Packagist): affected from 4.2.0; fixed in 4.2.25
- api-platform/core (Packagist): affected from 4.3.0; fixed in 4.3.8
- api-platform/core (Packagist): affected from 4.3.0; fixed in 4.3.8

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-49858/ (Markdown: https://insights.sbomify.com/CVE-2026-49858/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-49858
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-49858
- OSV: https://osv.dev/vulnerability/CVE-2026-49858

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-49858/
Summaries are generated and may contain mistakes; the official description above is the record.
