{"record":{"id":"b2c077a53ac3bd35","repo":"paperclipai/paperclip","slug":"invalid-exe-dev-environment-variable-key-key","errorCode":null,"errorMessage":"Invalid exe.dev environment variable key: ${key}","messagePattern":"Invalid exe\\.dev environment variable key: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/plugins/sandbox-providers/exe-dev/src/plugin.ts","lineNumber":532,"sourceCode":"\n  return {\n    sshIdentityFile,\n    cleanup: async () => {\n      await rm(tempDir, { recursive: true, force: true });\n    },\n  };\n}\n\nfunction buildLoginShellScript(input: {\n  command: string;\n  args: string[];\n  cwd?: string;\n  env?: Record<string, string>;\n}): string {\n  const env = input.env ?? {};\n  for (const key of Object.keys(env)) {\n    if (!isValidShellEnvKey(key)) {\n      throw new Error(`Invalid exe.dev environment variable key: ${key}`);\n    }\n  }\n  const envArgs = Object.entries(env)\n    .filter((entry): entry is [string, string] => typeof entry[1] === \"string\")\n    .map(([key, value]) => `${key}=${shellQuote(value)}`);\n  const commandParts = [shellQuote(input.command), ...input.args.map(shellQuote)].join(\" \");\n  const finalLine = envArgs.length > 0\n    ? `exec env ${envArgs.join(\" \")} ${commandParts}`\n    : `exec ${commandParts}`;\n  // Source the common login profiles before exec so the command runs with the\n  // interactive-shell PATH. The wrapper sources no `nvm.sh`; the sandbox image\n  // supplies node on the PATH.\n  const lines = [\n    'if [ -f /etc/profile ]; then . /etc/profile >/dev/null 2>&1 || true; fi',\n    'if [ -f \"$HOME/.profile\" ]; then . \"$HOME/.profile\" >/dev/null 2>&1 || true; fi',\n    'if [ -f \"$HOME/.bash_profile\" ]; then . \"$HOME/.bash_profile\" >/dev/null 2>&1 || true; elif [ -f \"$HOME/.bashrc\" ]; then . \"$HOME/.bashrc\" >/dev/null 2>&1 || true; fi',\n    'if [ -f \"$HOME/.zprofile\" ]; then . \"$HOME/.zprofile\" >/dev/null 2>&1 || true; fi',\n  ];","sourceCodeStart":514,"sourceCodeEnd":550,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/packages/plugins/sandbox-providers/exe-dev/src/plugin.ts#L514-L550","documentation":"Env-key sanitization in buildLoginShellScript for the exe.dev driver: an environment variable key failed isValidShellEnvKey, i.e. it is not a valid shell identifier safe to emit in the generated script. Rejecting bad keys here prevents shell metacharacter injection through env var names before the SSH command is built.","triggerScenarios":"Thrown at packages/plugins/sandbox-providers/exe-dev/src/plugin.ts:530 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a valid environment variable key (letters, digits, underscore, not starting with a digit)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a7e689b3c35347b529cb9f54c9b9a8575a3dcab6","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}