/

CVE-2026-132038

Severity:

HIGH RISK

(7.8)

Improper Access Control (CWE-284) in Metasploit msfdb

CVE-2026-132038

Awaiting Analysis

Vulnerability type

Category:

Improper Access Control

CWE:

CWE-284

Impact:

Local Privilege Escalation and Operating System Command Execution

Severity:

HIGH RISK

(7.8)

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

Metasploit's msfdb initialization can configure PostgreSQL with trust authentication and expose its Unix socket in /tmp with permissions that allow local users to access it. A user on the same host may then authenticate as the passwordless postgres superuser and execute operating system commands as the msfdb owner.

Affected context

The issue concerns the PostgreSQL cluster created by Metasploit's msfdb init component. It may be present when the cluster uses trust authentication and its Unix domain socket in /tmp is accessible to other local users. The described impact depends on a local user being able to reach that socket.

Exploit preconditions

  • Attack surface: The local PostgreSQL Unix domain socket created during msfdb initialization
  • Required access: A local account on the same host that can access the socket
  • Trigger point: Authentication to the PostgreSQL cluster and use of its database functionality
  • Why exploitation is possible: Trust authentication does not require a password, and overly broad socket access can let local users connect as the postgres superuser

Why this happens

The initialization process combines passwordless trust authentication with insufficient access restrictions on a local database socket. This fails to enforce authorization at the database boundary: users who can reach the socket can be treated as trusted superusers. This maps to CWE-284: Improper Access Control, because access to a privileged resource is not adequately limited to authorized users.

Potential impact

  • A local user may authenticate to PostgreSQL as the postgres superuser without a password.
  • An attacker could execute operating system commands with the privileges of the msfdb owner.
  • The database and data accessible to that account could be compromised or altered.
  • The host could be further compromised, depending on the privileges and reach of the msfdb owner.

General mitigation guidance

Defensive patterns focus on requiring authenticated database access and limiting who can reach local database sockets.

  • Prefer password-based or otherwise explicitly authenticated access over trust authentication.
  • Restrict socket directories and files to the intended service account and authorized users.
  • Avoid placing privileged service sockets in broadly accessible locations.
  • Run database services and related processes with only the privileges they require.
  • Review initialization defaults so secure authentication and restrictive permissions are applied automatically.

How teams detect issues like this

  • Review database initialization code and configuration for trust authentication or passwordless privileged roles.
  • Check socket directory and socket permissions for access by unintended local users.
  • Use static analysis and code review to flag permissive authentication defaults and insecure temporary-directory usage.
  • Enforce policy checks that require authenticated database access and restricted permissions for service sockets.
  • Monitor database connections and privileged activity for unexpected local accounts or processes.

Sources

SourceLink
github.comgithub.com/rapid7/metasploit-framework/pull/22105

Frequently asked

questions

The described attack requires local access to the host and to the PostgreSQL socket; it is not directly a remote network attack.

An attacker needs a local account that can reach the socket created by msfdb initialization. Trust authentication can then allow access without a database password.

Require explicit authentication for database connections and restrict the socket and its directory to authorized users and the service account.

Use secure-by-default authentication, limit service privileges, restrict local IPC permissions, and include checks for these controls in code review and deployment policy.

Find out what's already
exploitable in your codebase.