Skip to main content

Metasploit Framework CVE-2026-16895

| EUVDEUVD-2026-66836 MEDIUM
Authentication Bypass by Primary Weakness (CWE-305)
2026-08-27 rapid7 GHSA-3p6c-gvpg-f24w
5.1
CVSS 4.0 · Vendor: rapid7
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Identify JSON-RPC service on local host
  2. Delivery
    Confirm MSF_WS_JSON_RPC_API_TOKEN is unset
  3. Exploit
    Trigger or await db.check exception
  4. Execution
    auth_initialized resets to false
  5. Persist
    Send unauthenticated JSON-RPC requests
  6. Impact
    Access sessions, loot, or execute modules

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A07:2025 - Authentication Failures
ASVS 5.0
V6 - Authentication Primary weakness mitigation
Exploitation Conditions

Exploitation requires all three of the following conditions simultaneously: (1) the Metasploit JSON-RPC web service (msf-json-rpc.ru) must be actively running; (2) the MSF_WS_JSON_RPC_API_TOKEN environment variable must NOT be set in the service process environment - this is the case when operators rely solely on database-backed authentication without a static token; and (3) the db.check database health-check method must raise an exception at runtime, which occurs when the Metasploit PostgreSQL backend is unreachable, crashes, or is misconfigured after service startup. Exploitation is strictly limited to local attack surface (AV:L per the CVSS 4.0 vector) - the attacker must reach port 8081 from the same host or local network segment. No prior authentication or privileges are required once conditions are met (PR:N). This vulnerability does NOT affect deployments where MSF_WS_JSON_RPC_API_TOKEN is explicitly set, as that env-var path bypasses the fail-open logic entirely.

Impact

The CVSS 4.0 base score of 5.1 (AV:L/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N) reflects a local attack surface with limited confidentiality and integrity impact on the vulnerable system plus low subsequent-system exposure. No EPSS data was provided and this CVE is absent from the CISA KEV catalog, suggesting no confirmed widespread exploitation. The real-world risk is higher than the score implies for security teams running Metasploit in multi-user or automated environments - shared pentest infrastructure, CI/CD pipelines, or headless lab setups where the JSON-RPC service is active and the env var is not explicitly configured are plausible targets. Because the fail-open triggers on a db exception (which can occur naturally due to PostgreSQL downtime or misconfiguration), the attack is not fully attacker-controlled, which justifies the vendor's AC:L assertion only partially - an attacker who can influence database reachability could force the condition. No conflicting data between sources was identified, but the absence of EPSS and version-specific CPE data limits confidence in quantifying exploitation probability.

Exploit ScenarioDerived

An attacker with local access to a shared pentest server or CI/CD host running Metasploit's JSON-RPC service - where MSF_WS_JSON_RPC_API_TOKEN was never set - waits for or causes the PostgreSQL database to become unreachable, triggering the db.check exception and resetting auth_initialized. The attacker then sends unauthenticated JSON-RPC HTTP requests to port 8081 to enumerate active sessions, retrieve credentials from the loot database, or execute Metasploit modules against targets already in the operator's scope. No public POC has been identified, but the two-condition trigger is straightforward to reproduce from the description.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Aug 27, 2026

Unauthenticated local access to Metasploit Framework's JSON-RPC dispatcher is possible via a fail-open logic flaw (CWE-305) in the ApiToken Warden authentication strategy. When the MSF_WS_JSON_RPC_API_TOKEN environment variable is unset and the db.check health-check method raises an exception, the internal msf.auth_initialized flag is reset to false - which the Warden misinterprets as authentication being uninitialised rather than failed, bypassing token enforcement entirely. A vendor-released upstream fix is available via GitHub PR #21768; no public exploit code and no CISA KEV listing have been identified at time of analysis.

RemediationAI

Apply the upstream fix from GitHub PR #21768 (https://github.com/rapid7/metasploit-framework/pull/21768); the fix is available as a PR/commit but a specific tagged release version was not confirmed in the available data - monitor the Rapid7 advisory at https://www.rapid7.com/blog/post/pt-metasploit-wrap-up-lot-of-summer-shells-and-fit-http-profiles/ for the patched release version. As an immediate compensating control, set MSF_WS_JSON_RPC_API_TOKEN to a cryptographically random value of at least 16 characters before starting the JSON-RPC service (e.g., export MSF_WS_JSON_RPC_API_TOKEN=$(ruby -rsecurerandom -e 'puts SecureRandom.hex(32)')); the PR diff confirms this fully prevents the fail-open path and the fixed service refuses to start without a valid token configured. Additionally, restrict access to the JSON-RPC port (default 8081) using host-based firewall rules (e.g., iptables or ufw) to block access from untrusted local users - note this does not fix the underlying flaw but reduces exposure surface until patching is complete.

Affected VersionsENISA

Metasploit-framework 0 <6.5.2

Affected Packages

euvd metasploit_framework fix: 6.5.2

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Metasploit Framework (CPE: cpe:2.3:a:rapid7:metasploit-framework:*:*:*:*:*:*:*:*) ships a JSON-RPC web service (msf-json-rpc.ru, served via Thin or Puma on default port 8081) that exposes the full framework API - module execution, session management, database queries - over HTTP. Authentication is enforced by the ApiToken Warden strategy, which gates dispatch on an internal msf.auth_initialized boolean. CWE-305 (Authentication Bypass by Primary Weakness) is the root cause: the exception-handling path in the db.check health check resets auth_initialized to false, and the Warden guard treats false as 'authentication not configured or required' rather than 'authentication check encountered an error.' The vulnerability is specific to the code path where the env-var static token is absent and the database backend is unavailable or throws at runtime. The PR #21768 diff shows the fix hardened documentation and startup logic to refuse service launch when neither a static token nor a database-backed user token is available.

Know when Metasploit Framework gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (rapid7) PRIMARY 5.1 MEDIUM
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N
vuln.today AI 4.5 MEDIUM

Requires two concurrent non-default conditions (env var unset and active db exception), so AC:H; local vector; scope change as Metasploit's full RPC API is exposed to subsequent systems.

3.1 AV:L/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N
4.0 AV:L/AC:H/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N

Primary rating from Vendor (rapid7).

CVSS VectorVendor: rapid7

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
Low
Vulnerable system: Availability
None
Subsequent system: Confidentiality
Low
Subsequent system: Integrity
Low
Subsequent system: Availability
None

DescriptionCVE.org

A logic vulnerability (fail-open condition) has been identified within the Metasploit Framework's JSON-RPC web service interface. When an exception occurs during the database health check (db.check) and the environment variable MSF_WS_JSON_RPC_API_TOKEN is not explicitly set, the application resets the internal state flag msf.auth_initialized to false. The ApiToken Warden authentication strategy misinterprets this false value as an indicator that authentication is not initialized or required, thereby granting unauthenticated local access to the JSON-RPC request dispatcher.

Threat Intelligence Overview

EPSS Score
0.2%
Top 94% exploitable
Prevalence
Medium
widely used open-source pentesting framework among security professionals
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GitHub Metasploit

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation
None
System Exposure· derived
Small
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

26
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +26
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy