The analysis of the security advisory and the associated commit c6ee14d60e4cbd6a82f9b2d74ebeb1e8ee814964 reveals a policy bypass vulnerability in OpenClaw's safeBins feature. The root cause is an overly permissive validation policy for the grep command.
The patch modifies the SAFE_BIN_PROFILE_FIXTURES constant in src/infra/exec-safe-bin-policy.ts. Specifically, for the grep profile, the maxPositional property was changed from 1 to 0. This configuration is consumed by the validateSafeBinArgv function, which is responsible for enforcing the safe-bin execution policies.
Prior to the patch, an attacker could craft a grep command such as grep -e SECRET .env. The validateSafeBinArgv function, using the vulnerable policy (maxPositional: 1), would consume -e SECRET as a valid flag and its value, but would still allow one positional argument (.env). This bypassed the intended stdin-only nature of safeBins for grep, allowing an attacker to read arbitrary files in the working directory.
The function validateSafeBinArgv is the central point of enforcement for this vulnerable policy. Therefore, during an exploit, this function would appear in the runtime profile as it processes and incorrectly validates the malicious arguments. The fix, by changing the policy to maxPositional: 0, ensures that validateSafeBinArgv will correctly reject any grep command that includes a positional argument, thus mitigating the vulnerability.