Skip to content

fix: secure large response spill files - #10482

Merged
michaelneale merged 1 commit into
mainfrom
jbg/security-large-response-tempfile
Jul 15, 2026
Merged

fix: secure large response spill files#10482
michaelneale merged 1 commit into
mainfrom
jbg/security-large-response-tempfile

Conversation

@jbg

@jbg jbg commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • create large tool-response spill files with collision-safe random names
  • keep spill files owner-only on Unix while preserving OS temporary-file cleanup semantics
  • verify spill paths and contents in existing tests, plus add uniqueness and permission regressions

Security impact

Large tool responses can contain command output, file contents, credentials, or database results. Creating these files through tempfile prevents other local users from reading them under a permissive process umask and prevents pre-created-name or symlink collisions.

This intentionally keeps the files in OS temporary storage, following the lifecycle concern raised on #9308 rather than moving unbounded spill data into Goose's persistent data directory.

Testing

  • cargo fmt --all -- --check
  • cargo test -p goose agents::large_response_handler::tests -- --nocapture
  • cargo build -p goose
  • cargo clippy -p goose --all-targets -- -D warnings
  • git diff --check

This finding was discovered by Project Loupe.

@jbg
jbg force-pushed the jbg/security-large-response-tempfile branch from a60fb40 to f393ba0 Compare July 15, 2026 09:52
@jbg

jbg commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: f393ba0da5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jbg
jbg requested a review from michaelneale July 15, 2026 10:29

@michaelneale michaelneale left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, this reads well to me, nice one.

@michaelneale
michaelneale added this pull request to the merge queue Jul 15, 2026
Merged via the queue into main with commit e7c3307 Jul 15, 2026
26 checks passed
@michaelneale
michaelneale deleted the jbg/security-large-response-tempfile branch July 15, 2026 23:38
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