| Version | Supported |
|---|---|
| 1.x | ✅ |
Do not open a public GitHub issue for security vulnerabilities.
To report a security vulnerability:
-
Email the maintainers with:
- Description of the vulnerability
- Steps to reproduce
- Impact assessment
- Any suggested fixes
-
Allow 48-72 hours for initial response
-
We will work with you to:
- Confirm the vulnerability
- Determine severity and impact
- Develop and test a fix
- Coordinate disclosure
- API Key Authentication: All protected endpoints require
X-API-Keyheader - Key Generation: Cryptographically secure via
secrets.token_urlsafe(32)(256-bit entropy) - Key Storage: Stored in
.moose_api_keywith0600permissions (owner read/write only) - Key Comparison: Timing-safe comparison via
secrets.compare_digest() - Key Rotation:
/api/key/rotateendpoint with 5-minute grace period for old key
| Input Type | Validation |
|---|---|
| File Paths | Resolved against project root, symlink detection, blocklist for sensitive files |
| SQL Queries | Read-only (SELECT), parameterized queries, dangerous keyword blocklist |
| Shell Commands | Allowlist of 30 approved commands, operator blocking (&&, |, ;, etc.) |
| Memory Tags | Alphanumeric + underscore/hyphen only, max 20 tags, max 50 chars each |
| Metadata | Allowlist of permitted keys only |
| User Input | HTML tag stripping, entity encoding |
- Database-backed: Persists across restarts
- Per-IP tracking: Prevents abuse from single source
- Configurable limits: Per endpoint and global
All responses include:
Content-Security-Policy: Restricts resource loadingX-Content-Type-Options: nosniff: Prevents MIME sniffingX-Frame-Options: DENY: Prevents clickjackingReferrer-Policy: strict-origin-when-cross-origin: Controls referrer information
- Private IP range blocking for web fetch operations
- Hostname resolution before IP validation
- HTTP/HTTPS schemes only
- DOMPurify sanitization on all markdown rendering
- Custom HTML escaping for interpolated content
- Safe link handling with
rel="noopener noreferrer"
- API Keys: Authentication credentials
- User Data: Conversations, tasks, memory
- System Access: Shell commands, file system
- External Services: LLM APIs, email sending
| Threat | Mitigation |
|---|---|
| Prompt Injection | Input sanitization, passive security monitoring |
| Path Traversal | Path resolution, symlink detection, blocklists |
| SQL Injection | Parameterized queries, allowlist keywords |
| Command Injection | Command allowlist, operator blocking |
| XSS | DOMPurify, CSP headers |
| CSRF | API key authentication, origin validation |
| SSRF | Private IP blocking, scheme validation |
| Email Header Injection | Header sanitization (CR/LF/null stripping) |
[User Browser]
|
| (Untrusted)
v
[Frontend SPA]
|
| (API Key + Origin Check)
v
[Backend API]
|
| (Internal, Semi-trusted)
v
[LLM Inference]
|
| (Internal, Trusted)
v
[SQLite Database]
- Tool Filtering: Agents have access only to their allowed tool set
- Security Agent: Monitors all message bus traffic for suspicious patterns
- Passive Security Check: User input screened for known attack patterns
- Escalation Flow: Sensitive actions require explicit user approval
The following security-critical components are candidates for Rust migration to improve memory safety and performance:
| Component | Status | Priority |
|---|---|---|
| Vector Memory | Planned | High |
| Input Sanitization | Planned | High |
| Path Validation | Planned | High |
| Audit Logger | Planned | Medium |
| SQL Query Validator | Planned | Medium |
| API Key Crypto | Planned | Medium |
Rust modules will expose Python bindings via PyO3.
The test suite includes security-focused tests:
test_path_validation.py: Path traversal, symlink attackstest_sql_blocking.py: SQL injection preventiontest_shell_commands.py: Command injection preventiontest_websocket_auth.py: WebSocket authenticationtest_rate_limiting.py: Rate limit enforcementtest_script_sandbox.py: Script sandboxingtest_applescript_escaping.py: AppleScript injection
Run security tests:
pytest backend/tests/ -v -k "security or sql or shell or path or rate"- Python:
pip-auditruns in CI to detect vulnerable dependencies - Node.js:
npm auditruns in CI for frontend dependencies - Rust:
cargo-auditconfigured for future Rust components
Sensitive configuration should use environment variables or .secrets files:
MOOSE_API_KEY: Override auto-generated API key- SMTP credentials: Store in environment, not profile.yaml
- Database path: Ensure proper permissions
Files excluded from version control (.gitignore):
.moose_api_key.env**.dbcredentials.json- TLS certificates