Improper AuthenticationWeakness · CWE-287

CVE-2024-38351

MEDIUM · 5.4 CVSS v3.1 Published 2024-06-18
Mitigation only
No fix yet — a mitigation exists. There is no fixed release. A documented workaround reduces exposure in the meantime.
See remediation →
61/100
Remediation priority · Elevated
Remotely reachable No privileges

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
Pocketbase is an open source web backend written in go. In affected versions a malicious user may be able to compromise other user accounts. In order to be exploited users must have both OAuth2 and Password auth methods enabled. A possible attack scenario could be: 1. a malicious actor register with the targeted user's email (it is unverified), 2. at some later point in time the targeted user stumble on your app and decides to sign-up with OAuth2 (_this step could be also initiated by the attacker by sending an invite email to the targeted user_), 3. on successful OAuth2 auth we search for an existing PocketBase user matching with the OAuth2 user's email and associate them, 4. because we haven't changed the password of the existing PocketBase user during the linking, the malicious actor has access to the targeted user account and will be able to login with the initially created email/password. To prevent this for happening we now reset the password for this specific case if the previously created user wasn't verified (an exception to this is if the linking is explicit/manual, aka. when you send `Authorization:TOKEN` with the OAuth2 auth call). Additionally to warn existing users we now send an email alert in case the user has logged in with password but has at least one OAuth2 account linked. The flow will be further improved with ongoing refactoring and we will start sending emails for "unrecognized device" logins (OTP and MFA is already implemented and will be available with the next v0.23.0 release in the near future). For the time being users are advised to update to version 0.22.14. There are no known workarounds for this vulnerability.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

In PocketBase versions before 0.22.14, a malicious user can compromise accounts by registering with a target user's email, then tricking that user into signing up with OAuth2. When OAuth2 authentication succeeds, the system links the OAuth2 account to the existing user without resetting the password, allowing the attacker to access the account using the originally created email/password credentials.

MitigationUpdate to PocketBase version 0.22.14, which resets passwords for unverified users during OAuth2 linking and sends email alerts to users with both password and OAuth2 accounts linked.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
Required
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Check installed PocketBase version
    Run 'pb version' or inspect the binary/version file, or check the admin dashboard for the version number
    Affected if The version is before 0.22.14 (e.g., 0.22.13, 0.22.12, etc.)
  2. Identify users with both password and OAuth2 accounts
    Query the user database or admin API for users who have both a password hash set and one or more OAuth2 provider records linked
    Affected if Any user account has both password-based credentials and an OAuth2 provider (e.g., Google, GitHub) attached
  3. Identify users with unverified email plus OAuth2 link
    Query for users whose email field shows as unverified but who have an OAuth2 provider linked to their account
    Affected if There are users with unverified email addresses who have OAuth2 providers attached
  4. Review recent account creations for email reuse
    Check user registration logs or audit trail for accounts created with email addresses that were later linked to OAuth2 providers
    Affected if Multiple accounts share the same email, or an OAuth2 flow was linked to an existing password account

You are affected if running PocketBase version below 0.22.14 AND any user account has both password credentials and OAuth2 providers linked, especially with unverified email addresses.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Mitigation available No clean upgrade yet — mitigate in the meantime
Mitigation

Update to PocketBase version 0.22.14, which resets passwords for unverified users during OAuth2 linking and sends email alerts to users with both password and OAuth2 accounts linked.

Recommended fix High confidence

0.22.14

  1. Download PocketBase version 0.22.14 from the official GitHub repository
  2. Replace the existing PocketBase binary with version 0.22.14
  3. Restart the PocketBase service to apply the update

Generated from the published advisory — verify against the referenced sources before acting.

Have this fixed Scoped from the published advisory
  • Consultation3.0 h
  • Implementation6.0 h
  • Testing5.0 h
  • Review / QA3.0 h
17.0 hours of engineering $2,970
Get help mitigating

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $4,752.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2024-38351 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2024-38351 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data