Skip to content

[BUG][Medium]- Large QuickJS results can exceed the call's host resource budget #101

Open

Description

@arthurianresolve

Summary

QuickJS applies heap, stack, and nominal duration limits while JavaScript runs. A large serializable result then crosses into Rust to_string and serde_json::from_str without an output byte or value count bound; a capability result is also stringified after its timed future completes. An embedding host that exposes Code Mode or sandboxed tools to lower trust input can therefore spend host resources beyond the advertised per call sandbox limits.

Affected code

Suggested resolution

  • Enforce a maximum serialized result size and structure count before host side parsing or serialization.
  • Include bridge conversion and capability result handling in an end to end call deadline.

Acceptance criteria

  • Oversized script or capability results fail with a controlled limit error.
  • The configured deadline covers the complete sandbox call, including conversion into host values.

Validation performed

Static source review of upstream main at 72b247e2bddc7337f923461fb27b4127c7d104f3. No runtime exploit or deployed service test was performed.

Tracking

  • Finding ID: csf_77f0af8cb1b75ff5bf546d96
  • Fingerprint: codex-security/v1:sha256:59eb482a5a06f66cc162f8b42a56459b97d1dbccf032d7d0a3a1e6ac31548724

AI disclosure

OpenAI Codex assisted with the static source review and organization of this issue. No code change is included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions