Skip to content

chore: promote staging to staging-promote/8753c482-23098316440 (2026-03-15 00:13 UTC) - #1188

Merged
henrypark133 merged 2 commits into
staging-promote/e805ec61-23059634819from
staging-promote/c79754df-23099429381
Mar 16, 2026
Merged

henrypark133 merged 2 commits into
staging-promote/e805ec61-23059634819from
staging-promote/c79754df-23099429381

Conversation

@ironclaw-ci

@ironclaw-ci ironclaw-ci Bot commented Mar 15, 2026 •

Copy link
Copy Markdown
Contributor

Auto-promotion from staging CI

Batch range: 8753c482334b72dd97773b1d7c0e9ffbcba4c77f..c79754df2888ac7e2704d6cf4686b111eceee959
Promotion branch: staging-promote/c79754df-23099429381
Base: staging-promote/8753c482-23098316440
Triggered by: Staging CI batch at 2026-03-15 00:13 UTC

Commits in this batch (2):

Current commits in this promotion (2)

Current base: staging-promote/8753c482-23098316440
Current head: staging-promote/c79754df-23099429381
Current range: origin/staging-promote/8753c482-23098316440..origin/staging-promote/c79754df-23099429381

Auto-updated by staging promotion metadata workflow

Waiting for gates:

  • Tests: pending
  • E2E: pending
  • Claude Code review: pending (will post comments on this PR)

Auto-created by staging-ci workflow

* Make no-panics check test-aware

* Handle proc-macro test attrs in no-panics check

* Pin Python for no-panics CI job
* Fix schema-guided tool parameter coercion

* Fix CI checks for coercion regression tests

* Finish panic-scan annotations

* Avoid redundant worker param preparation

* Keep panic-scan annotations rustfmt-stable

* Handle nullable WASM schema review feedback

* Address param coercion review notes
@github-actions github-actions Bot added scope: agent Agent core (agent loop, router, scheduler) scope: tool Tool infrastructure scope: tool/wasm WASM tool sandbox scope: tool/builder Dynamic tool builder scope: worker Container worker scope: ci CI/CD workflows size: XL 500+ changed lines risk: medium Business logic, config, or moderate-risk modules contributor: core 20+ merged PRs labels Mar 15, 2026
@claude

claude Bot commented Mar 15, 2026

Copy link
Copy Markdown

Code review

Found 2 issues:

@claude

claude Bot commented Mar 15, 2026

Copy link
Copy Markdown

[HIGH:78] Unbounded JSON parsing in parameter coercion

The new prepare_tool_params() calls serde_json::from_str() on LLM params without timeout protection. Happens in execute_tool_with_safety() BEFORE the execution timeout. If LLM sends malicious deeply nested JSON, could cause unbounded memory allocation.

https://github.com/anthropics/ironclaw/blob/c79754df2888ac7e2704d6cf4686b111eceee959/src/tools/coercion.rs#L100-L105

Recommendation: Move coercion inside timeout guard or add size validation.

@claude

claude Bot commented Mar 15, 2026

Copy link
Copy Markdown

[MEDIUM:72] Test-aware panic check may miss panics

The bash/awk no-panics check determines test scope per hunk based on hunk header context. However, hunk headers show function names, not 'mod tests' scope. Production code after test hunks could be misclassified as test code.

https://github.com/anthropics/ironclaw/blob/c79754df2888ac7e2704d6cf4686b111eceee959/.github/workflows/code_style.yml#L93-L101

Recommendation: Python check (scripts/check_no_panics.py) is more accurate via AST parsing.

@claude

claude Bot commented Mar 15, 2026

Copy link
Copy Markdown

Review summary: Found 2 issues. The HIGH severity issue (unbounded JSON parsing in coercion) should be addressed before merging. The MEDIUM severity issue (panic check accuracy) is a trade-off in the new bash implementation. Overall, the refactoring to centralize parameter coercion in coercion.rs is a good architectural improvement.

@claude

claude Bot commented Mar 15, 2026

Copy link
Copy Markdown

[CRITICAL:85] Unbounded recursion in coerce_value() causes stack overflow

The recursive JSON coercion function (src/tools/coercion.rs:15-69) has no depth limits. Deeply nested JSON (10k+ levels) will overflow the stack. This is a production blocker when processing external/untrusted tool parameters.

https://github.com/anthropics/ironclaw/blob/c79754df2888ac7e2704d6cf4686b111eceee959/src/tools/coercion.rs#L15-L69

Recommendation: Add max recursion depth check or use iterative approach with explicit stack.

@claude

claude Bot commented Mar 15, 2026

Copy link
Copy Markdown

[HIGH:80] Excessive cloning in recursive coercion creates O(n²) memory usage

Multiple .clone() calls on JSON values in recursive path (lines 21,25,30,34,41,52,65,68). Large/nested structures cause cascading allocations. Example: 1MB input creates multiple MB during array/object coercion.

Recommendation: Use references where possible or implement iterator-based approach to avoid cloning.

@claude

claude Bot commented Mar 15, 2026

Copy link
Copy Markdown

[HIGH:75] Unbounded object property iteration enables DOS

Lines 54-63 iterate all object properties without size limits. Combined with recursive cloning, a 10k-property object creates multiplicative allocations. Attacker could send {a:1MB, b:1MB...} with 10k properties to exhaust memory.

Recommendation: Add per-object property count limits or size limits to coercion function.

@claude

claude Bot commented Mar 15, 2026

Copy link
Copy Markdown

REVIEW COMPLETE - SUMMARY

Found 6 issues total:

CRITICAL (2):

  • Unbounded JSON parsing outside timeout (HIGH:78)
  • Unbounded recursion in coerce_value() - stack overflow risk (CRITICAL:85)

HIGH (2):

  • Excessive cloning in recursive path - O(n²) memory (HIGH:80)
  • Unbounded object property iteration - DOS risk (HIGH:75)

MEDIUM (2):

  • Test-aware panic check accuracy (MEDIUM:72)

RECOMMENDATION: Do NOT merge until CRITICAL issues are resolved. The recursion, cloning, and unbounded resource consumption create production outage risks.

@claude

claude Bot commented Mar 15, 2026

Copy link
Copy Markdown

[MEDIUM:65] Missing error context in coercion per CLAUDE.md

src/tools/coercion.rs:97 uses .ok()? for JSON parsing without error context. Per CLAUDE.md code style: 'Map errors with context: .map_err(|e| SomeError::Variant { reason: e.to_string() })?'

Currently silently drops parse failures. When coercion fails, tool execution proceeds with wrong types and errors surface later with poor context about the original stringified value.

Recommendation: Map parse errors with context about what value failed to parse.

@claude

claude Bot commented Mar 15, 2026

Copy link
Copy Markdown

[CRITICAL:92] TOCTOU race condition in tool approval with hook modification

The approval check uses normalized params (line 486-489), but BeforeToolCall hook (line 521-564) can modify params AFTER approval is checked. The hook-modified params are re-normalized (line 552) but approval is NOT re-checked.

Attack: Hook transforms parameters to bypass approval. Example: {'safe': 'false'} (string, requires approval) → hook changes to {'safe': 'true'} but approval was already decided on the string value.

Mitigation: Must re-check tool.requires_approval() after hook returns modified params.

@claude

claude Bot commented Mar 15, 2026

Copy link
Copy Markdown

[CRITICAL:92] Unbounded recursion + JSON parsing creates DOS vector (DUPLICATE FINDING)

This confirms the earlier finding. Attacker can craft: {"param": "[[[[...]]]]]"} with 10k nesting levels.

Sequence: Line 97 parses JSON (serde_json allows arbitrary depth) → Line 105 calls coerce_value() → Line 40 recurses on array items. Combined recursion exhausts stack and crashes process.

CRITICAL: This is exploitable by any LLM-provided tool parameter.

@claude

claude Bot commented Mar 15, 2026

Copy link
Copy Markdown

[HIGH:72] Hook modification can bypass parameter validation

When hook returns modified params (line 548), code re-normalizes (line 552) but validation still runs on normalized values (line 574-590).

Risk: Hook could return injection payload as string. This normalizes to string, passes validation, and reaches tool. While tools should validate inputs, this violates defense-in-depth.

Mitigation: Re-validate after hook modification.

@claude

claude Bot commented Mar 15, 2026

Copy link
Copy Markdown

SECURITY ALERT - MERGE BLOCKED

All 4 review agents have identified CRITICAL security issues:

CRITICAL (2):

  • Unbounded recursion in coerce_value() enables DOS via nested JSON
  • TOCTOU race in approval checking - hooks can bypass approval requirements

HIGH (2):

  • Missing recursion depth on JSON parsing
  • Hook can reintroduce stringified values bypassing validation

Action Required:

  1. Add recursion depth limit to coerce_value()
  2. Re-check tool.requires_approval() after hook returns modified params
  3. Add serde_json depth limits for untrusted input

These are not design issues but concrete exploitable vulnerabilities. DO NOT MERGE until fixed.

Base automatically changed from staging-promote/8753c482-23098316440 to staging-promote/e805ec61-23059634819 March 16, 2026 15:57
@henrypark133
henrypark133 merged commit b8ddbea into staging-promote/e805ec61-23059634819 Mar 16, 2026
53 checks passed
@henrypark133
henrypark133 deleted the staging-promote/c79754df-23099429381 branch March 16, 2026 16:01
bkutasi pushed a commit to bkutasi/ironclaw that referenced this pull request Mar 28, 2026
…3099429381

chore: promote staging to staging-promote/8753c482-23098316440 (2026-03-15 00:13 UTC)
drchirag1991 pushed a commit to drchirag1991/ironclaw that referenced this pull request Apr 8, 2026
…3099429381

chore: promote staging to staging-promote/f8d81a89-23098316440 (2026-03-15 00:13 UTC)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor: core 20+ merged PRs risk: medium Business logic, config, or moderate-risk modules scope: agent Agent core (agent loop, router, scheduler) scope: ci CI/CD workflows scope: tool/builder Dynamic tool builder scope: tool/wasm WASM tool sandbox scope: tool Tool infrastructure scope: worker Container worker size: XL 500+ changed lines staging-promotion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant