/

CVE-2026-116242

Severity:

HIGH RISK

(8.2)

SSH Credential Exposure (CWE-522) in pgAdmin Tunnels

CVE-2026-116242

Analyzed

Vulnerability type

Category:

Improper Credential Protection

CWE:

CWE-522, CWE-1188

Impact:

Unauthorized SSH Access and Lateral Movement

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

In pgAdmin 4 server mode, SSH tunnel creation may unintentionally use the operating-system service account's private keys, SSH configuration, or agent instead of only credentials supplied by the user. An authenticated pgAdmin user could therefore reach hosts that trust the service account, potentially without possessing valid credentials of their own.

In pgAdmin 4 server mode, SSH tunnel creation may unintentionally use the operating-system service account's private keys, SSH configuration, or agent instead of only credentials supplied by the user. An authenticated pgAdmin user could therefore reach hosts that trust the service account, potentially without possessing valid credentials of their own.

Affected context

The issue occurs in pgAdmin 4 server-mode SSH tunnel handling when the sshtunnel library is allowed to consult the service account's default ~/.ssh directory, SSH configuration, or agent. Deployments are particularly exposed when that account has private keys, trusted host relationships, or agent access that are broader than the permissions intended for individual pgAdmin users. Desktop mode is not affected according to the advisory.

The issue occurs in pgAdmin 4 server-mode SSH tunnel handling when the sshtunnel library is allowed to consult the service account's default ~/.ssh directory, SSH configuration, or agent. Deployments are particularly exposed when that account has private keys, trusted host relationships, or agent access that are broader than the permissions intended for individual pgAdmin users. Desktop mode is not affected according to the advisory.

Exploit preconditions

  • Attack surface: pgAdmin server-mode SSH tunnel configuration
  • Required access: An authenticated pgAdmin user who can create or configure a tunnel
  • Trigger point: Establishment of an SSH tunnel to a selected host
  • Why exploitation is possible: Missing restrictions allow the tunnel library to discover and use credentials, SSH settings, or an agent belonging to the operating-system service account rather than limiting authentication to the user's configured credentials
  • Attack surface: pgAdmin server-mode SSH tunnel configuration
  • Required access: An authenticated pgAdmin user who can create or configure a tunnel
  • Trigger point: Establishment of an SSH tunnel to a selected host
  • Why exploitation is possible: Missing restrictions allow the tunnel library to discover and use credentials, SSH settings, or an agent belonging to the operating-system service account rather than limiting authentication to the user's configured credentials

Why this happens

The underlying bug is an insecure credential and configuration trust boundary. pgAdmin invoked SSH tunneling without explicitly restricting private-key directories or the SSH configuration file, so default operating-system credential sources were implicitly consulted. This behavior maps primarily to CWE-522, where authentication credentials are not sufficiently protected from unintended use, and is also related to CWE-1188 because initialization and default resolution behavior exposed security-sensitive account state.

The underlying bug is an insecure credential and configuration trust boundary. pgAdmin invoked SSH tunneling without explicitly restricting private-key directories or the SSH configuration file, so default operating-system credential sources were implicitly consulted. This behavior maps primarily to CWE-522, where authentication credentials are not sufficiently protected from unintended use, and is also related to CWE-1188 because initialization and default resolution behavior exposed security-sensitive account state.

Potential impact

  • An attacker could establish SSH connections using keys owned by the pgAdmin service account.
  • The attacker may access hosts that trust the service account's credentials.
  • Compromised destinations could enable lateral movement or further unauthorized access.
  • SSH configuration options such as ProxyCommand could redirect or alter tunnel behavior.
  • Sensitive data reachable by the service account could be exposed or modified.
  • An attacker could establish SSH connections using keys owned by the pgAdmin service account.
  • The attacker may access hosts that trust the service account's credentials.
  • Compromised destinations could enable lateral movement or further unauthorized access.
  • SSH configuration options such as ProxyCommand could redirect or alter tunnel behavior.
  • Sensitive data reachable by the service account could be exposed or modified.

General mitigation guidance

Mitigation focuses on enforcing an explicit credential boundary for server-mode

tunnels:

  • Use only the identity file or password deliberately configured by the user.
  • Do not fall back to the operating-system account's ~/.ssh directory, SSH configuration, or agent.
  • Treat missing or inaccessible user-selected identity files as configuration errors rather than searching default credential locations.
  • Run the service account with least privilege and avoid placing broadly trusted private keys or agent access in its environment.
  • Apply restrictive filesystem and secret-storage permissions to SSH credentials.
  • Keep desktop and server authentication paths separately reviewed so their trust assumptions remain explicit.

Mitigation focuses on enforcing an explicit credential boundary for server-mode

tunnels:

  • Use only the identity file or password deliberately configured by the user.
  • Do not fall back to the operating-system account's ~/.ssh directory, SSH configuration, or agent.
  • Treat missing or inaccessible user-selected identity files as configuration errors rather than searching default credential locations.
  • Run the service account with least privilege and avoid placing broadly trusted private keys or agent access in its environment.
  • Apply restrictive filesystem and secret-storage permissions to SSH credentials.
  • Keep desktop and server authentication paths separately reviewed so their trust assumptions remain explicit.

How teams detect issues like this

Organizations can look for:

  • Code paths that instantiate SSH clients without disabling default identity discovery or agent forwarding.
  • Calls that omit explicit key-directory or SSH-configuration restrictions.
  • Fallback logic that searches ~/.ssh when a user-supplied identity file is absent.
  • Server-side tunnel features that inherit environment variables, home directories, or agent sockets from privileged service accounts.
  • Runtime logs showing tunnel connections authenticated with service-account keys rather than user-selected credentials.
  • Policy and static-analysis checks requiring explicit credential sources for automated SSH connections.

Organizations can look for:

  • Code paths that instantiate SSH clients without disabling default identity discovery or agent forwarding.
  • Calls that omit explicit key-directory or SSH-configuration restrictions.
  • Fallback logic that searches ~/.ssh when a user-supplied identity file is absent.
  • Server-side tunnel features that inherit environment variables, home directories, or agent sockets from privileged service accounts.
  • Runtime logs showing tunnel connections authenticated with service-account keys rather than user-selected credentials.
  • Policy and static-analysis checks requiring explicit credential sources for automated SSH connections.

Sources

SourceLink
github.comgithub.com/pgadmin-org/pgadmin4/commit/d52fe4740eb1af89d940f2e412bd66a0a89f08bb
github.comgithub.com/pgadmin-org/pgadmin4/issues/10662

Frequently asked

questions

It can be exploited through the pgAdmin server interface by an authenticated user

who is permitted to configure or create SSH tunnels. It does not require direct

shell access to the pgAdmin host, although the deployment's authorization

controls affect the practical scope.

Not necessarily. The issue allows server-mode tunnel handling to use credentials

available to the operating-system account running pgAdmin, including private keys

or an SSH agent.

Restrict SSH authentication to credentials explicitly selected and authorized

by the user, and report missing identity files instead of falling back to the

service account's default SSH sources.

Define credential sources explicitly, disable unintended key and agent discovery,

apply least privilege to service accounts, and review tunnel implementations for

implicit home-directory and environment inheritance.

It can be exploited through the pgAdmin server interface by an authenticated user

who is permitted to configure or create SSH tunnels. It does not require direct

shell access to the pgAdmin host, although the deployment's authorization

controls affect the practical scope.

Not necessarily. The issue allows server-mode tunnel handling to use credentials

available to the operating-system account running pgAdmin, including private keys

or an SSH agent.

Restrict SSH authentication to credentials explicitly selected and authorized

by the user, and report missing identity files instead of falling back to the

service account's default SSH sources.

Define credential sources explicitly, disable unintended key and agent discovery,

apply least privilege to service accounts, and review tunnel implementations for

implicit home-directory and environment inheritance.

Find out what's already
exploitable in your codebase.