Skip to content

db_import unsafe deserialisation (CWE-502) exposes Metasploit to code execution via crafted XML/ZIP import (related to CVE-2026-41316)

High
slynch-r7 published GHSA-4g65-vw26-x26h Aug 6, 2026

Package

bundler metasploit-framework (RubyGems)

Affected versions

>= 4.0, <= 6.4.125

Patched versions

>= 6.4.126

Description

The unserialize_object() method in lib/msf/core/db_manager/import/metasploit_framework.rb decodes base64 text from imported files and passes it directly to Marshal.load() with no class allow-list. Multiple call sites across the XML and ZIP importers feed attacker-controlled data into this path.

Because the data is deserialized without restriction, any available Ruby deserialization gadget chain can be used to escalate from deserialization to code execution. The chain reported against current supported environments ends in a guard bypass in Ruby's ERB standard library, tracked upstream as CVE-2026-41316. Earlier chains affected only unsupported Ruby versions, but the underlying weakness — calling Marshal.load() on untrusted input — is independent of any single chain.

Mitigation / recommended action

  • Update to the 6.4.126 Metasploit Framework release or later.
  • Do not import XML or ZIP files from untrusted sources into Metasploit.

References

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Local
Attack complexity
High
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H

CVE ID

CVE-2026-41316

Weaknesses

Deserialization of Untrusted Data

The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. Learn more on MITRE.

Credits