/

CVE-2026-32059

Severity:

HIGH RISK

(8.8)

Authorization Bypass in OpenClaw tools.exec.safeBins sort

CVE-2026-32059

Analyzed

Vulnerability type

Category:

Authorization Bypass

CWE:

CWE-863

Impact:

Privilege/Policy Bypass in Command Execution Controls

Severity:

HIGH RISK

(8.8)

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

OpenClaw's tools.exec.safeBins mechanism for the sort command incompletely validates GNU long-option abbreviations, allowing attackers to bypass denied-flag checks by using abbreviated options.

In environments running OpenClaw in allowlist mode, a remote attacker who can trigger sort execution with crafted arguments may use these abbreviated long options to skip approval requirements and run commands with flags that should be blocked.

Affected context

This vulnerability occurs in OpenClaw deployments that rely on tools.exec.safeBins to enforce a security allowlist around the sort command.

It is relevant when:

  • sort is invoked through OpenClaw's safeBins wrapper
  • Allowlist or approval-mode policies are used to restrict certain sort flags
  • The environment supports GNU-style long options with abbreviation (e.g., --chec for --check)

The issue manifests in policy-centric or multi-tenant environments where OpenClaw is used to constrain command-line behavior for untrusted or semi-trusted users or services.

Exploit preconditions

  • Attack surface: Interfaces, APIs, or workflows that trigger sort via OpenClaw's tools.exec.safeBins wrapper.
  • Required access: Ability to supply or influence command-line arguments passed to sort through OpenClaw (e.g., web requests, job submissions, pipeline configurations).
  • Trigger point: Execution of sort under safeBins allowlist mode with arguments containing abbreviated GNU long options that map to otherwise denied flags.
  • Why exploitation is possible: The validation logic checks only exact long-option spellings against allow/deny lists and does not account for GNU-accepted abbreviations, so abbreviated forms bypass denied-flag checks while still being interpreted correctly by the underlying sort binary.

Why this happens

The root cause lies in an authorization design flaw: the safeBins policy engine assumes that long options must be specified in full and validates only those exact strings, while the underlying GNU sort implementation accepts unambiguous abbreviated long options.

This mismatch between what the policy validates and what the binary actually accepts leads to CWE-863: Incorrect Authorization, where access control logic is applied to an incomplete view of the effective operation.

Conceptually, the bug is an insecure pattern where authorization is performed on a higher-level, transformed, or simplified representation of user input without normalizing or expanding it to match the semantics of the protected operation.

Potential impact

  • Attackers could invoke sort with flags that are explicitly denied by policy, using abbreviated long options to evade detection.
  • Security approval workflows for sensitive sort flags could be bypassed, undermining governance or change-control processes.
  • Data-processing pipelines may run with stronger capabilities or riskier behaviors than intended (e.g., affecting performance, resource usage, or output characteristics).
  • In complex systems that chain sort with other tools, this policy bypass can contribute to broader abuses of command execution controls or defense-in-depth layers.

General mitigation guidance

Effective mitigation focuses on aligning authorization checks with the true behavior of the underlying command-line tools and avoiding policy gaps created by normalization mismatches.

Pattern-based mitigations include:

  • Argument normalization before authorization: Expand or canonicalize command-line options (including long-option abbreviations) into a normalized form that exactly matches what the binary will interpret, then run allow/deny checks on this normalized representation.
  • Strict option parsing under policy control: Use a dedicated argument parser that mirrors the tool's option semantics and rejects any options that cannot be safely mapped to a known, approved set—failing closed on ambiguous or partially specified options.
  • Deny-by-default for unrecognized variants: Treat any abbreviated or alternative forms of options that are not explicitly modeled in policy as disallowed, unless they are safely and clearly mapped.
  • Isolate and minimize command capabilities: Reduce reliance on complex CLI flags by constraining how sort is invoked (e.g., fixed argument templates, limited user-configurable flags) and using higher-level APIs where possible.
  • Defense in depth with least privilege: Ensure that even if a policy bypass occurs, the sort process runs with minimal OS-level privileges, restricted file access, and scoped permissions to limit downstream impact.

How teams detect issues like this

Detection revolves around identifying mismatches between allowed/denied flags and the effective flags accepted by the underlying binary.

Possible strategies include:

  • Static analysis of wrapper code: Scan safe execution wrappers for patterns where authorization logic is applied on raw strings without normalization, especially when protecting GNU-style tools that support abbreviated options.
  • Configuration and policy review: Examine safeBins policies to ensure they model all recognized option forms, and verify that any argument parsing logic accounts for abbreviations or aliases.
  • Runtime logging and auditing: Instrument safeBins to log normalized and raw arguments, flagging executions where abbreviated long options are used, particularly when they correspond to sensitive or denied flags.
  • Automated testing and fuzzing of CLI interfaces: Use tests that systematically generate abbreviated forms of long options and check whether policy enforcement behaves consistently with the underlying command's parsing behavior.

Sources

SourceLink
github.comgithub.com/openclaw/openclaw/commit/3b8e33037ae2e12af7beb56fcf0346f1f8cbde6f
github.comgithub.com/openclaw/openclaw/security/advisories/GHSA-3c6h-g97w-fg78
vulncheck.comvulncheck.com/advisories/openclaw-allowlist-bypass-via-sort-long-option-abbreviation-in-toolsexecsafebins

Frequently asked

questions

Yes, if OpenClaw is exposed through remote interfaces (such as web APIs, CI/CD endpoints, or workflow engines) that allow users to influence the arguments passed to sort via safeBins. In such setups, remote actors can exploit abbreviated long options to bypass flag restrictions.

An attacker must be able to cause OpenClaw to run sort under tools.exec.safeBins and control or partially control the command-line options. They do not need direct shell access; control over the arguments supplied to sort through application-level inputs is sufficient.

The safest approach is to introduce robust argument normalization and parsing before authorization: parse incoming options with a parser that faithfully mirrors sort's semantics, expand abbreviations to their canonical long forms, and then apply allow/deny policies to this canonical set. Any option that cannot be unambiguously normalized should be rejected by default.

To prevent comparable flaws, design authorization mechanisms to operate on the same semantic layer as the protected operation. This includes normalizing inputs (options, paths, encodings, aliases), using deny-by-default policies for unrecognized constructs, and incorporating security reviews and automated tests that explicitly target normalization and parsing edge cases in command wrappers and policy engines.

Find out what's already
exploitable in your codebase.