# CVE-2022-36009: Incorrect parsing of access level in gomatrixserverlib and dendrite

> Incorrect power level parsing in gomatrixserverlib allows unauthorized event posting or rejection in Matrix rooms with non-default settings.

- **Severity:** Medium 5.0 (`CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L`)
- **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:** 19 Aug 2022
- **Updated:** 23 Apr 2025
- **Also known as:** GHSA-grvv-h2f9-7v9c, GO-2022-0952

## What is CVE-2022-36009?

CVE-2022-36009 is a medium-severity missing authorization vulnerability in matrix-org gomatrixserverlib, published on 19 Aug 2022. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

gomatrixserverlib is a Go library for matrix protocol federation. Dendrite is a Matrix homeserver written in Go, an alternative to Synapse. The power level parsing within gomatrixserverlib was failing to parse the `"events_default"` key of the `m.room.power_levels` event, defaulting the event default power level to zero in all cases. Power levels are the matrix terminology for user access level. In rooms where the `"events_default"` power level had been changed, this could result in events either being incorrectly authorised or rejected by Dendrite servers. gomatrixserverlib contains a fix as of commit `723fd49` and Dendrite 0.9.3 has been updated accordingly. Matrix rooms where the `"events_default"` power level has not been changed from the default of zero are not vulnerable. Users are advised to upgrade. There are no known workarounds for this issue.

Weakness: CWE-863 (Incorrect Authorization)

## Which versions are affected by CVE-2022-36009?

5 open source packages ship an affected version, including github.com/matrix-org/gomatrixserverlib and github.com/matrix-org/dendrite. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/matrix-org/gomatrixserverlib` | Go | All versions | 0.0.0-20220815091947-723fd495dde8 |
| `github.com/matrix-org/gomatrixserverlib` | Go | All versions | 0.0.0-20220815091947-723fd495dde8 |
| `github.com/matrix-org/gomatrixserverlib` | Go | All versions | 0.0.0-20220815091947-723fd495dde8 |
| `github.com/matrix-org/dendrite` | Go | All versions | 0.9.3 |
| `github.com/matrix-org/dendrite` | Go | All versions | 0.9.3 |

Products: Matrix Dendrite, Matrix Gomatrixserverlib.

## How do I fix CVE-2022-36009?

Upgrade github.com/matrix-org/gomatrixserverlib to 0.0.0-20220815091947-723fd495dde8 or later.

## Is CVE-2022-36009 being exploited?

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

## Other vulnerabilities in matrix-org gomatrixserverlib

- [CVE-2022-39200](https://insights.sbomify.com/CVE-2022-39200/): Signature checks not applied to some retrieved missing events (high 7.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-36009 and fix it if it is affected.

What it is: CVE-2022-36009 is a medium-severity missing authorization vulnerability in matrix-org gomatrixserverlib, published on 19 Aug 2022. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2022-36009 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/matrix-org/gomatrixserverlib (Go): affected all versions; fixed in 0.0.0-20220815091947-723fd495dde8
- github.com/matrix-org/gomatrixserverlib (Go): affected all versions; fixed in 0.0.0-20220815091947-723fd495dde8
- github.com/matrix-org/gomatrixserverlib (Go): affected all versions; fixed in 0.0.0-20220815091947-723fd495dde8
- github.com/matrix-org/dendrite (Go): affected all versions; fixed in 0.9.3
- github.com/matrix-org/dendrite (Go): affected all versions; fixed in 0.9.3

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-2022-36009/ (Markdown: https://insights.sbomify.com/CVE-2022-36009/index.md)
```

## Sources

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

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