Skip to content

fix: sanitize Bedrock tool errors - #10934

Merged
jbg merged 1 commit into
mainfrom
jbg/security-bedrock-tool-error-unicode
Aug 5, 2026
Merged

fix: sanitize Bedrock tool errors#10934
jbg merged 1 commit into
mainfrom
jbg/security-bedrock-tool-error-unicode

Conversation

@jbg

@jbg jbg commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • remove Unicode Tags Block characters from Bedrock tool-error text before it re-enters model context
  • preserve the complete ordinary error message and status
  • add regressions for hidden tags and ordinary error text

This restores visible/model-input equivalence for the Bedrock ToolResponse error branch. It addresses the confirmed private audit finding project-loupe/audit-goose#651 without publishing exploit-specific content.

Validation

  • Regression proof before the fix: hidden-tag test failed while ordinary-error preservation passed
  • cargo fmt --check
  • cargo test -p goose --features aws-providers --lib tool_response_error_ — 2 passed
  • cargo test -p goose --features aws-providers --lib providers::formats::bedrock::tests — 39 passed
  • cargo build -p goose --features aws-providers
  • cargo clippy -p goose --features aws-providers --all-targets -- -D warnings
  • git diff --check

Limitations

This changes only the Bedrock tool-error formatter. Other model/tool metadata ingress paths are tracked separately and are outside this PR.

This finding was discovered by Project Loupe.

@jbg
jbg merged commit ce7e85a into main Aug 5, 2026
25 checks passed
@jbg
jbg deleted the jbg/security-bedrock-tool-error-unicode branch August 5, 2026 20:58
lifeizhou-ap added a commit that referenced this pull request Aug 6, 2026
* main: (32 commits)
  fix: keep turn-context in place for OpenAI Responses-stack models so prompt caching works (#10993)
  fix(developer): byte-bound the shell truncation preview (#10992)
  fix(openrouter): stop silently ignoring thinking effort off (#10991)
  fix: dispatch edited queued messages (#10933)
  fix: contain recipe template paths (#10930)
  fix: make shell approval titles faithful (#10986)
  fix: block MCP app form submissions (#10985)
  fix: migrate desktop routing to React Router 8.3.0 (#10971)
  fix: sanitize Bedrock tool errors (#10934)
  fix implicit OAuth during model discovery (#10929)
  fix: update React Router to 7.18.2 (#10967)
  test: early-exit code-exec smoke tests once tool invocation is observed (#10954)
  fix: keep ACP session naming out of live conversations (#10963)
  Bind MCP apps to trusted ownership metadata (#10747)
  tests: add recursion_limit attribute to remaining ACP test files (#10559)
  Sanitize Unicode tags in MCP resources (#10746)
  fix(oauth): preserve RFC 9207 iss from MCP OAuth callback (#10678)
  feat(installer): detect Termux and select musl portable build (#10568)
  feat: add Celeris provider (#10714)
  fix: shell ACP providers on desktop (#10907)
  ...
lifeizhou-ap added a commit that referenced this pull request Aug 6, 2026
* main: (101 commits)
  fix: keep turn-context in place for OpenAI Responses-stack models so prompt caching works (#10993)
  fix(developer): byte-bound the shell truncation preview (#10992)
  fix(openrouter): stop silently ignoring thinking effort off (#10991)
  fix: dispatch edited queued messages (#10933)
  fix: contain recipe template paths (#10930)
  fix: make shell approval titles faithful (#10986)
  fix: block MCP app form submissions (#10985)
  fix: migrate desktop routing to React Router 8.3.0 (#10971)
  fix: sanitize Bedrock tool errors (#10934)
  fix implicit OAuth during model discovery (#10929)
  fix: update React Router to 7.18.2 (#10967)
  test: early-exit code-exec smoke tests once tool invocation is observed (#10954)
  fix: keep ACP session naming out of live conversations (#10963)
  Bind MCP apps to trusted ownership metadata (#10747)
  tests: add recursion_limit attribute to remaining ACP test files (#10559)
  Sanitize Unicode tags in MCP resources (#10746)
  fix(oauth): preserve RFC 9207 iss from MCP OAuth callback (#10678)
  feat(installer): detect Termux and select musl portable build (#10568)
  feat: add Celeris provider (#10714)
  fix: shell ACP providers on desktop (#10907)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants