/

CVE-2026-79407

Severity:

HIGH RISK

(7.5)

Path Traversal (CWE-22) in MetaGPT SPO Extension Module

CVE-2026-79407

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Read and Sensitive Information Disclosure

Severity:

HIGH RISK

(7.5)

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

A path traversal vulnerability in MetaGPT's SPO extension allows attacker-controlled file names to escape the intended settings directory.

If an attacker can influence the FILE_NAME value, the application may open and disclose arbitrary files accessible to its runtime account.

Affected context

The vulnerability occurs in the SPO extension's file-loading logic, specifically where the FILE_NAME value is combined with a configured settings directory before being opened. It becomes risky when this value can be influenced by an untrusted party and the resulting path is not canonicalized and checked against the permitted directory.

Exploit preconditions

  • Attack surface: The SPO extension's file-loading functionality
  • Required access: The ability to supply or influence the FILE_NAME value
  • Trigger point: Calls to set_file_name() and load_meta_data() that construct and open the target path
  • Why exploitation is possible: The application joins attacker-controlled path content with a trusted directory without verifying that the resolved path remains within that directory

Why this happens

The underlying bug is insufficient validation of a user-controlled filesystem path. Joining a trusted directory with untrusted path content does not prevent traversal when the input can contain path components that resolve outside the intended location. This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, because the application opens the resolved path without enforcing the intended directory boundary.

Potential impact

  • Sensitive configuration, credentials, or source files may be disclosed
  • Application secrets or environment-specific data could be exposed
  • Information gathered from local files may support follow-on attacks
  • The runtime account's readable data could be accessed beyond the intended settings directory

General mitigation guidance

Mitigation generally focuses on reducing trust in file-name inputs and enforcing filesystem boundaries before opening files.

Common defensive patterns include:

  • Accepting only allowlisted file identifiers or constrained base names where possible
  • Canonicalizing the candidate path before access and verifying that it remains beneath the permitted directory
  • Rejecting absolute paths, traversal components, and unexpected separators
  • Using filesystem APIs or sandboxed storage abstractions that expose only approved resources
  • Running the application with the least filesystem permissions necessary
  • Avoiding storage of credentials and other sensitive data in directories readable by the application

How teams detect issues like this

Organizations can detect path traversal risks through:

  • Static analysis rules for filesystem APIs receiving request-derived or configuration-derived path values
  • Code review checks for string concatenation or path joining without canonical boundary validation
  • Tests that verify rejected paths cannot resolve outside approved directories
  • Runtime monitoring for unusual file access by the SPO process
  • Policy enforcement requiring allowlisted resource identifiers and least-privilege filesystem access

Automated code review and security scanning tools may help identify missing path normalization and containment checks.

Sources

SourceLink
github.comgithub.com/REYu6/Metagpt-vul/blob/main/CVE-2-MetaGPT-path-traversal.md

Frequently asked

questions

It may be remotely exploitable when a network-facing feature or workflow allows an attacker to control FILE_NAME. In local-only deployments, exploitation generally requires access to the relevant input or execution context.

The attacker must be able to influence the file-name value processed by the SPO extension and cause the affected loading operation to run.

Treat file names as untrusted, prefer allowlisted resource identifiers, and verify after canonicalization that every opened path remains within the approved directory.

Combine secure path-resolution helpers, negative and boundary-focused tests, code review rules for filesystem access, and least-privilege runtime permissions.

Find out what's already
exploitable in your codebase.