Skip to content

fix(hints): bound recursive file expansion - #10546

Merged
alexhancock merged 1 commit into
mainfrom
jbg/security-hint-expansion-budget
Aug 10, 2026
Merged

fix(hints): bound recursive file expansion#10546
alexhancock merged 1 commit into
mainfrom
jbg/security-hint-expansion-budget

Conversation

@jbg

@jbg jbg commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • bound each root hint expansion to 64 reference operations and 1 MiB of imported output
  • share both budgets across nested, repeated, and branching references
  • stop bounded child reads and preserve remaining @file references literally when either budget is exhausted
  • expand references by occurrence so repeated references cannot bypass operation accounting

Security invariant

A single hint-file expansion now has a fixed aggregate ceiling on reference work and inserted output while preserving normal direct and nested imports, depth limits, ignore rules, and import-boundary checks.

Regression coverage

  • default operation and output ceilings
  • repeated and branching reference amplification
  • exact output-budget boundary and one-byte-under exhaustion
  • direct, nested, circular, depth-limited, ignored, missing, and unsafe references

Validation

  • pre-fix: cargo test -p goose test_reference_operation_budget_preserves_excess_references failed because the 65th reference was expanded
  • cargo fmt --all
  • cargo test -p goose --lib hints::import_files::tests (13 passed)
  • cargo build -p goose
  • cargo clippy -p goose --all-targets -- -D warnings

Addresses project-loupe/audit-goose#57.

This finding was discovered by Project Loupe.

@jbg
jbg requested review from DOsinga and jamadeo July 21, 2026 17:18
@alexhancock alexhancock self-assigned this Jul 30, 2026
@alexhancock
alexhancock self-requested a review August 10, 2026 15:43
@alexhancock
alexhancock merged commit 433f621 into main Aug 10, 2026
30 of 31 checks passed
@alexhancock
alexhancock deleted the jbg/security-hint-expansion-budget branch August 10, 2026 15:44
michaelneale added a commit that referenced this pull request Aug 10, 2026
* origin/main:
  fix(conversation): sanitize nested tool responses (#10609)
  fix(hints): bound recursive file expansion (#10546)
  fix(providers): drop stale signed thinking blocks after a mid-conversation model switch (#10007)
  fix(desktop): clarify compact cost display (#11093)
  Index messages by (session_id, created_timestamp, id) to stop on-disk sort storms (#10874)
  docs: add tool shim guide covering when to enable, backends, and troubleshooting (#10858)
  fix(deep-link): route extension/session deep links to regular windows not standalone app windows (#10908)
  fix(ui): raise chat input z-index so slash menu appears above loading indicator (#11015)
  fix(ui): support remote working directory for external backend (#10827)
michaelneale added a commit that referenced this pull request Aug 10, 2026
* origin/main:
  fix(mcp): prune dead notification subscribers (#11032)
  chore: remove the extension and tool count suggestion (#10869)
  feat: compaction in the GDK (#11042)
  fix(provider): retry transient errors on first stream item before ending turn (#10968)
  feat(cli): add /new to start a fresh session without restarting (#10767)
  feat(acp): title new sessions from _meta.sessionTitle (#10712)
  fix: adjust rmcp::model::Meta ref (#11107)
  Skip hook loading and lifecycle events for subagents (#10596)
  Sanitize Unicode tags in Responses output (#10745)
  fix(conversation): sanitize nested tool responses (#10609)
  fix(hints): bound recursive file expansion (#10546)
  fix(providers): drop stale signed thinking blocks after a mid-conversation model switch (#10007)
  fix(desktop): clarify compact cost display (#11093)
  Index messages by (session_id, created_timestamp, id) to stop on-disk sort storms (#10874)
  docs: add tool shim guide covering when to enable, backends, and troubleshooting (#10858)
  fix(deep-link): route extension/session deep links to regular windows not standalone app windows (#10908)
  fix(ui): raise chat input z-index so slash menu appears above loading indicator (#11015)
  fix(ui): support remote working directory for external backend (#10827)
lifeizhou-ap added a commit that referenced this pull request Aug 11, 2026
* main:
  fix(mcp): prune dead notification subscribers (#11032)
  chore: remove the extension and tool count suggestion (#10869)
  feat: compaction in the GDK (#11042)
  fix(provider): retry transient errors on first stream item before ending turn (#10968)
  feat(cli): add /new to start a fresh session without restarting (#10767)
  feat(acp): title new sessions from _meta.sessionTitle (#10712)
  fix: adjust rmcp::model::Meta ref (#11107)
  Skip hook loading and lifecycle events for subagents (#10596)
  Sanitize Unicode tags in Responses output (#10745)
  fix(conversation): sanitize nested tool responses (#10609)
  fix(hints): bound recursive file expansion (#10546)
  fix(providers): drop stale signed thinking blocks after a mid-conversation model switch (#10007)
  fix(desktop): clarify compact cost display (#11093)
  Index messages by (session_id, created_timestamp, id) to stop on-disk sort storms (#10874)
  docs: add tool shim guide covering when to enable, backends, and troubleshooting (#10858)
  fix(deep-link): route extension/session deep links to regular windows not standalone app windows (#10908)
  fix(ui): raise chat input z-index so slash menu appears above loading indicator (#11015)
  fix(ui): support remote working directory for external backend (#10827)
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