thevoidforge 21.0.13 → 21.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Haku moves between worlds seamlessly.
|
|
7
7
|
*/
|
|
8
8
|
import { randomUUID } from 'node:crypto';
|
|
9
|
-
import { isRemoteMode } from './tower-auth.js';
|
|
9
|
+
import { isRemoteMode, isLanMode } from './tower-auth.js';
|
|
10
10
|
import { audit } from './audit-log.js';
|
|
11
11
|
// node-pty is a native module — dynamic import to handle missing installs gracefully
|
|
12
12
|
let pty = null;
|
|
@@ -34,7 +34,9 @@ const ALLOWED_INITIAL_COMMANDS = ['claude', 'claude --dangerously-skip-permissio
|
|
|
34
34
|
const BASE_SAFE_ENV_KEYS = ['PATH', 'HOME', 'SHELL', 'USER', 'LANG', 'LC_ALL', 'LC_CTYPE', 'TERM_PROGRAM', 'EDITOR', 'VISUAL', 'XDG_CONFIG_HOME', 'XDG_DATA_HOME', 'NVM_DIR', 'NVM_BIN', 'NVM_INC', 'TMPDIR', 'TEMP', 'SSH_AUTH_SOCK', 'COLORTERM'];
|
|
35
35
|
// FLOW-R2-007: Only pass ANTHROPIC_API_KEY in local mode
|
|
36
36
|
function getSafeEnvKeys() {
|
|
37
|
-
|
|
37
|
+
// Remote mode (internet-facing): exclude API key — operator's key must not leak
|
|
38
|
+
// Local + LAN mode: include API key — it's the user's own key on their network
|
|
39
|
+
if (isRemoteMode() && !isLanMode())
|
|
38
40
|
return BASE_SAFE_ENV_KEYS;
|
|
39
41
|
return [...BASE_SAFE_ENV_KEYS, 'ANTHROPIC_API_KEY'];
|
|
40
42
|
}
|
|
@@ -69,7 +71,7 @@ export async function createSession(projectDir, projectName, label, initialComma
|
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
const nodePty = await loadPty();
|
|
72
|
-
const shell = process.env['SHELL'] || '/bin/
|
|
74
|
+
const shell = process.env['SHELL'] || '/bin/bash';
|
|
73
75
|
const id = randomUUID();
|
|
74
76
|
// SEC-013: Build clean environment — no credential leakage into PTY
|
|
75
77
|
const safeEnv = {};
|