# GHSA-q9q2-3ppx-mwqf: Graylog Allows Stored Cross-Site Scripting via Files Plugin and API Browser

> An attacker with file creation permissions can inject JavaScript via the Files plugin, leading to session hijacking when victims access the API browser.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 7 May 2025

## What is GHSA-q9q2-3ppx-mwqf?

GHSA-q9q2-3ppx-mwqf is a cross-site scripting vulnerability in org.graylog2:graylog2-server, published on 7 May 2025. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

### Official description

### Impact
Two minor vulnerabilities were identified in the Graylog2 enterprise server, which can be combined to carry out a stored cross-site scripting attack.
An attacker with the permission `FILES_CREATE` can exploit these vulnerabilities to upload arbitrary Javascript code to the Graylog2 server, which - upon requesting of the file by a user of the API browser - results in the execution of this Javascript code in the context of the Graylog frontend application. 
This enables the attacker to carry out authenticated API requests with the permissions of the logged-in user, thereby taking over the user session.

### Patches
The generic API has been removed in 6.2.0 rendering the attack vector unreachable and additional escaping has been added.

Analysis provided by Fabian Yamaguchi - Whirly Labs (Pty) Ltd

## Which versions are affected by GHSA-q9q2-3ppx-mwqf?

2 open source packages ship an affected version, including org.graylog2:graylog2-server.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.graylog2:graylog2-server` | Maven | All versions | 6.2.0 |
| `org.graylog2:graylog2-server` | Maven | All versions | 6.2.0 |

## How do I fix GHSA-q9q2-3ppx-mwqf?

Upgrade org.graylog2:graylog2-server to 6.2.0 or later.

## Is GHSA-q9q2-3ppx-mwqf being exploited?

There is no known exploitation of GHSA-q9q2-3ppx-mwqf in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-q9q2-3ppx-mwqf and fix it if it is affected.

What it is: GHSA-q9q2-3ppx-mwqf is a cross-site scripting vulnerability in org.graylog2:graylog2-server, published on 7 May 2025. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of GHSA-q9q2-3ppx-mwqf in the wild and no public exploit code.

Affected packages and fixed versions:
- org.graylog2:graylog2-server (Maven): affected all versions; fixed in 6.2.0
- org.graylog2:graylog2-server (Maven): affected all versions; fixed in 6.2.0

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-q9q2-3ppx-mwqf/ (Markdown: https://insights.sbomify.com/GHSA-q9q2-3ppx-mwqf/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-q9q2-3ppx-mwqf

---
From sbomify Insights: https://insights.sbomify.com/GHSA-q9q2-3ppx-mwqf/
Summaries are generated and may contain mistakes; the official description above is the record.
