@rapay/mcp-server 1.2.0 → 1.2.1
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.
- package/dist/handlers.js +25 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/handlers.js
CHANGED
|
@@ -399,9 +399,33 @@ function parseCliError(error) {
|
|
|
399
399
|
*/
|
|
400
400
|
async function executeCliCommand(args, timeoutMs = 30000) {
|
|
401
401
|
return new Promise((resolve, reject) => {
|
|
402
|
+
// Security: Only pass necessary environment variables to CLI subprocess
|
|
403
|
+
// This prevents leaking secrets from MCP server environment to CLI
|
|
404
|
+
// CLI needs: PATH (to find executables), HOME/USERPROFILE (for config files),
|
|
405
|
+
// RAPAY_* (explicit Ra Pay configuration), and keyring-related vars
|
|
406
|
+
const safeEnv = {
|
|
407
|
+
PATH: process.env.PATH,
|
|
408
|
+
HOME: process.env.HOME,
|
|
409
|
+
USERPROFILE: process.env.USERPROFILE, // Windows equivalent of HOME
|
|
410
|
+
TMPDIR: process.env.TMPDIR,
|
|
411
|
+
TEMP: process.env.TEMP,
|
|
412
|
+
TMP: process.env.TMP,
|
|
413
|
+
// Allow explicit Ra Pay config overrides
|
|
414
|
+
RAPAY_API_URL: process.env.RAPAY_API_URL,
|
|
415
|
+
RAPAY_CONFIG_DIR: process.env.RAPAY_CONFIG_DIR,
|
|
416
|
+
// Keyring access (Linux)
|
|
417
|
+
DBUS_SESSION_BUS_ADDRESS: process.env.DBUS_SESSION_BUS_ADDRESS,
|
|
418
|
+
XDG_RUNTIME_DIR: process.env.XDG_RUNTIME_DIR,
|
|
419
|
+
// Windows credential manager
|
|
420
|
+
APPDATA: process.env.APPDATA,
|
|
421
|
+
LOCALAPPDATA: process.env.LOCALAPPDATA,
|
|
422
|
+
// Windows system variables (required by libuv for spawn)
|
|
423
|
+
SYSTEMROOT: process.env.SYSTEMROOT,
|
|
424
|
+
WINDIR: process.env.WINDIR,
|
|
425
|
+
};
|
|
402
426
|
const child = spawn(CLI_PATH, args, {
|
|
403
427
|
stdio: ["pipe", "pipe", "pipe"],
|
|
404
|
-
env:
|
|
428
|
+
env: safeEnv,
|
|
405
429
|
// cross-spawn handles Windows .cmd wrappers automatically
|
|
406
430
|
});
|
|
407
431
|
let stdout = "";
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED