Skip to content

scan recipe for security when saving recipe#5747

Merged
lifeizhou-ap merged 2 commits intomainfrom
lifei/scan-recipe-when-save
Nov 17, 2025
Merged

scan recipe for security when saving recipe#5747
lifeizhou-ap merged 2 commits intomainfrom
lifei/scan-recipe-when-save

Conversation

@lifeizhou-ap
Copy link
Collaborator

Summary

Scan recipe for security when saving recipe

Type of Change

  • Feature
  • Bug fix
  • Refactor / Code quality
  • Performance improvement
  • Documentation
  • Tests
  • Security fix
  • Build / Release
  • Other (specify below)

Testing

Manual testing

Copilot AI review requested due to automatic review settings November 14, 2025 20:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds security validation to the save_recipe endpoint to detect and block recipes containing invisible Unicode tag characters (U+E0000-U+E007F) that could be used for steganographic attacks. The validation rejects such recipes before they are saved to disk.

  • Adds a security check using check_for_security_warnings() before saving recipes
  • Returns a clear error message when malicious Unicode tag characters are detected
Comments suppressed due to low confidence (1)

crates/goose-server/src/routes/recipe.rs:339

  • The OpenAPI documentation specifies status 204 (No Content) for success, but the endpoint actually returns status 200 with a JSON body (SaveRecipeResponse). Either update the documentation to status 200 or change the implementation to return 204 with no body.
        (status = 204, description = "Recipe saved to file successfully", body = SaveRecipeResponse),

let has_security_warnings = request.recipe.check_for_security_warnings();
if has_security_warnings {
return Err(ErrorResponse {
message: "This recipe contains hidden characters that will be ignored for your safety, as they could be used for malicious purposes.".to_string(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

isn't it more the case that we are refusing the save this recipe? so say something like, this contains hidden characters, please remove before trying to save?

@lifeizhou-ap lifeizhou-ap merged commit 8d98a25 into main Nov 17, 2025
17 checks passed
michaelneale added a commit that referenced this pull request Nov 17, 2025
* main:
  scan recipe for security when saving recipe (#5747)
  feat: trying grok for live test (#5732)
  Platform Extension MOIM (Minus One Info Message) (#5027)
  docs: remove hackathon banner (#5756)
  Fix: Recipes respect the quiet flag (#5743)
  docs: update cli commands (#5744)
  Run smoke tests on a free runner (#5745)
  faster, cheaper (pick two): improve CI workflow and switch to free github runner (#5702)
  Compaction resiliency improvements (#5618)
  docs: ask goose button (#5730)
  Update prompt injection detection metrics (due to errors exporting to datadog) (#5692)
  Spence/icon2 tokyo drift (#5728)
  docs: logs rotation and misc updates (#5727)
  docs: automatic ollama model detection (#5725)
  Fix context progress bar not resetting after /clear command (#5652)
  docs: removing double announcements (#5714)
  docs: mcp sampling support (#5708)
Surendhar-N-D pushed a commit to Surendhar-N-D/goose that referenced this pull request Nov 17, 2025
arul-cc pushed a commit to arul-cc/goose that referenced this pull request Nov 17, 2025
aharvard added a commit that referenced this pull request Nov 18, 2025
* origin/main: (60 commits)
  chore: incorporate LF feedback (#5787)
  docs: quick launcher (#5779)
  Bump auto scroll threshold (#5738)
  fix: add one-time cleanup for linux hermit locking issues (#5742)
  Don't show update tray icon if GOOSE_VERSION is set (#5750)
  fix: get win node path from registry (#5731)
  Handle spaces in extension names also (#5770)
  Remove empty settings card for Scheduling Engine (#5771)
  fix windows cli build (#5768)
  fix: Implement a CredentialStore for auth (#5741)
  blog post: How to Successfully Migrate Your App with an AI Agent (#5762)
  Simplify finding `goosed` (#5739)
  More time for goosed (#5746)
  Match lower case (#5763)
  scan recipe for security when saving recipe (#5747)
  feat: trying grok for live test (#5732)
  Platform Extension MOIM (Minus One Info Message) (#5027)
  docs: remove hackathon banner (#5756)
  Fix: Recipes respect the quiet flag (#5743)
  docs: update cli commands (#5744)
  ...
katzdave added a commit that referenced this pull request Nov 18, 2025
* 'main' of github.com:block/goose: (125 commits)
  Document Mistral AI provider (#5799)
  docs: Add Community Stars recipe script and txt file (#5776)
  chore: incorporate LF feedback (#5787)
  docs: quick launcher (#5779)
  Bump auto scroll threshold (#5738)
  fix: add one-time cleanup for linux hermit locking issues (#5742)
  Don't show update tray icon if GOOSE_VERSION is set (#5750)
  fix: get win node path from registry (#5731)
  Handle spaces in extension names also (#5770)
  Remove empty settings card for Scheduling Engine (#5771)
  fix windows cli build (#5768)
  fix: Implement a CredentialStore for auth (#5741)
  blog post: How to Successfully Migrate Your App with an AI Agent (#5762)
  Simplify finding `goosed` (#5739)
  More time for goosed (#5746)
  Match lower case (#5763)
  scan recipe for security when saving recipe (#5747)
  feat: trying grok for live test (#5732)
  Platform Extension MOIM (Minus One Info Message) (#5027)
  docs: remove hackathon banner (#5756)
  ...
BlairAllan pushed a commit to BlairAllan/goose that referenced this pull request Nov 29, 2025
Signed-off-by: Blair Allan <Blairallan@icloud.com>
@lifeizhou-ap lifeizhou-ap deleted the lifei/scan-recipe-when-save branch January 27, 2026 06:51
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