GHSA-r8g4-86fx-92mq

Suggest an improvement
Source
https://github.com/advisories/GHSA-r8g4-86fx-92mq
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/02/GHSA-r8g4-86fx-92mq/GHSA-r8g4-86fx-92mq.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-r8g4-86fx-92mq
Aliases
Published
2026-02-04T19:02:51Z
Modified
2026-02-04T21:57:03Z
Severity
  • 6.5 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N CVSS Calculator
Summary
OpenClaw Vulnerable to Local File Inclusion via MEDIA: Path Extraction
Details

Summary

The isValidMedia() function in src/media/parse.ts allows arbitrary file paths including absolute paths, home directory paths, and directory traversal sequences. An agent can read any file on the system by outputting MEDIA:/path/to/file, exfiltrating sensitive data to the user/channel.

Details

Location: src/media/parse.ts:17-27

The path validation accepts dangerous patterns:

function isValidMedia(candidate: string, opts?: { allowSpaces?: boolean }) {
  if (candidate.startsWith("/")) return true;      // ALLOWS /etc/passwd
  if (candidate.startsWith("./")) return true;
  if (candidate.startsWith("../")) return true;    // ALLOWS ../../etc/passwd
  if (candidate.startsWith("~")) return true;      // ALLOWS ~/secrets
  return false;
}

No validation ensures the path is within a safe directory or is actually a media file.

PoC

Agent outputs any of:

MEDIA:/etc/passwd
MEDIA:~/.ssh/id_rsa
MEDIA:~/.aws/credentials
MEDIA:../../../etc/passwd

The file contents are rendered/sent to the requesting user or channel.

Impact

  • Read ANY file accessible to the agent user
  • Exfiltrate SSH keys (~/.ssh/id_rsa)
  • Steal cloud credentials (~/.aws/credentials)
  • Access API keys (.env, config.json)
  • Read system files (/etc/passwd, /etc/shadow)

Note: PR #4930 contains a fix but is NOT MERGED - production is vulnerable.

Database specific
{
    "cwe_ids":  [
        "CWE-200",
        "CWE-22"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-02-04T19:02:51Z",
    "nvd_published_at":  "2026-02-04T20:16:07Z",
    "severity":  "MODERATE"
}
References

Affected packages

npm / openclaw

Package

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
2026.1.30

Database specific

last_known_affected_version_range
"<= 2026.1.29"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/02/GHSA-r8g4-86fx-92mq/GHSA-r8g4-86fx-92mq.json"