Skip to content

fix(images): bound bridge iteration buffering - #67

Closed
luvs01 wants to merge 1 commit into
Devfrom
codex/propose-fix-for-image-bridge-dos-vulnerability
Closed

fix(images): bound bridge iteration buffering#67
luvs01 wants to merge 1 commit into
Devfrom
codex/propose-fix-for-image-bridge-dos-vulnerability

Conversation

@luvs01

@luvs01 luvs01 commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Prevent unbounded memory growth in the image bridge by bounding per-iteration semantic buffering and per-call tool-argument accumulation so a malicious or compromised upstream provider cannot exhaust proxy memory.

Description

  • Enforce a per-iteration retained-event byte ceiling when buffering adapter events by adding appendBoundedIterationEvent and charging against TRANSLATOR_MAX_TURN_BYTES, which causes a typed TranslatorBudgetExceededError when exceeded.
  • Enforce a per-call argument-byte ceiling while assembling streamed tool_call_delta chunks by tracking pendingArgsBytes and throwing TranslatorBudgetExceededError once TRANSLATOR_MAX_CALL_ARGUMENT_BYTES is exceeded.
  • Apply the bounded append to both runTurn adapter collection and the streamed parseStreamWithProgress path so runTurn and non-runTurn adapters are both protected.
  • Add focused regression tests in tests/images/loop.test.ts that assert oversized semantic output and oversized synthetic tool-argument streams produce a translation_buffer_limit failure rather than allowing the bridge to complete.

Testing

  • bun test tests/images/loop.test.ts — focused image-bridge tests passed (31 tests).
  • bun run typecheck — TypeScript typecheck passed.
  • bun run privacy:scan — privacy scan passed for changed files.
  • bun run test — full test suite encountered an unrelated timeout / auth-status mismatch in an unrelated provider validation test; focused image-bridge tests remain green.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: b6eef7c7-7c1f-4b84-aa7a-3e7428381ce5


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 commented Aug 7, 2026

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot changed the title fix(images): bound bridge iteration buffering [WRONG BRANCH] fix(images): bound bridge iteration buffering Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

✅ READY

  • all PR quality gates passed.

Hygiene

Deterministic PR hygiene checks passed.

@github-actions
github-actions Bot marked this pull request as draft August 7, 2026 22:31
@github-actions github-actions Bot added the bug Something isn't working label Aug 7, 2026
@luvs01 luvs01 changed the title [WRONG BRANCH] fix(images): bound bridge iteration buffering fix(images): bound bridge iteration buffering Sep 3, 2026
@luvs01
luvs01 changed the base branch from main to dev September 3, 2026 06:27
@github-actions
github-actions Bot marked this pull request as ready for review September 3, 2026 06:35
@luvs01

luvs01 commented Sep 12, 2026

Copy link
Copy Markdown
Owner Author

Closing this original proposal after reimplementing its useful scope with current code and executable regression coverage. Follow-up now belongs to the submitted implementation and its review/CI; this closure does not claim the change has merged.

@luvs01 luvs01 closed this Sep 12, 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