Skip to content

Authentication and skill subprocess output can grow without bounds #130

Closed

Description

@GautamSharma99

Summary

Several child-process collectors retain unlimited stdout or stderr:

CodexLoginHandle appends every chunk to #stdout or #stderr. Each chunk then calls #notifyInstructions, whose getters parse the complete accumulated output again. This combines unbounded storage with roughly quadratic parsing work as output grows.

runCodex also retains complete stdout and stderr. readSkillCommandOutput has no maximum JSONL line length and retains an unrestricted final agent message or error message.

Why this matters

A malfunctioning, compromised, or unexpectedly verbose child process can exhaust the SDK/CLI process's memory. Interactive login output can additionally cause excessive CPU use because earlier output is repeatedly reparsed. A single unterminated or very large JSON event from a skill command has the same memory risk.

Expected behavior

Subprocess output used for diagnostics or instruction discovery should have explicit byte limits. Oversized structured output should fail with a controlled, redacted error.

Suggested direction

  • Parse login instructions incrementally and keep only a bounded diagnostic tail.
  • Add separate stdout/stderr ceilings to runCodex.
  • Bound JSONL line size and retained final-message size in readSkillCommandOutput.
  • Preserve current credential redaction when reporting truncation or overflow.
  • Add tests for oversized stdout, stderr, JSONL lines, and final responses.

Existing tests cover malformed and normal-sized output but not these resource boundaries.

Found by static audit of upstream main at 9c7634b.

Activity

  1. added
    bug
    on Aug 3, 2026
  2. mldangelo-oai commented on Aug 3, 2026

    @mldangelo-oai
    Collaborator

    Fixed in #152.

    Authentication and skill subprocess output now has enforced size limits. I verified the oversized-output regressions for interactive authentication, noninteractive authentication, and skill events on the current main. Thank you for the report.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions