Skip to content

[WRONG BRANCH] fix(responses): honor namespace tool_choice when restoring routed namespace aliases - #327

Closed
luvs01 wants to merge 1 commit into
mainfrom
codex/fix-namespace-tool-alias-vulnerability
Closed

[WRONG BRANCH] fix(responses): honor namespace tool_choice when restoring routed namespace aliases#327
luvs01 wants to merge 1 commit into
mainfrom
codex/fix-namespace-tool-alias-vulnerability

Conversation

@luvs01

@luvs01 luvs01 commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Motivation

  • The routed namespace compatibility layer exposed a bug where flattened namespace aliases were restored for the client without checking the per-turn tool_choice, allowing a noncanonical upstream to cause restoration of tools the caller did not authorize.
  • The intent of the change is to keep response restoration inside the caller's per-turn authorization boundary so upstream output cannot escalate a disallowed namespace child into an executable client call.

Description

  • Add an authorizedAliases helper in src/responses/namespace-tool-compat.ts that filters the request-local alias map to only those wire names authorized by the turn's tool_choice.
  • Use authorizedAliases(plan.aliases, toolChoice) when returning the upstream-rewritten body so downstream restoration only ever sees authorized aliases.
  • Add a focused regression test in tests/namespace-tool-compat.test.ts that asserts excluded namespace aliases are not armed or restored for allowed_tools, forced selectors, and the "none" case.

Testing

  • Ran the focused unit test: bun test tests/namespace-tool-compat.test.ts and it passed.
  • Ran static checks and larger test set: bun run typecheck, bun run test, and bun run privacy:scan, and all completed successfully in the environment used for verification.

Codex Task

@github-actions

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 59 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 7e819cd8-3eab-4ca3-a2c6-78d316e718a8

📥 Commits

Reviewing files that changed from the base of the PR and between 6ae83b1 and 0b485d2.

📒 Files selected for processing (2)
  • src/responses/namespace-tool-compat.ts
  • tests/namespace-tool-compat.test.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the bug Something isn't working label Aug 23, 2026
@github-actions

github-actions Bot commented Aug 23, 2026

Copy link
Copy Markdown

⏳ DRAFT

  • wrong target branch (main); retarget to dev.

What to do

  • Retarget this PR to dev — all contributions go to dev.

Its title has been prefixed with [WRONG BRANCH].
This pull request was already a draft. Its draft status will be preserved after every issue above is resolved.

@github-actions github-actions Bot changed the title fix(responses): honor namespace tool_choice when restoring routed namespace aliases [WRONG BRANCH] fix(responses): honor namespace tool_choice when restoring routed namespace aliases Aug 23, 2026
@github-actions
github-actions Bot marked this pull request as draft August 23, 2026 01:31
@luvs01 luvs01 closed this Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aardvark bug Something isn't working codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant