Skip to content

fix(hints): contain subdirectory hint discovery - #10545

Merged
alexhancock merged 1 commit into
mainfrom
jbg/security-hint-directory-containment
Jul 31, 2026
Merged

fix(hints): contain subdirectory hint discovery#10545
alexhancock merged 1 commit into
mainfrom
jbg/security-hint-directory-containment

Conversation

@jbg

@jbg jbg commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Canonicalize the working directory and discovered subdirectories before containment checks, deduplication, and hint reads.
  • Reject resolved directories outside the working-directory boundary while preserving aliases that resolve within it.
  • Leave paths with missing or otherwise unresolvable parents retryable instead of marking them loaded.

Security invariant

Subdirectory hint discovery may only read hint files from canonical descendant directories of the session working directory.

Addresses project-loupe/audit-goose#54.

Validation

  • cargo fmt --all
  • cargo test -p goose hints::load_hints::tests:: (25 passed)
  • cargo build -p goose
  • cargo clippy -p goose --all-targets -- -D warnings

The regression coverage exercises traversal outside the boundary, an outbound directory symlink, an in-boundary symlink alias with canonical deduplication, and retry after a missing parent is created. Symlink-specific tests are Unix-only; the containment implementation uses std::fs::canonicalize on every platform.

This finding was discovered by Project Loupe.

@jbg
jbg requested review from DOsinga and alexhancock July 17, 2026 21:43
@alexhancock alexhancock self-assigned this Jul 30, 2026
@alexhancock
alexhancock merged commit 2b507b8 into main Jul 31, 2026
25 checks passed
@alexhancock
alexhancock deleted the jbg/security-hint-directory-containment branch July 31, 2026 21:02
lifeizhou-ap added a commit that referenced this pull request Aug 3, 2026
* main: (103 commits)
  fix: parse PyPI requirements for OSV checks (#10510)
  fix(telegram): contain voice file extensions (#10456)
  Revert "feat(security): chunk command-classifier input with overlapping windows" (#10416) (#10870)
  docs: update Discord invite (#10863)
  fix(security): preserve denied tool request precedence (#10612)
  fix(hints): contain subdirectory hint discovery (#10545)
  chore(deps): bump pem from 3.0.6 to 4.0.0 (#10853)
  chore(deps): bump base64 from 0.22.1 to 0.23.0 (#10851)
  chore(deps): bump jsonwebtoken from 10.4.0 to 11.0.0 (#10850)
  chore(deps): bump astral-sh/setup-uv from 8.3.2 to 9.0.0 (#10847)
  chore(deps): bump docker/login-action from 4.5.1 to 4.5.2 (#10846)
  chore(deps): bump github/codeql-action from 4 to 4.37.3 (#10845)
  chore(deps): bump actions/stale from 10.4.0 to 11.0.0 (#10844)
  feat(dictation): add LOCAL_WHISPER_LANGUAGE for multilingual local transcription (#10634)
  fix(desktop): clear stale validation error when reopening the schedule modal (#10627)
  fix(docs): resolve CVE-2026-13149 in both brace-expansion copies (#10842)
  feat(provider): add Friendli as declarative provider (#10762)
  fix: sanitize shell/subprocess call in linux.rs (#10748)
  fix(desktop): unlink destination before copying binaries (#10705)
  feat(otel): enrich root span with gen_ai attributes and improve output format (#10816)
  ...
michaelneale added a commit that referenced this pull request Aug 4, 2026
* origin/main: (42 commits)
  chore (codex-acp): migrate to @agentclientprotocol/codex-acp (#10923)
  style: add dark mode inline code styling for message bubbles (#10861)
  docs: clarify macOS sandbox feature was removed in post-v1.25.0 cleanup (#10900)
  fall back to static model list only for non-models payloads (#10189)
  Remove CLI project support (#10838)
  fix(anthropic): add claude-sonnet-5 and claude-fable-5 to known models list (#10865)
  fix: stdio extensions silently skipped when name missing or env: used in config (#10773)
  feat(desktop): show session metadata on sidebar chat hover (#10663)
  fix(serve): start scheduler at startup instead of first ACP connection (#10766)
  fix: respect disabled builtin extensions (developer) at session start (#10223)
  fix: parse PyPI requirements for OSV checks (#10510)
  fix(telegram): contain voice file extensions (#10456)
  Revert "feat(security): chunk command-classifier input with overlapping windows" (#10416) (#10870)
  docs: update Discord invite (#10863)
  fix(security): preserve denied tool request precedence (#10612)
  fix(hints): contain subdirectory hint discovery (#10545)
  chore(deps): bump pem from 3.0.6 to 4.0.0 (#10853)
  chore(deps): bump base64 from 0.22.1 to 0.23.0 (#10851)
  chore(deps): bump jsonwebtoken from 10.4.0 to 11.0.0 (#10850)
  chore(deps): bump astral-sh/setup-uv from 8.3.2 to 9.0.0 (#10847)
  ...
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