Skip to content

Commit 36f8305

Browse files
committed
fix: confine remote HTTP trust boundaries
1 parent 04758c9 commit 36f8305

22 files changed

Lines changed: 1246 additions & 182 deletions

‎src/cli-schema/cli-help-topics.test.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,14 @@ test('root help routes detailed reference material to progressive topics', async
143143
assert.match(commandsHelp, /Default config files: ~\/\.agent-device\/config\.json/);
144144
assert.match(commandsHelp, /^Environment:/m);
145145
assert.match(commandsHelp, /AGENT_DEVICE_SESSION\s+Explicit session name/);
146+
assert.match(
147+
commandsHelp,
148+
/AGENT_DEVICE_HTTP_ALLOW_HOST_PATH_INSTALL\s+Explicit remote host-path install opt-in/,
149+
);
150+
assert.match(
151+
commandsHelp,
152+
/AGENT_DEVICE_HTTP_HOST_PATH_INSTALL_ROOT\s+Realpath root for remote host-path installs/,
153+
);
146154
assert.match(commandsHelp, /^Examples:/m);
147155
assert.match(commandsHelp, /agent-device open Settings --platform ios/);
148156

@@ -464,6 +472,10 @@ test('usageForCommand resolves remote help topic', async () => {
464472
assert.match(help, /Multiple agents can share one proxy/);
465473
assert.match(help, /disconnect releases local connection state/);
466474
assert.match(help, /A busy direct-proxy device error means another agent owns the device/);
475+
assert.match(help, /AGENT_DEVICE_HTTP_AUTH_HOOK configured treats HTTP requests as remote/);
476+
assert.match(help, /AGENT_DEVICE_HTTP_ALLOW_HOST_PATH_INSTALL=true/);
477+
assert.match(help, /AGENT_DEVICE_HTTP_HOST_PATH_INSTALL_ROOT/);
478+
assert.match(help, /rejects traversal or symlink escapes/);
467479
assert.match(help, /Limrun, BrowserStack, and AWS Device Farm through local provider profiles/);
468480
assert.match(help, /Limrun uses LIMRUN_API_KEY/);
469481
assert.match(help, /BrowserStack uses BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY/);

‎src/cli-schema/cli-help.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ const ENVIRONMENT_LINES = [
3737
label: 'AGENT_DEVICE_DAEMON_AUTH_TOKEN',
3838
description: 'Remote daemon service/API token',
3939
},
40+
{
41+
label: 'AGENT_DEVICE_HTTP_ALLOW_HOST_PATH_INSTALL',
42+
description: 'Explicit remote host-path install opt-in',
43+
},
44+
{
45+
label: 'AGENT_DEVICE_HTTP_HOST_PATH_INSTALL_ROOT',
46+
description: 'Realpath root for remote host-path installs',
47+
},
4048
{
4149
label: 'AGENT_DEVICE_CLOUD_BASE_URL',
4250
description: 'Bridge/control-plane API origin for cloud auth and /api-keys',
@@ -822,6 +830,7 @@ Rules:
822830
disconnect releases local connection state; close releases the active session and device lease.
823831
A busy direct-proxy device error means another agent owns the device until it closes or its inactivity lease expires.
824832
Keep the proxy token secret. Anyone with the token can control the proxied daemon.
833+
A daemon with AGENT_DEVICE_HTTP_AUTH_HOOK configured treats HTTP requests as remote: host-path install sources are rejected by default, and Maestro runScript HTTP helpers allow only public network destinations. To opt into path installs, set AGENT_DEVICE_HTTP_ALLOW_HOST_PATH_INSTALL=true and AGENT_DEVICE_HTTP_HOST_PATH_INSTALL_ROOT to an existing directory; the daemon resolves the requested path and rejects traversal or symlink escapes. No-hook local HTTP and socket flows retain their local behavior.
825834
If local/proxy iOS reports that the runner is already owned by another agent-device daemon after lease admission, retry after the owning session closes or after lease expiry. If the conflict repeats, clean stale daemon state on the machine with simulator access.
826835
Do not use --config as a remote profile flag. --config loads CLI defaults; --remote-config selects remote daemon/profile settings.
827836
For self-contained scripts, pass the same --remote-config to every operational command, including disconnect; a preceding connect is optional but not required.

0 commit comments

Comments
 (0)