# GHSA-4h72-34j6-j8x7: Maloja error page XSS vulnerability

> Reflected XSS in Maloja error pages allows attackers to execute scripts and modify user scrobble data via crafted links.

- **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:** 18 Dec 2023

## What is GHSA-4h72-34j6-j8x7?

GHSA-4h72-34j6-j8x7 is a cross-site scripting vulnerability in malojaserver, published on 18 Dec 2023. 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
The error page for a missing path echoes the path back to the user. If this contains HTML, an attacker could execute a script on the user's machine inside the Maloja context and perform authorized actions like scrobbling or deleting scrobbles.
This does not affect the security of your server. The exploit is purely client-side.
Since there is very little incentive to mess with your scrobble data and it requires very specific targeting (an attacker would have to send a user a link to their own server),  the severity rating might be misleading.

### Patches
The Vulnerability is patched in 3.2.2

## Which versions are affected by GHSA-4h72-34j6-j8x7?

2 open source packages ship an affected version, including malojaserver.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `malojaserver` | PyPI | All versions | 3.2.2 |
| `malojaserver` | PyPI | All versions | 3.2.2 |

## How do I fix GHSA-4h72-34j6-j8x7?

Upgrade malojaserver to 3.2.2 or later.

## Is GHSA-4h72-34j6-j8x7 being exploited?

There is no known exploitation of GHSA-4h72-34j6-j8x7 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-4h72-34j6-j8x7 and fix it if it is affected.

What it is: GHSA-4h72-34j6-j8x7 is a cross-site scripting vulnerability in malojaserver, published on 18 Dec 2023. 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-4h72-34j6-j8x7 in the wild and no public exploit code.

Affected packages and fixed versions:
- malojaserver (PyPI): affected all versions; fixed in 3.2.2
- malojaserver (PyPI): affected all versions; fixed in 3.2.2

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-4h72-34j6-j8x7/ (Markdown: https://insights.sbomify.com/GHSA-4h72-34j6-j8x7/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-4h72-34j6-j8x7

---
From sbomify Insights: https://insights.sbomify.com/GHSA-4h72-34j6-j8x7/
Summaries are generated and may contain mistakes; the official description above is the record.
