| عنوان | nearai IronClaw 0.29.1 Authentication Bypass Using an Alternate Path or Channel (CWE-288) |
|---|
| الوصف | # Technical Details
A Shell Approval Bypass via Newline-Chained Commands exists in the `classify_command_risk()` method in `src/tools/builtin/shell.rs` of IronClaw.
The application fails to split command chains on newline characters before classifying risk. The risk classifier splits on `|`, `&`, and `;` but not on `\n`, while the execution sink passes the original payload to `sh -c`, which treats newline as a command separator. When `shell` is set to `always_allow`, a payload like `echo control\nrm -rf ...` is classified from the benign `echo` prefix and auto-approved, while the equivalent semicolon-delimited destructive command is correctly classified as high risk and blocked.
# Vulnerable Code
File: src/tools/builtin/shell.rs
Method: classify_command_risk() — splits on ['|', '&', ';'] but not '\n'; matches_command_pattern() uses the first token only
Why: The classifier's segment split set does not include newline, so the second destructive command on a new line is invisible to risk analysis, yet the shell executor runs both lines through `sh -c`.
# Reproduction
1. Deploy IronClaw with `shell=always_allow` in the session permission state.
2. Send a shell command with a newline-chained destructive payload: `echo control\nrm -rf newline_canary_dir/*`.
3. Observe the gate decision is `allow`, the command executes, and the canary directory is deleted.
4. Confirm the semicolon equivalent `echo control; rm -rf ...` is correctly blocked with `gate_decision=pause`.
# Impact
- Approval bypass allowing destructive shell commands to execute without explicit per-invocation confirmation.
- Can lead to unauthorized file deletion, file modification, and follow-on command execution within the host or container context.
- Smuggles destructive behavior past the safety gate through invisible command boundaries. |
|---|
| المصدر | ⚠️ https://github.com/nearai/ironclaw/issues/4861 |
|---|
| المستخدم | Erichen-apple (UID 99087) |
|---|
| ارسال | 18/06/2026 08:37 AM (2 أشهر منذ) |
|---|
| الاعتدال | 05/08/2026 06:45 PM (2 months later) |
|---|
| الحالة | تمت الموافقة |
|---|
| إدخال VulDB | 386265 [nearai ironclaw حتى 0.29.1 shell.rs classify_command_risk تجاوز الصلاحيات] |
|---|
| النقاط | 20 |
|---|