This document outlines the security model, known vulnerabilities, and security practices for Syscity.
Syscity implements multiple layers of security:
- Input Validation: All user inputs are validated through JSON schema
- Sandboxing: Shell commands run with restricted permissions
- Allowlists: Explicit allowlists for paths and commands
- Rate Limiting: Per-user request throttling
- Authentication: Pairing codes for new users
- Crate:
sqlxv0.7.4 → v0.8.6 - Severity: High
- Issue: Binary Protocol Misinterpretation caused by Truncating or Overflowing Casts
- Status: Fixed — upgraded to 0.8.6 on 2026-06-04
- Impact: Affects SQLite protocol handling
- Crate:
wasmtimev15.0 → v45.0.0,wasmtime-wasiv15.0 → v45.0.0 - Severity: High/Critical
- Issues: ~15 vulnerabilities including sandbox escapes, data leakage, panics, heap OOB reads
- Status: Fixed — upgraded to 45.0.0 on 2026-06-04
- Impact: Affects WASM plugin execution
- Crate:
rsav0.9.10 - Status: Present in build dependencies only —
rsais a transitive dependency ofsqlx-mysql, pulled in viasqlx-macrosduring compile-time macro expansion. - Impact: Syscity only uses SQLite (
sqlx-sqlite). MySQL support is never enabled at runtime, and thersacrate is never loaded or executed. - Mitigation: Tracked in
.cargo/audit.tomlignore list with documented reason; no runtime exposure.
- Status: No longer in dependency tree — removed after upstream crate updates.
The following vulnerabilities exist in transitive dependencies and cannot be fixed until upstream crates release updates:
- Crate:
rustls-webpkiv0.102.8 (viaserenity→tokio-tungstenite0.21.0 →rustls0.22.4) - Advisories: RUSTSEC-2026-0049, RUSTSEC-2026-0098, RUSTSEC-2026-0099, RUSTSEC-2026-0104
- Issues: CRL parsing panic, name constraint bypass, wildcard certificate acceptance
- Status: Blocked upstream —
serenity0.12.5 lockstokio-tungstenite0.21.0 which requiresrustls0.22.4 - Mitigation: Tracked in
deny.tomlignore list with documented reason; monitor serenity releases
The following dependencies are unmaintained but don't have known security vulnerabilities:
- paste (RUSTSEC-2024-0436) — Used by sqlx-core, will be resolved when sqlx removes it
- proc-macro-error (RUSTSEC-2024-0370) — Used by teloxide, will be resolved when teloxide updates
- daemonize (RUSTSEC-2025-0069) — Used for Unix daemonization, no safe upgrade available
These are transitive dependencies and will be updated when upstream crates release updates.
Syscity's SecurityValidator detects and blocks path traversal attempts:
// Blocked patterns:
- "../" - Directory traversal
- "..\\" - Windows traversal
- "~/.." - Home directory escape
- "/.." - Root escape
- "%2e%2e%2f" - URL-encoded traversal
- "%252e%252e%252f" - Double URL-encoded
- "//" - Double slashThe following characters are blocked in shell commands:
;- Command separator&- Background process|- Pipe$- Variable substitution`- Command substitution$(- Command substitution${- Variable expansion
Sensitive configuration should use environment variables:
provider:
api_key: "${OPENAI_API_KEY}" # Never hardcode secretsDefault sandbox settings:
security:
sandbox:
enabled: true
allowed_commands: ["ls", "cat", "grep", "curl"]
forbidden_paths: ["/etc/passwd", "~/.ssh/*"]
timeout_seconds: 30- All HTTP clients use
rustls-tls(native Rust TLS, not OpenSSL) - Certificate validation is enabled by default
- No option to disable TLS verification in production
Web tools support domain allowlisting/blocklisting:
tools:
web:
blocked_domains: ["localhost", "127.0.0.1", "10.*", "192.168.*"]-
Run as non-root user
useradd -r -s /bin/false syscity
-
Use read-only filesystem where possible
--read-only --tmpfs /tmp -
Limit network access
- Only expose necessary ports
- Use internal networks for database connections
-
Enable rate limiting
security: rate_limits: requests_per_minute: 30
- Never commit secrets to version control
- Use environment variables or secret management systems
- Rotate API keys regularly
- Use different keys for different environments
Monitor for:
- Unusual API request patterns
- Path traversal attempts in logs
- Rate limit violations
- Failed authentication attempts
Before deploying Syscity:
- Changed default API keys
- Configured allowlists appropriately
- Enabled sandbox mode
- Set up rate limiting
- Configured log rotation
- Running as non-root user
- Firewall rules configured
- Regular backups scheduled
- Monitoring alerts configured
If you discover a security vulnerability:
- DO NOT open a public issue
- Email security concerns to: security@example.com
- Include:
- Description of the vulnerability
- Steps to reproduce
- Possible impact
- Suggested fix (if any)
We will respond within 48 hours and work on a fix.
- Critical vulnerabilities: Fix within 7 days
- High severity: Fix within 30 days
- Medium/Low severity: Fix in next scheduled release
- Dependency updates: Monthly review
| Date | Auditor | Scope | Results |
|---|---|---|---|
| 2024-03 | cargo-audit | Dependencies | 2 vulnerabilities, 3 unmaintained |
| 2026-06-04 | cargo-audit + cargo-deny | Dependencies | wasmtime 15→45, sqlx 0.7→0.8.6, rustls-pemfile removed, rsa removed from tree |