/

CVE-2026-116247

Severity:

HIGH RISK

(8.2)

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

CVE-2026-116247

Analyzed

Vulnerability type

Category:

Credential Exposure

CWE:

CWE-522, CWE-1188

Impact:

Unauthorized Database Access and Credential Disclosure

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

pgAdmin 4 server mode could omit unset or unavailable PostgreSQL credential parameters, causing libpq to fall back to files and environment variables belonging to the operating-system account running pgAdmin. An authenticated pgAdmin user may therefore gain access to saved database passwords or client certificate credentials when those artifacts are present and readable.

pgAdmin 4 server mode could omit unset or unavailable PostgreSQL credential parameters, causing libpq to fall back to files and environment variables belonging to the operating-system account running pgAdmin. An authenticated pgAdmin user may therefore gain access to saved database passwords or client certificate credentials when those artifacts are present and readable.

Affected context

The issue occurs in pgAdmin 4 deployments running in server mode when PostgreSQL connection parameters for password files, client certificates, or client keys are absent or point to files that cannot be found. Under those conditions, libpq may consult the service account's default credential files or environment variables, including PostgreSQL password and TLS credential locations. Related behavior may also occur when connection details are supplied through service configuration or utility connection strings.

The issue occurs in pgAdmin 4 deployments running in server mode when PostgreSQL connection parameters for password files, client certificates, or client keys are absent or point to files that cannot be found. Under those conditions, libpq may consult the service account's default credential files or environment variables, including PostgreSQL password and TLS credential locations. Related behavior may also occur when connection details are supplied through service configuration or utility connection strings.

Exploit preconditions

  • Attack surface: pgAdmin 4 server-mode database connection handling
  • Required access: Access to use or create a database connection through the pgAdmin service
  • Trigger point: A connection is created with omitted or unavailable credential-file parameters
  • Required environmental condition: The operating-system account running pgAdmin has readable saved credentials, client certificate material, or related environment variables
  • Why exploitation is possible: Missing parameters are interpreted by libpq as permission to use operating-system defaults rather than as an explicit refusal to use fallback files
  • Attack surface: pgAdmin 4 server-mode database connection handling
  • Required access: Access to use or create a database connection through the pgAdmin service
  • Trigger point: A connection is created with omitted or unavailable credential-file parameters
  • Required environmental condition: The operating-system account running pgAdmin has readable saved credentials, client certificate material, or related environment variables
  • Why exploitation is possible: Missing parameters are interpreted by libpq as permission to use operating-system defaults rather than as an explicit refusal to use fallback files

Why this happens

The underlying bug is insecure default initialization and insufficient protection of credentials. When application-generated connection parameters were absent, the connection layer allowed the PostgreSQL client library to resolve credentials from the service account's home directory or environment. This maps to CWE-1188 because security-sensitive values were not initialized to safe, explicit defaults, and to CWE-522 because credentials available to one execution context could be exposed to other users of the server-mode application.

The underlying bug is insecure default initialization and insufficient protection of credentials. When application-generated connection parameters were absent, the connection layer allowed the PostgreSQL client library to resolve credentials from the service account's home directory or environment. This maps to CWE-1188 because security-sensitive values were not initialized to safe, explicit defaults, and to CWE-522 because credentials available to one execution context could be exposed to other users of the server-mode application.

Potential impact

  • An attacker may authenticate to PostgreSQL using passwords saved for the service account.
  • An attacker may gain access to databases or roles associated with reused credentials.
  • Client certificate authentication material could be misused when the corresponding private key is readable.
  • Database contents may be read, modified, or deleted depending on the recovered account's privileges.
  • Exposed credentials could support lateral movement into connected systems.
  • An attacker may authenticate to PostgreSQL using passwords saved for the service account.
  • An attacker may gain access to databases or roles associated with reused credentials.
  • Client certificate authentication material could be misused when the corresponding private key is readable.
  • Database contents may be read, modified, or deleted depending on the recovered account's privileges.
  • Exposed credentials could support lateral movement into connected systems.

General mitigation guidance

Mitigation generally focuses on making credential sources explicit and

preventing client libraries from silently consulting ambient operating-system

defaults.

Common defensive patterns include:

  • Set every security-sensitive connection parameter explicitly in server mode.
  • Use the requesting user's intended credential files rather than the service account's files.
  • Provide inaccessible or otherwise fail-closed values when a credential source is not configured.
  • Prefer narrowly scoped authentication methods and short-lived credentials where practical.
  • Keep service-account home directories, environment variables, and private keys inaccessible to application users.
  • Apply least privilege to database roles used by pgAdmin and its supporting utilities.
  • Ensure explicit connection strings take precedence over service definitions when resolving database targets.
  • Separate desktop-mode and server-mode trust boundaries during security design and testing.

Mitigation generally focuses on making credential sources explicit and

preventing client libraries from silently consulting ambient operating-system

defaults.

Common defensive patterns include:

  • Set every security-sensitive connection parameter explicitly in server mode.
  • Use the requesting user's intended credential files rather than the service account's files.
  • Provide inaccessible or otherwise fail-closed values when a credential source is not configured.
  • Prefer narrowly scoped authentication methods and short-lived credentials where practical.
  • Keep service-account home directories, environment variables, and private keys inaccessible to application users.
  • Apply least privilege to database roles used by pgAdmin and its supporting utilities.
  • Ensure explicit connection strings take precedence over service definitions when resolving database targets.
  • Separate desktop-mode and server-mode trust boundaries during security design and testing.

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis and code review rules identifying omitted security-sensitive connection parameters.
  • Checks for reliance on client-library defaults, home-directory credential files, or ambient authentication environment variables.
  • Tests that run connections under an account containing intentionally seeded credential files and verify that unrelated users cannot consume them.
  • Policy enforcement preventing shared service accounts from storing broadly readable password files or private client keys.
  • Runtime monitoring for unexpected database connections made by the pgAdmin service account or use of its stored credentials.
  • Automated security review tools that flag insecure default initialization and cross-user credential resolution.

Organizations can look for this class of issue through:

  • Static analysis and code review rules identifying omitted security-sensitive connection parameters.
  • Checks for reliance on client-library defaults, home-directory credential files, or ambient authentication environment variables.
  • Tests that run connections under an account containing intentionally seeded credential files and verify that unrelated users cannot consume them.
  • Policy enforcement preventing shared service accounts from storing broadly readable password files or private client keys.
  • Runtime monitoring for unexpected database connections made by the pgAdmin service account or use of its stored credentials.
  • Automated security review tools that flag insecure default initialization and cross-user credential resolution.

Sources

SourceLink
github.comgithub.com/pgadmin-org/pgadmin4/commit/32db693198f28b78fe2af12a726b80a68eb78cb2
github.comgithub.com/pgadmin-org/pgadmin4/issues/10652

Frequently asked

questions

It can be exploitable through the pgAdmin server-mode interface when an attacker

can use the service to initiate database connections and the service account

has accessible fallback credentials. It is not generally a standalone

unauthenticated network issue.

The key requirement is the ability to use pgAdmin's connection functionality.

Exploitability also depends on credential files, client keys, or authentication

environment variables being present and readable by the pgAdmin process.

Supply explicit values for every credential-related connection parameter and

fail closed when a value is unavailable, rather than allowing libpq to search

the service account's default locations.

Treat operating-system defaults and environment variables as untrusted

credential sources, isolate service-account files, use least-privilege

database roles, and test connection handling with missing and inaccessible

credential paths.

It can be exploitable through the pgAdmin server-mode interface when an attacker

can use the service to initiate database connections and the service account

has accessible fallback credentials. It is not generally a standalone

unauthenticated network issue.

The key requirement is the ability to use pgAdmin's connection functionality.

Exploitability also depends on credential files, client keys, or authentication

environment variables being present and readable by the pgAdmin process.

Supply explicit values for every credential-related connection parameter and

fail closed when a value is unavailable, rather than allowing libpq to search

the service account's default locations.

Treat operating-system defaults and environment variables as untrusted

credential sources, isolate service-account files, use least-privilege

database roles, and test connection handling with missing and inaccessible

credential paths.

Find out what's already
exploitable in your codebase.