| Version | Supported |
|---|---|
| 3.1.x | ✅ Actively supported |
| 3.0.x | |
| < 3.0 | ❌ No longer supported |
If you discover a security vulnerability in SPAR-Kit, please report it responsibly:
- DO NOT create a public GitHub issue
- Email: synthai@synthai.biz
- Include:
- Description of the vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if any)
We aim to respond within 48 hours and will work with you to address the issue.
All user input is validated before processing:
| Input Type | Validations |
|---|---|
| Session ID | UUID v4 format required |
| Decision text | Length limits, XSS pattern detection |
| File paths | Path traversal prevention, null byte rejection |
| Model names | Alphanumeric + safe characters only |
| Base URLs | Whitelist of allowed domains (SSRF prevention) |
| API keys | Format validation per provider |
All output is sanitized before display or export:
- Terminal output — Control characters removed
- Markdown export — Special characters escaped
- JSON export — Internal fields stripped
- LLM responses — Prompt injection patterns removed
| Data Type | Handling |
|---|---|
| API keys | Stored locally in ~/.spar/config.json, masked in logs and API |
| Session data | Stored locally, sanitized on export |
| LLM responses | Not transmitted to any server except configured provider |
The security module checks config file permissions:
// Recommended: 600 (owner read/write only)
chmod 600 ~/.spar/config.jsonIf permissions are too open, a warning is displayed.
- Keys stored in local config file only
- Never transmitted except to configured LLM provider
- Masked in all log output and API responses
- Not included in session exports
The following patterns are blocked in decision text:
<script>tagsjavascript:URLs- Event handlers (
onclick=,onerror=, etc.) <iframe>,<object>,<embed>tags
File paths are validated to prevent:
../sequences- Encoded traversal (
%2e%2e) - Backslash sequences (
..\\) - Null bytes
Base URLs are validated against a whitelist:
localhost/127.0.0.1(local)api.openai.comapi.anthropic.comgenerativelanguage.googleapis.com*.ollama.ai
Arbitrary URLs are rejected.
Sessions are validated on load:
- Required fields checked (
id,version,status,decision) - UUID format validated
- Status must be valid enum value
- Decision text validated for XSS
Invalid sessions are not loaded.
We use:
npm auditfor vulnerability scanning- Dependabot for automated updates
- Minimal runtime dependencies
To audit your installation:
cd /path/to/spar-kit
npm auditThe test suite includes security-specific tests:
npm run test:securityTests cover:
- UUID validation
- XSS detection
- Path traversal prevention
- API key format validation
- Output sanitization
- Sensitive data masking
-
Protect your config file
chmod 600 ~/.spar/config.json -
Use environment variables for CI/CD
export OPENAI_API_KEY=sk-... -
Review exported sessions before sharing publicly
- Never log API keys — Use
maskSensitiveData() - Validate all input — Use validation module
- Sanitize all output — Use sanitization module
- Test security — Run
npm run test:security
- Added comprehensive input validation module
- Added output sanitization for terminal, Markdown, JSON
- Added API key masking
- Added session integrity checks
- Added security test suite
- Added config file permission checks
🔒 Security is a feature, not an afterthought.