# GHSA-fc4h-xcf3-qj5f: matrix-sdk 0.6.0 logs access tokens

> The matrix-sdk library leaks user access tokens into logs when used with specific tracing configurations, allowing attackers with log access to hijack accounts.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 24 Oct 2022
- **Also known as:** RUSTSEC-2022-0062

## What is GHSA-fc4h-xcf3-qj5f?

GHSA-fc4h-xcf3-qj5f is a vulnerability in matrix-sdk, published on 24 Oct 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

When sending Matrix requests using an affected version of `matrix-sdk` in an application that writes logs using `tracing-subscriber` (in a way that includes fields of tracing spans such as `tracing_subscriber`s default text output from the `fmt` module), these logs will contain the user's access token.

## Which versions are affected by GHSA-fc4h-xcf3-qj5f?

3 open source packages ship an affected version, including matrix-sdk.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `matrix-sdk` | crates.io | From 0.6.0 | 0.6.2 |
| `matrix-sdk` | crates.io | From 0.6.0 | 0.6.2 |
| `matrix-sdk` | crates.io | From 0.6.0 | 0.6.2 |

## How do I fix GHSA-fc4h-xcf3-qj5f?

Upgrade matrix-sdk to 0.6.2 or later.

## Is GHSA-fc4h-xcf3-qj5f being exploited?

There is no known exploitation of GHSA-fc4h-xcf3-qj5f in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-fc4h-xcf3-qj5f and fix it if it is affected.

What it is: GHSA-fc4h-xcf3-qj5f is a vulnerability in matrix-sdk, published on 24 Oct 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-fc4h-xcf3-qj5f in the wild and no public exploit code.

Affected packages and fixed versions:
- matrix-sdk (crates.io): affected from 0.6.0; fixed in 0.6.2
- matrix-sdk (crates.io): affected from 0.6.0; fixed in 0.6.2
- matrix-sdk (crates.io): affected from 0.6.0; fixed in 0.6.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-fc4h-xcf3-qj5f/ (Markdown: https://insights.sbomify.com/GHSA-fc4h-xcf3-qj5f/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-fc4h-xcf3-qj5f

---
From sbomify Insights: https://insights.sbomify.com/GHSA-fc4h-xcf3-qj5f/
Summaries are generated and may contain mistakes; the official description above is the record.
