# CVE-2026-44166: Pocketbase: Account pre-hijacking via OAuth2 unverfied->verified autolinking upgrade

> Attackers can pre-hijack accounts by linking unverified OAuth2 profiles, allowing them to take over victim accounts when the victim signs up with a different provider.

- **Severity:** Medium 6.1 (`CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:H/VA:L/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 12 May 2026
- **Updated:** 12 May 2026
- **Also known as:** GHSA-pq7p-mc74-g65w, GO-2026-5548

## What is CVE-2026-44166?

CVE-2026-44166 is a medium-severity authentication bypass vulnerability in pocketbase, published on 12 May 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

Pocketbase is an open source web backend written in go. Prior to 0.22.42 and 0.37.4, in some situations, if an attacker knows the email address of the victim they can create and link an unverified PocketBase user in advance by authenticating with one of the OAuth2 app providers, e.g. "A". When the victim gets invited or decides to sign up to your app on their own with provider "B" (PocketBase OAuth2 auth requires to be with a different provider because we don't allow multiple OAuth2 accounts from the same provider to be associated to a single PocketBase user), the user created previously by the attacker will be autolinked, upgraded to "verified" and its old password reset. This vulnerability is fixed in 0.22.42 and 0.37.4.

Weakness: CWE-287 (Improper Authentication)

## Which versions are affected by CVE-2026-44166?

5 open source packages ship an affected version, including github.com/pocketbase/pocketbase. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/pocketbase/pocketbase` | Go | All versions | 0.22.42, 0.37.4 |
| `github.com/pocketbase/pocketbase` | Go | All versions | 0.22.42 |
| `github.com/pocketbase/pocketbase` | Go | All versions | 0.22.42 |
| `github.com/pocketbase/pocketbase` | Go | From 0.30.0 | 0.37.4 |
| `github.com/pocketbase/pocketbase` | Go | From 0.30.0 | 0.37.4 |

Products: Pocketbase Pocketbase.

## How do I fix CVE-2026-44166?

Upgrade github.com/pocketbase/pocketbase to a fixed version for your release line: 0.22.42 or 0.37.4.

## Is CVE-2026-44166 being exploited?

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

Public exploit code:

- Lab + writeup for CVE-2026-44166: PocketBase OAuth2 account pre-hijacking via unvalidated createData.email (github_poc): https://github.com/Alardiians/pocketbase-CVE-2026-44166

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-44166 and fix it if it is affected.

What it is: CVE-2026-44166 is a medium-severity authentication bypass vulnerability in pocketbase, published on 12 May 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-44166 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/pocketbase/pocketbase (Go): affected all versions; fixed in 0.22.42, 0.37.4
- github.com/pocketbase/pocketbase (Go): affected all versions; fixed in 0.22.42
- github.com/pocketbase/pocketbase (Go): affected all versions; fixed in 0.22.42
- github.com/pocketbase/pocketbase (Go): affected from 0.30.0; fixed in 0.37.4
- github.com/pocketbase/pocketbase (Go): affected from 0.30.0; fixed in 0.37.4

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

## Sources

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

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