/

CVE-2026-91924

Severity:

HIGH RISK

(8.5)

Missing Authorization (CWE-862) in pgweb Connect API

CVE-2026-91924

Deferred

Vulnerability type

Category:

Missing Authorization

CWE:

CWE-862

Impact:

Unauthorized Database and Internal Service Access

Severity:

HIGH RISK

(8.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

pgweb leaves its database connection endpoint insufficiently protected when connect-backend authorization is enabled. An attacker who can reach the endpoint may submit a custom session identifier and connection string to bypass resource-to-database mapping and access unauthorized databases or internal services.

Affected context

The issue occurs in pgweb deployments using connect-backend authorization where the POST /api/connect endpoint remains accessible without equivalent authorization enforcement. Risk is higher when the service can reach sensitive databases or internal network destinations and accepts user-controlled connection parameters.

Exploit preconditions

  • Attack surface: The pgweb HTTP API, specifically the POST /api/connect endpoint
  • Required access: Network reachability to the endpoint; authentication requirements depend on the surrounding deployment
  • Trigger point: Submission of a connection request containing attacker-controlled session and database connection details
  • Why exploitation is possible: The endpoint does not consistently enforce the configured authorization policy, allowing supplied identifiers and connection strings to bypass intended resource-to-database mappings

Why this happens

The underlying flaw is an authorization enforcement gap. The application protects or configures access through resource-to-database mappings but does not apply equivalent authorization checks to the connection endpoint before using caller-controlled connection information. This behavior maps to CWE-862, Missing Authorization, because a sensitive operation can proceed without verifying that the requester is permitted to access the selected resource.

Potential impact

  • Attackers could connect to databases outside their authorized scope.
  • Attackers may access sensitive data or perform unauthorized database actions.
  • The service could be used to reach internal network services from a trusted environment.
  • Credentials, metadata, or other protected information could be exposed.
  • Unauthorized connections could cause data modification or service disruption.

General mitigation guidance

Mitigation generally focuses on enforcing authorization at every endpoint that creates or changes backend connections, rather than relying only on resource-to-database mappings. Secure-by-default designs should permit connections only to explicitly approved targets, bind session identifiers to authenticated principals, and avoid accepting arbitrary connection strings from untrusted clients. Input trust should be reduced through strict allowlists and schema validation, while database and service identities should use least privilege and constrained network access. Deployment policy can also restrict the pgweb service from reaching sensitive internal destinations.

How teams detect issues like this

Detection can include static and dynamic checks for connection endpoints that accept client-controlled targets without an authorization decision. Code review should examine whether authorization is performed before connection creation and whether session identifiers are bound to authenticated users. API security testing can verify that configured mappings cannot be bypassed with alternate identifiers or connection parameters. Policy enforcement may restrict outbound database and internal-service access from administrative web tools, while centralized logs can flag unusual connection destinations, repeated failed authorization checks, and access outside approved mappings.

Sources

SourceLink
github.comgithub.com/sosedoff/pgweb
github.comgithub.com/sosedoff/pgweb/blob/6b0b0244d1aefd6971999b03481eeeaa4ec7cf55/pkg/api/api.go
github.comgithub.com/sosedoff/pgweb/blob/6b0b0244d1aefd6971999b03481eeeaa4ec7cf55/pkg/api/routes.go
github.comgithub.com/sosedoff/pgweb/issues/869
vulncheck.comvulncheck.com/advisories/pgweb-through-0.17.0-missing-authorization-on-direct-connect-endpoint

Frequently asked

questions

It may be remotely exploitable when the pgweb API is network-accessible and the

deployment does not provide an effective authorization layer in front of the

affected endpoint.

The attacker needs reachability to the connection endpoint. Whether

authentication is also required depends on the deployment's surrounding

access controls and how connect-backend authorization is configured.

Enforce authorization directly on the connection operation, bind session

identifiers to authenticated identities, and allow connections only to

explicitly approved database targets.

Test every sensitive API operation for authorization independently, use

deny-by-default target allowlists, restrict outbound network access, and

monitor connection requests against approved resource mappings.

Find out what's already
exploitable in your codebase.