/

CVE-2026-116245

Severity:

HIGH RISK

(8.2)

Credential Exposure (CWE-522) in pgAdmin 4 Server Mode

CVE-2026-116245

Analyzed

Vulnerability type

Category:

Credential Exposure

CWE:

CWE-522, CWE-862

Impact:

Unauthorized database access and credential misuse

Severity:

HIGH RISK

(8.2)

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

A credential exposure and authorization weakness in pgAdmin 4 server mode can cause libpq to use service-file entries or environment variables belonging to the operating-system account running pgAdmin. A user who can configure a server connection may then obtain connections using unintended passwords, password files, or client certificates when the deployment does not restrict permitted services.

A credential exposure and authorization weakness in pgAdmin 4 server mode can cause libpq to use service-file entries or environment variables belonging to the operating-system account running pgAdmin. A user who can configure a server connection may then obtain connections using unintended passwords, password files, or client certificates when the deployment does not restrict permitted services.

Affected context

The issue occurs in pgAdmin 4 deployments running in server mode when connection settings can reference operating-system libpq service entries or inherited environment variables. Risk is higher when the pgAdmin account has a populated service file, credential-related variables such as PGPASSWORD or PGSERVICE, accessible client certificates, or broad database privileges. Related handling of maintenance database names can also cause values to be interpreted as connection strings.

The issue occurs in pgAdmin 4 deployments running in server mode when connection settings can reference operating-system libpq service entries or inherited environment variables. Risk is higher when the pgAdmin account has a populated service file, credential-related variables such as PGPASSWORD or PGSERVICE, accessible client certificates, or broad database privileges. Related handling of maintenance database names can also cause values to be interpreted as connection strings.

Exploit preconditions

  • Attack surface: pgAdmin server-mode connection configuration and database utility invocation
  • Required access: Ability to create or modify a pgAdmin server definition or connection parameters
  • Trigger point: A connection is established or a utility such as pg_dumpall processes the supplied database name
  • Why exploitation is possible: libpq may resolve an attacker-selected service or inherited environment setting using credentials available to the pgAdmin operating-system account, without sufficient authorization of the referenced service
  • Attack surface: pgAdmin server-mode connection configuration and database utility invocation
  • Required access: Ability to create or modify a pgAdmin server definition or connection parameters
  • Trigger point: A connection is established or a utility such as pg_dumpall processes the supplied database name
  • Why exploitation is possible: libpq may resolve an attacker-selected service or inherited environment setting using credentials available to the pgAdmin operating-system account, without sufficient authorization of the referenced service

Why this happens

The underlying issue is insufficient protection of credentials combined with missing authorization checks around connection-service selection. Connection parameters were allowed to resolve implicit libpq configuration from the pgAdmin account, including service-file entries, password files, certificates, and environment variables. This maps primarily to CWE-522: Insufficiently Protected Credentials because sensitive authentication material could be reused through an unintended interface, and also to CWE-862: Missing Authorization because users were not adequately restricted from selecting privileged service definitions.

The underlying issue is insufficient protection of credentials combined with missing authorization checks around connection-service selection. Connection parameters were allowed to resolve implicit libpq configuration from the pgAdmin account, including service-file entries, password files, certificates, and environment variables. This maps primarily to CWE-522: Insufficiently Protected Credentials because sensitive authentication material could be reused through an unintended interface, and also to CWE-862: Missing Authorization because users were not adequately restricted from selecting privileged service definitions.

Potential impact

  • An attacker may connect to databases using credentials associated with the pgAdmin operating-system account.
  • Sensitive database contents could be read, modified, or deleted.
  • Privileged client certificates or password files could be misused.
  • Database utilities may operate against an unintended target.
  • Compromised credentials could enable broader lateral movement or data exposure.
  • An attacker may connect to databases using credentials associated with the pgAdmin operating-system account.
  • Sensitive database contents could be read, modified, or deleted.
  • Privileged client certificates or password files could be misused.
  • Database utilities may operate against an unintended target.
  • Compromised credentials could enable broader lateral movement or data exposure.

General mitigation guidance

Mitigation generally focuses on reducing implicit credential trust and enforcing authorization at the final connection boundary.

Common defensive patterns include:

  • Allowing only explicitly approved connection services in server mode, with an empty or tightly controlled default allowlist.
  • Rejecting arbitrary service-file selection and validating the final connection string after all parameters are resolved.
  • Removing PGPASSWORD, PGSERVICE, and similar credential-bearing variables from the pgAdmin process environment unless they are explicitly required.
  • Treating maintenance database names as data rather than unrestricted connection strings.
  • Using dedicated operating-system accounts with minimal database privileges and tightly protected service files, password files, and client certificates.
  • Separating administrative credentials from application runtime environments and limiting accessible database roles.

Mitigation generally focuses on reducing implicit credential trust and enforcing authorization at the final connection boundary.

Common defensive patterns include:

  • Allowing only explicitly approved connection services in server mode, with an empty or tightly controlled default allowlist.
  • Rejecting arbitrary service-file selection and validating the final connection string after all parameters are resolved.
  • Removing PGPASSWORD, PGSERVICE, and similar credential-bearing variables from the pgAdmin process environment unless they are explicitly required.
  • Treating maintenance database names as data rather than unrestricted connection strings.
  • Using dedicated operating-system accounts with minimal database privileges and tightly protected service files, password files, and client certificates.
  • Separating administrative credentials from application runtime environments and limiting accessible database roles.

How teams detect issues like this

Detection approaches can include:

  • Static analysis and code review for unrestricted use of libpq service, servicefile, PGPASSWORD, PGSERVICE, and related connection parameters.
  • Review of authorization logic that validates only an initial connection configuration rather than the final resolved connection string.
  • Auditing pgAdmin server definitions and connection logs for unexpected service names, maintenance database values, or connections using inherited credentials.
  • Monitoring operating-system service files, password files, certificates, and environment configuration for unauthorized access or modification.
  • Policy checks that require explicit service allowlists and prohibit credential-bearing environment variables in server processes.

Automated security review tools can help identify these patterns during development and deployment validation.

Detection approaches can include:

  • Static analysis and code review for unrestricted use of libpq service, servicefile, PGPASSWORD, PGSERVICE, and related connection parameters.
  • Review of authorization logic that validates only an initial connection configuration rather than the final resolved connection string.
  • Auditing pgAdmin server definitions and connection logs for unexpected service names, maintenance database values, or connections using inherited credentials.
  • Monitoring operating-system service files, password files, certificates, and environment configuration for unauthorized access or modification.
  • Policy checks that require explicit service allowlists and prohibit credential-bearing environment variables in server processes.

Automated security review tools can help identify these patterns during development and deployment validation.

Sources

SourceLink
github.comgithub.com/pgadmin-org/pgadmin4/commit/a0c8f4857f732c6f5e5bacf4b289b811bb5c6a06
github.comgithub.com/pgadmin-org/pgadmin4/issues/10654

Frequently asked

questions

It can be reachable through pgAdmin's server-mode interface when a user is authorized to configure or initiate a connection, but exploitation depends on the deployment's exposure and access controls.

Direct operating-system access is not necessarily required. The key condition is the ability to influence a pgAdmin connection definition or parameter that is resolved by libpq using credentials available to the pgAdmin account.

Restrict connection services to an explicit allowlist, reject unrestricted service-file selection, remove inherited credential variables, and revalidate the fully resolved connection string before use.

Minimize credentials in process environments, isolate privileged service definitions, enforce least privilege for database roles, and test authorization across every supported connection-parameter path.

It can be reachable through pgAdmin's server-mode interface when a user is authorized to configure or initiate a connection, but exploitation depends on the deployment's exposure and access controls.

Direct operating-system access is not necessarily required. The key condition is the ability to influence a pgAdmin connection definition or parameter that is resolved by libpq using credentials available to the pgAdmin account.

Restrict connection services to an explicit allowlist, reject unrestricted service-file selection, remove inherited credential variables, and revalidate the fully resolved connection string before use.

Minimize credentials in process environments, isolate privileged service definitions, enforce least privilege for database roles, and test authorization across every supported connection-parameter path.

Find out what's already
exploitable in your codebase.