/

CVE-2026-22682

Severity:

HIGH RISK

(7.1)

Improper Access Control in OpenHarness Agent File Tools

CVE-2026-22682

Deferred

Vulnerability type

Category:

Improper Access Control

CWE:

CWE-863

Impact:

Unauthorized File Read and Write on Host System

Severity:

HIGH RISK

(7.1)

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

OpenHarness prior to commit 166fcfe contains an improper access control flaw in its built-in file tools, caused by inconsistent parameter handling during permission checks.

An attacker who can influence agent tool execution can bypass path-based deny rules to read, create, or overwrite arbitrary files outside the intended repository scope, potentially exposing sensitive configuration, credential, or SSH material.

Affected context

This vulnerability arises in OpenHarness environments where:

  • The built-in file tools (e.g., read_file, write_file, edit_file, notebook_edit) are enabled for agents
  • Permission enforcement relies on a PermissionChecker that should validate file paths against repository or host constraints
  • Agents can run in modes (such as full_auto) that allow them to autonomously invoke file tools

The issue manifests when the path parameter used by file tools is not correctly forwarded into the permission checking logic, leading to a discrepancy between what the tool can access and what the policy intends to restrict.

Exploit preconditions

  • Attack surface: Agent tool invocation layer (e.g., workflows, prompts, or orchestration that can trigger file tools)
  • Required access: Ability to influence or control agent actions so that it calls read_file, write_file, edit_file, or notebook_edit with attacker-chosen paths
  • Trigger point: Execution of a file tool operation where the path argument is evaluated by the tool but not fully considered by the PermissionChecker
  • Why exploitation is possible: The permission enforcement logic does not receive or consistently use the actual file path parameter, so deny rules and repository scoping are not reliably applied; the tool proceeds with file operations on paths outside the intended sandbox.

Why this happens

The defect stems from a mismatch between the security policy model and its implementation in the file tooling layer.

The PermissionChecker is intended to apply path-based authorization, but the path parameter is not correctly propagated or referenced in permission checks for operations like read_file, write_file, edit_file, and notebook_edit.

This leads to CWE-863: Improper Authorization, where the system performs security checks that are incomplete or not aligned with the resource actually being accessed.

As a result, authorization decisions are made without full awareness of the targeted file path, allowing operations on files that should be denied by configuration or host-level policies.

Potential impact

  • Reading arbitrary local files outside the intended repository scope
  • Exposure of configuration files containing secrets, API keys, or environment details
  • Access to credential stores, SSH keys, and other authentication material
  • Creation of new files in sensitive host directories that may affect application behavior
  • Overwriting existing files in restricted paths, potentially enabling configuration tampering or persistence mechanisms
  • Indirect escalation of access if modified files are later executed or trusted by other components

General mitigation guidance

Mitigation should focus on ensuring that authorization decisions are tightly bound to the actual resources being accessed and that tooling cannot bypass policy intent.

Common defensive patterns include:

  • Enforcing that all file operations pass the canonical, fully-resolved path into the authorization layer before any I/O occurs
  • Centralizing permission checks in a single, reusable function that every file tool must call, avoiding duplicated or ad-hoc logic
  • Designing file tools to operate solely inside a well-defined, sandboxed directory tree, rejecting paths that attempt to traverse outside it
  • Applying a default-deny posture for file access, where new tools or operations must explicitly declare their allowed path patterns
  • Running agents with OS-level least privilege (e.g., dedicated low-privilege users, chroot/jail/containers) so that even if logical checks fail, the file system exposure is minimized

These patterns help decouple security from individual tool implementations and reduce the risk of inconsistencies in parameter handling.

How teams detect issues like this

Effective detection approaches may combine code-level review with behavior monitoring:

  • Static analysis rules that flag authorization checks which do not include the resource identifier (e.g., missing or unused path parameter in permission calls)
  • Code review checklists that require verification that all file operations are preceded by a single, standardized permission-check function using the same parameters
  • Automated tests or policy-as-code checks that attempt file operations outside the permitted repository scope and assert denial
  • Runtime logging of file tool invocations capturing requested paths and the authorization decision, with alerts when access to non-repository directories is granted
  • Periodic audits of agent configurations and tool permissions to identify overly broad capabilities or full-auto modes without strong guardrails

Automated review tools can assist by enforcing patterns around permission-check APIs and by spotting deviations from approved access-control flows.

Sources

SourceLink
github.comgithub.com/HKUDS/OpenHarness/commit/166fcfefb7614dbac51bd061f56542725b0298e9
github.comgithub.com/HKUDS/OpenHarness/pull/32
vulncheck.comvulncheck.com/advisories/openharness-improper-access-control-via-file-tools

Frequently asked

questions

Exploitability depends on who can influence the agent. If an attacker can shape prompts, workflows, or integrations so that the agent invokes file tools with arbitrary paths, they can often bypass repository scoping and access host files.

Not necessarily. Direct shell access is not required; the attacker primarily needs a way to cause the agent to execute file operations on their behalf, such as through exposed prompts, automation hooks, or API-driven workflows.

The most robust fix is to require that every file operation go through a centralized permission-check function that receives and validates the exact path to be accessed, ensuring deny rules and sandbox constraints are always applied before I/O.

Preventive strategies include designing access control as a first-class, reusable component; enforcing secure-by-default file sandboxes; writing tests that validate denial of out-of-scope paths; and integrating static analysis or policy-as-code checks to ensure all tools properly include resource identifiers in authorization decisions.

Find out what's already
exploitable in your codebase.