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.
- Scheme-validate llm_endpoint on accept (reject file:// etc.) and enforce
RequireSecureURL in root.go so an http:// endpoint can't leak the LLM API
key in cleartext.
- Gate the completion profile loader behind the TrustStore and strip control
characters from completion descriptions.
// 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).
300
+
ifuntrusted {
301
+
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