Skip to content

Conversation

@DOsinga
Copy link
Collaborator

@DOsinga DOsinga commented Jul 30, 2025

We were storing the server secret in the appConfig that was transported through extra params to the individual windows which means they become part of the parameters which makes the secret visible for any process that can see other processes.

douwe            67450   0.0  0.2 1621913168 111024   ??  S     8:22PM   0:40.91 /Applications/Goose.app/Contents/Frameworks/Goose Helper (Renderer).app/Contents/MacOS/Goose Helper (Renderer) --type=renderer --user-data-dir=/Users/douwe/Library/Application Support/Goose --app-path=/Applications/Goose.app/Contents/Resources/app.asar --enable-sandbox --lang=en-US --num-raster-threads=4 --enable-zero-copy --enable-gpu-memory-buffer-compositor-resources --enable-main-frame-before-activation --renderer-client-id=4 --time-ticks-at-unix-epoch=-1752795514407452 --launch-time-ticks=1104237712001 --shared-files --field-trial-handle=1718379636,r,517907852739083296,9621107575574687593,262144 --enable-features=ScreenCaptureKitPickerScreen,ScreenCaptureKitStreamPickerSonoma --disable-features=MacWebContentsOcclusion,SpareRendererForSitePerProcess,TimeoutHangingVideoCaptureStarts --variations-seed-version {"GOOSE_DEFAULT_PROVIDER":"databricks","GOOSE_DEFAULT_MODEL":"goose-claude-4-sonnet","GOOSE_PREDEFINED_MODELS":"[{\"id\":1,\"name\":\"goose-claude-4-sonnet\",\"provider\":\"databricks\",\"alias\":\"claude-4-sonnet (recommended)\",\"subtext\":\"Anthropic\"},{\"id\":2,\"name\":\"goose-claude-3-5-sonnet\",\"provider\":\"databricks\",\"alias\":\"claude-3.5-sonnet\",\"subtext\":\"Anthropic\"},{\"id\":3,\"name\":\"goose-claude-4-opus\",\"provider\":\"databricks\",\"alias\":\"claude-4-opus\",\"subtext\":\"Anthropic\"},{\"id\":4,\"name\":\"goose-gpt-4-1\",\"provider\":\"databricks\",\"alias\":\"GPT-4.1\",\"subtext\":\"OpenAI\"},{\"id\":5,\"name\":\"goose-o3\",\"provider\":\"databricks\",\"alias\":\"o3\",\"subtext\":\"OpenAI\"},{\"id\":6,\"name\":\"goose-claude-3-7-sonnet\",\"provider\":\"databricks\",\"alias\":\"claude-3.7-sonnet\",\"subtext\":\"Anthropic\"},{\"id\":7,\"name\":\"goose-gemini-2-5-pro\",\"provider\":\"databricks\",\"alias\":\"Gemini-2.5-pro\",\"subtext\":\"Google\"},{\"id\":8,\"name\":\"goose-gpt-4o\",\"provider\":\"databricks\",\"alias\":\"GPT-4o\",\"subtext\":\"OpenAI\"},{\"id\":9,\"name\":\"goose-o4-mini\",\"provider\":\"databricks\",\"alias\":\"o4-mini\",\"subtext\":\"OpenAI\"}]","GOOSE_API_HOST":"http://127.0.0.1","GOOSE_PORT":62066,"GOOSE_WORKING_DIR":"/Users/douwe/proj/goose/goose","GOOSE_ALLOWLIST_WARNING":false,"secretKey":"d59013a9d1d07631f34c14ad6851160477201d27e33df753f7fb4a47a52d36c4","REQUEST_DIR":"/Users/douwe/proj/goose/goose","GOOSE_BASE_URL_SHARE":"https://goosed.sqprod.co/api","GOOSE_VERSION":"1.1.4-block"} --seatbelt-client=61

This centralizes the secret in one place and provides access to it through the electron protocol.

@DOsinga DOsinga requested a review from jamadeo July 30, 2025 20:07
Copy link
Collaborator

@jamadeo jamadeo left a comment

Choose a reason for hiding this comment

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

Nice. When I searched the right way to do this, electron IPC was suggested, so this seems right!

Copy link
Contributor

@shellz-n-stuff shellz-n-stuff left a comment

Choose a reason for hiding this comment

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

Defs an improvement getting it out of the config.

Out of interest can we not have an interceptor for requests defined to keep the value only being handled/used in one place? Given it's electron could be a nice protection from leaking via XSS

// On Windows, use taskkill to forcefully terminate the process tree
// Security: Validate PID is numeric and use safe arguments
const pid = goosedProcess.pid?.toString() || '0';
if (!/^\d+$/.test(pid)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

will this be needed on windows?

Copy link
Collaborator

Choose a reason for hiding this comment

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

ah - centralising it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

well, it strikes me that either we can kill the thing or we can't. why would we try to guess what a pid looks like if we got it from the os and pass it to the os?

@michaelneale
Copy link
Collaborator

"Top-level await is not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari14" + 2 overrides)"

(which is causing the bundle failure)

});
}

await initializeClient();
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is what stops it from bundling with the error (you can see it with just make-ui)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah I am aware. it ran fine for me though. but can move to app.tsx

Copy link
Collaborator

Choose a reason for hiding this comment

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

(might have a fix... standby)

Copy link
Collaborator

Choose a reason for hiding this comment

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

ok vitejs/vite#6985 - says it isn't a vite issue (hrm...)

seems ok to set the build target to "newer" stuff, given this is an electron app, not a regular web app (otherwise can just not to await there...)

image

(just kidding, this was all by hand)

Copy link
Collaborator

@michaelneale michaelneale Jul 31, 2025

Choose a reason for hiding this comment

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

would be nice if the build https://github.com/block/goose/actions/runs/16632635914/job/47065764905?pr=3742#step:19:131 would fail at the right point (not that the test launch app stage)

but still - good to catch this now vs later.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

na, it is easy, just call it from the useEffect below instead. probably should have done that always

@DOsinga DOsinga merged commit d1e38fb into main Jul 31, 2025
9 checks passed
@DOsinga DOsinga deleted the secret-and-lies branch July 31, 2025 17:20
michaelneale added a commit that referenced this pull request Jul 31, 2025
* main:
  Increase req body limit (#2965)
  Stable goose info -v (#3760)
  Speed up app initialization and improve refresh crashing (#3717)
  docs: consolidate search session content, doc import recipe (#3759)
  Improve power save blocker mechanism (#3698)
  Ensure adding/removing extensions refreshes extensions list (#3695)
  Env parsing for primitive types (#3706)
  Autocompact + One Shot Summarization algorithm (#3559)
  fix: initial prompt not filled in after accepting new recipe (#3637)
  fix not being able to click on searchbar buttons in chat (#3723)
  center session summary modal description text (#3737)
  Persist first message to local history in case of failure or cancellation (#3744)
  Make the client more secure (#3742)
  feat: Allow configuring hints filename(s) (#3269)
  Add support for mouse back nav button to Settings screen (#3195)
  chore: Remove the wrong tailwind package (#3754)
  chore: fix typo in desktop readme for goosed (#3752)
  feat: upgrade rmcp (#3738)
  feat: allow users view and edit their non-secret config's (#3005)
  fix: View extensions link (#3751)
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.

5 participants