# GHSA-9cw3-j7wg-jwj8: Neos Flow Information disclosure in entity security

> Authenticated users can view unauthorized entities due to Doctrine query cache reuse when using advanced Entity Security features.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 17 May 2024

## What is GHSA-9cw3-j7wg-jwj8?

GHSA-9cw3-j7wg-jwj8 is a vulnerability in neos/flow, published on 17 May 2024. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

If you had used entity security and wanted to secure entities not just based on the user's role, but on some property of the user (like the company he belongs to), entity security did not work properly together with the doctrine query cache. This could lead to other users re-using SQL queries from the cache which were built for other users; and thus users could see entities which were not destined for them.

### Am I affected?

- Do you use Entity Security? if no, you are not affected.
- You disabled the Doctrine Cache (Flow_Persistence_Doctrine)? If this is the case, you are not affected.
- You use Entity Security in custom Flow or Neos applications. Read on.
  - If you only used Entity Security based on roles (i.e. role A was allowed to see entities, but role B was denied): In this case, you are not affected.
  - If you did more advanced stuff using Entity Security (like checking that a customer only sees his own orders; or a hotel only sees its own bookings), you very likely needed to register a custom global object in Neos.Flow.aop.globalObjects. In this case, you are affected by the issue; and need to implement the CacheAwareInterface in your global object for proper caching.

All Flow versions (starting in version 3.0, where Entity Security was introduced) were affected.

## Which versions are affected by GHSA-9cw3-j7wg-jwj8?

10 open source packages ship an affected version, including neos/flow.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `neos/flow` | Packagist | From 3.0.0 | 3.0.12 |
| `neos/flow` | Packagist | From 3.0.0 | 3.0.12 |
| `neos/flow` | Packagist | From 3.1.0 | 3.1.10 |
| `neos/flow` | Packagist | From 3.1.0 | 3.1.10 |
| `neos/flow` | Packagist | From 3.2.0 | 3.2.13 |
| `neos/flow` | Packagist | From 3.2.0 | 3.2.13 |
| `neos/flow` | Packagist | From 3.3.0 | 3.3.13 |
| `neos/flow` | Packagist | From 3.3.0 | 3.3.13 |
| `neos/flow` | Packagist | From 4.0.0 | 4.0.6 |
| `neos/flow` | Packagist | From 4.0.0 | 4.0.6 |

## How do I fix GHSA-9cw3-j7wg-jwj8?

Upgrade neos/flow to a fixed version for your release line: 3.0.12, 3.1.10, 3.2.13 or 3.3.13.

## Is GHSA-9cw3-j7wg-jwj8 being exploited?

There is no known exploitation of GHSA-9cw3-j7wg-jwj8 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-9cw3-j7wg-jwj8 and fix it if it is affected.

What it is: GHSA-9cw3-j7wg-jwj8 is a vulnerability in neos/flow, published on 17 May 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-9cw3-j7wg-jwj8 in the wild and no public exploit code.

Affected packages and fixed versions:
- neos/flow (Packagist): affected from 3.0.0; fixed in 3.0.12
- neos/flow (Packagist): affected from 3.0.0; fixed in 3.0.12
- neos/flow (Packagist): affected from 3.1.0; fixed in 3.1.10
- neos/flow (Packagist): affected from 3.1.0; fixed in 3.1.10
- neos/flow (Packagist): affected from 3.2.0; fixed in 3.2.13
- neos/flow (Packagist): affected from 3.2.0; fixed in 3.2.13
- neos/flow (Packagist): affected from 3.3.0; fixed in 3.3.13
- neos/flow (Packagist): affected from 3.3.0; fixed in 3.3.13
- neos/flow (Packagist): affected from 4.0.0; fixed in 4.0.6
- neos/flow (Packagist): affected from 4.0.0; fixed in 4.0.6

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/GHSA-9cw3-j7wg-jwj8/ (Markdown: https://insights.sbomify.com/GHSA-9cw3-j7wg-jwj8/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-9cw3-j7wg-jwj8

---
From sbomify Insights: https://insights.sbomify.com/GHSA-9cw3-j7wg-jwj8/
Summaries are generated and may contain mistakes; the official description above is the record.
