/

CVE-2026-121139

Severity:

HIGH RISK

(7.8)

Missing Authentication (CWE-306) in Metasploit msf-ws

CVE-2026-121139

Received

Vulnerability type

Category:

Missing Authentication

CWE:

CWE-306

Impact:

Unauthorized account creation and potential administrative access

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 msf-ws REST API allows an unauthenticated caller to create a user while the users table is empty. Because the bootstrap authentication exemption bypasses the administrator check, the caller may create an administrator account if the API is reachable in that state.

Metasploit's msf-ws REST API allows an unauthenticated caller to create a user while the users table is empty. Because the bootstrap authentication exemption bypasses the administrator check, the caller may create an administrator account if the API is reachable in that state.

Affected context

The issue occurs in the msf-ws REST API's user-creation flow when the users table is empty. In this bootstrap state, the API exempts the user-creation route from authentication, and the exemption can allow an unauthenticated caller to create an administrator account.

The issue occurs in the msf-ws REST API's user-creation flow when the users table is empty. In this bootstrap state, the API exempts the user-creation route from authentication, and the exemption can allow an unauthenticated caller to create an administrator account.

Exploit preconditions

  • Attack surface: The msf-ws REST API, specifically POST /api/v1/users
  • Required access: No authentication is required while the users table is empty
  • Trigger point: A request to create a user during the unauthenticated bootstrap state
  • Why exploitation is possible: The inherited authentication method returns success before the administrator-specific authorization check is evaluated
  • Attack surface: The msf-ws REST API, specifically POST /api/v1/users
  • Required access: No authentication is required while the users table is empty
  • Trigger point: A request to create a user during the unauthenticated bootstrap state
  • Why exploitation is possible: The inherited authentication method returns success before the administrator-specific authorization check is evaluated

Why this happens

The authentication flow treats an uninitialized application as an unconditional authentication success. This bypasses the administrator check in the API token authentication path and allows a critical user-creation function to be reached without verifying the caller's identity. This maps to CWE-306: Missing Authentication for Critical Function.

The authentication flow treats an uninitialized application as an unconditional authentication success. This bypasses the administrator check in the API token authentication path and allows a critical user-creation function to be reached without verifying the caller's identity. This maps to CWE-306: Missing Authentication for Critical Function.

Potential impact

  • An unauthenticated caller could create an account
  • The caller could create an administrator account and gain privileged access
  • An attacker with administrative access could change application data or settings
  • An unauthenticated caller could create an account
  • The caller could create an administrator account and gain privileged access
  • An attacker with administrative access could change application data or settings

General mitigation guidance

Defensive patterns include requiring explicit authorization for account creation, including during bootstrap, and avoiding authentication exemptions that treat an uninitialized state as proof of identity. Bootstrap workflows can use a separate, protected enrollment mechanism, such as a trusted out-of-band setup process. Limit API exposure and apply least privilege to accounts and services that can manage users.

Defensive patterns include requiring explicit authorization for account creation, including during bootstrap, and avoiding authentication exemptions that treat an uninitialized state as proof of identity. Bootstrap workflows can use a separate, protected enrollment mechanism, such as a trusted out-of-band setup process. Limit API exposure and apply least privilege to accounts and services that can manage users.

How teams detect issues like this

  • Review authentication code for early-success paths tied to initialization or empty account stores
  • Use static analysis and code review to trace authorization checks on user-creation routes
  • Monitor for user-creation requests made before an administrator account exists
  • Enforce policies requiring authentication and authorization checks for sensitive API operations
  • Review authentication code for early-success paths tied to initialization or empty account stores
  • Use static analysis and code review to trace authorization checks on user-creation routes
  • Monitor for user-creation requests made before an administrator account exists
  • Enforce policies requiring authentication and authorization checks for sensitive API operations

Sources

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

Frequently asked

questions

It may be exploitable over the network if the REST API is reachable while the users table is empty.

No. In the described bootstrap state, the endpoint accepts an unauthenticated request.

Require explicit authorization for user creation, including during initial setup, rather than treating an uninitialized state as authenticated.

Review bootstrap and initialization paths for authentication shortcuts, protect setup workflows, and enforce authorization checks on sensitive API routes.

It may be exploitable over the network if the REST API is reachable while the users table is empty.

No. In the described bootstrap state, the endpoint accepts an unauthenticated request.

Require explicit authorization for user creation, including during initial setup, rather than treating an uninitialized state as authenticated.

Review bootstrap and initialization paths for authentication shortcuts, protect setup workflows, and enforce authorization checks on sensitive API routes.

Find out what's already
exploitable in your codebase.