Commit 36d3c7f
fix(host-agent): use new hooks schema + sandboxed env for install hooks
_handle_install's inner _run_install worker used the legacy
_resolve_setup_hook() which only read the old service.setup_hook field,
silently skipping any extension that defines its setup via the new
hooks.post_install schema. It also invoked subprocess.run without an
env= kwarg, inheriting the full host-agent environment (AGENT_API_KEY,
DREAM_AGENT_KEY, DASHBOARD_API_KEY and other secrets) into extension
setup scripts — a credential exfiltration vector.
Switch to _resolve_hook(ext_dir, "post_install") to honour both schemas,
and build the same minimal env allowlist that _execute_hook already
uses. Delete the now-unreferenced _resolve_setup_hook function and add a
source-level regression test that fails if the kwarg, allowlist, or
resolver call is ever reverted.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent c0600ca commit 36d3c7f
File tree
2 files changed
+65
-36
lines changed- dream-server
- bin
- extensions/services/dashboard-api/tests
2 files changed
+65
-36
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | 188 | | |
223 | 189 | | |
224 | 190 | | |
| |||
931 | 897 | | |
932 | 898 | | |
933 | 899 | | |
934 | | - | |
| 900 | + | |
935 | 901 | | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
936 | 918 | | |
937 | 919 | | |
938 | | - | |
| 920 | + | |
939 | 921 | | |
940 | 922 | | |
941 | 923 | | |
| |||
Lines changed: 47 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
0 commit comments