Problem
Python backend spawned from Electron main.js without validating script inputs. Shell scripts with malicious names or content could be executed.
Technical Details
File: main.js
Line: 2
const { spawn } = require('child_process');
Script execution via /api/scripts/run endpoint may not validate script paths.
Recommended Solution
Validate script paths before execution:
const path = require('path');
const fs = require('fs');
function validateScriptPath(scriptPath) {
const resolved = path.resolve(scriptPath);
const allowed = path.resolve(__dirname, 'scripts');
if (!resolved.startsWith(allowed)) {
throw new Error('Access denied: path outside allowed directory');
}
if (!fs.existsSync(resolved)) {
throw new Error('Script not found');
}
return resolved;
}
Program Template
Suggested Labels
security, command-injection, subprocess, gssoc-eligible
EOF
)
Problem
Python backend spawned from Electron main.js without validating script inputs. Shell scripts with malicious names or content could be executed.
Technical Details
File:
main.jsLine: 2
Script execution via /api/scripts/run endpoint may not validate script paths.
Recommended Solution
Validate script paths before execution:
Program Template
Suggested Labels
security, command-injection, subprocess, gssoc-eligible
EOF
)