You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Close config trust-boundary gaps and gate the completion loader
- Trust-gate cache_dir, cache_enabled, llm_model, llm_max_concurrent and
llm_token_budget so an untrusted local/repo config can't redirect cache
writes or amplify paid-LLM usage; only honored from trusted sources.
'config set' now also warns when these keys are written to an untrusted
local config so the value isn't silently ignored on the next load.
- Scheme/host-validate llm_endpoint on accept (rejects file://, hostless and
malformed forms) and re-validate at the root.go enforcement point so env/
profile-sourced endpoints can't slip a non-http(s) scheme past
RequireSecureURL, which only blocks http:// for non-localhost; this prevents
leaking llm_api_key in cleartext.
- Gate the completion profile loader behind the TrustStore and strip control
characters from completion descriptions.
fmt.Fprintf(os.Stderr, "warning: authority key %q in local config requires trust to take effect; run:\n basecamp config trust %s\n", key, config.ShellQuote(absPath))
352
+
fmt.Fprintf(os.Stderr, "warning: %q in local config requires trust to take effect; run:\n basecamp config trust %s\n", key, config.ShellQuote(absPath))
// cache_dir redirects every cache write (completion, resilience, TUI
201
+
// workspace, recents, traces). An untrusted local/repo config could
202
+
// point it at any user-writable path, so gate it like other authority
203
+
// keys. filepath.Clean normalizes the accepted value.
204
+
ifuntrusted {
205
+
fmt.Fprintf(os.Stderr, "warning: ignoring cache_dir %q from %s config at %s\n (authority key from local/repo config; run `basecamp config trust %s` to allow)\n", v, source, path, ShellQuote(path))
206
+
} else {
207
+
cfg.CacheDir=filepath.Clean(v)
208
+
cfg.Sources["cache_dir"] =string(source)
209
+
}
201
210
}
202
211
ifv, ok:=fileCfg["cache_enabled"].(bool); ok {
203
-
cfg.CacheEnabled=v
204
-
cfg.Sources["cache_enabled"] =string(source)
212
+
ifuntrusted {
213
+
fmt.Fprintf(os.Stderr, "warning: ignoring cache_enabled from %s config at %s\n (authority key from local/repo config; run `basecamp config trust %s` to allow)\n", source, path, ShellQuote(path))
fmt.Fprintf(os.Stderr, "warning: ignoring llm_max_concurrent from %s config at %s\n (authority key from local/repo config; run `basecamp config trust %s` to allow)\n", source, path, ShellQuote(path))
// Gate like other LLM authority keys (cost amplification).
301
+
ifuntrusted {
302
+
fmt.Fprintf(os.Stderr, "warning: ignoring llm_token_budget from %s config at %s\n (authority key from local/repo config; run `basecamp config trust %s` to allow)\n", source, path, ShellQuote(path))
0 commit comments