Security is a first-class concern in ReScript Evangeliser. We follow a 10+ dimensional security model:
- Input Validation - All user input is validated and sanitized
- Output Encoding - Code transformations are safe from injection
- Authentication - VS Code workspace trust model
- Authorization - File system access controls
- Session Management - No network sessions required (offline-first)
- Cryptography - No cryptographic operations (not needed)
- Error Handling - No sensitive data in error messages
- Logging - No PII in logs
- Privacy - Zero telemetry by default
- Supply Chain - Minimal dependencies, lockfile verification
If you discover a security vulnerability, please report it responsibly:
DO:
- β Email security details to the maintainers (see MAINTAINERS.md)
- β Use encrypted email if possible (PGP key in .well-known/security.txt)
- β Wait for response before public disclosure (max 90 days)
- β Provide detailed reproduction steps
DON'T:
- β Open public GitHub issues for vulnerabilities
- β Disclose before maintainers have responded
- β Exploit vulnerabilities for malicious purposes
Security issues include:
- Code injection vulnerabilities
- Path traversal attacks
- Arbitrary code execution
- Information disclosure
- Denial of service
- Supply chain attacks
- 24 hours: Initial acknowledgment
- 7 days: Preliminary assessment
- 30 days: Fix developed and tested
- 90 days: Public disclosure (coordinated)
In Scope:
- Malicious JavaScript/TypeScript files opened in VS Code
- Crafted pattern definitions
- File system traversal attempts
- Resource exhaustion (DoS)
Out of Scope:
- Physical access to developer machine
- OS-level vulnerabilities
- VS Code API vulnerabilities
- Network-based attacks (extension is offline-first)
βββββββββββββββββββββββββββββββββββββββββββ
β VS Code Workspace (Untrusted) β
β ββ User JavaScript files β
β ββ Custom pattern definitions β
βββββββββββββββββββββββββββββββββββββββββββ
β (sandboxed parsing)
βββββββββββββββββββββββββββββββββββββββββββ
β ReScript Evangeliser Extension β
β ββ AST Parser (Babel, sandboxed) β
β ββ Pattern Matcher (validated) β
β ββ Webview (Content Security Policy) β
β ββ File System (read-only by default) β
βββββββββββββββββββββββββββββββββββββββββββ
-
Input Sanitization
- All JavaScript/TypeScript parsed via Babel AST (not eval)
- Pattern regexes validated for ReDoS attacks
- File paths validated against traversal
-
Content Security Policy
- Webview UI runs with strict CSP
- No inline scripts or styles
- No external resource loading
-
Resource Limits
- Maximum file size: 10MB
- Parser timeout: 5 seconds
- Memory limit: 100MB per analysis
-
Least Privilege
- Read-only file access by default
- No network access (offline-first)
- No external process execution
- NO data sent to external servers
- NO user-identifying information collected
- NO code snippets transmitted
- NO analytics without explicit opt-in
If enabled (opt-in only):
- Aggregated, anonymous usage counts
- Pattern category usage (no code snippets)
- Performance metrics (timing only)
- Crash reports (no PII)
All telemetry is:
- Local-first (stored in VS Code settings)
- User-controlled (can be deleted anytime)
- Transparent (see docs/TELEMETRY.md)
# Run security tests
npm run test:security
# Check dependencies for vulnerabilities
npm audit
# Run linter with security rules
npm run lintBefore each release:
- Dependency audit (npm audit)
- Code review for injection risks
- CSP header validation
- File path sanitization check
- Resource limit testing
- Fuzz testing (pattern matching)
Current Dependencies:
@babel/parser- AST parsing (well-maintained, widely used)@babel/traverse- AST traversal@babel/types- AST type definitions
Security Measures:
- Package lock file committed (package-lock.json)
- Regular dependency updates
- Automated vulnerability scanning
- Minimal dependency tree (<10 packages)
- Reproducible builds via Nix flake
- Checksum verification
- Signed commits (when available)
This extension:
- Never makes network requests
- Never loads external resources
- Works in air-gapped environments
- No CDN dependencies
- Zero network-based attack surface
- No data exfiltration risks
- No man-in-the-middle vulnerabilities
- Works in high-security environments
This extension respects VS Code's workspace trust model:
- Untrusted Workspaces: Limited functionality (read-only)
- Trusted Workspaces: Full pattern detection and transformation
See: https://code.visualstudio.com/docs/editor/workspace-trust
When contributing code:
- No
eval()orFunction()constructors - All file paths sanitized
- Regex patterns checked for ReDoS
- No hardcoded secrets or credentials
- Error messages don't leak sensitive info
- No external network requests
- Input validation for all user data
- Resource limits respected
See CONTRIBUTING.md for full guidelines.
- OWASP Top 10 - Protection against common web vulnerabilities
- CWE Top 25 - Mitigation of common software weaknesses
- RFC 9116 - security.txt for vulnerability disclosure
- NIST Cybersecurity Framework - Security best practices
- Software-Defined Perimeter - Zero trust architecture
- RSR Bronze-level security requirements β
- Offline-first architecture β
- Privacy-preserving design β
- OWASP VS Code Extension Security
- VS Code Extension Security Best Practices
- NIST Cybersecurity Framework
Security updates are released as soon as possible:
- Critical: Within 24-48 hours
- High: Within 7 days
- Medium: Within 30 days
- Low: Next regular release
Subscribe to releases to stay informed: https://github.com/Hyperpolymath/rescript-evangeliser/releases
For security concerns:
- Email: See MAINTAINERS.md
- PGP Key: See .well-known/security.txt
- Security.txt: RFC 9116 compliant file in .well-known/
Last Updated: 2024-11-22 Policy Version: 1.0