This document describes the security features and configuration options for the Thalora web browser.
Thalora is designed for AI model integration and automation. It implements defense-in-depth security with the following layers:
- Used XOR cipher with hardcoded key
- All stored passwords could be decrypted in <1ms
- No authentication or tampering detection
- AES-256-GCM authenticated encryption
- Argon2id key derivation (resistant to GPU attacks)
- Random salt per password (prevents rainbow tables)
- Random nonce per encryption (prevents pattern analysis)
- 128-bit authentication tag (detects tampering)
Required: Set a strong master password (minimum 32 characters):
export THALORA_MASTER_PASSWORD="your-strong-password-minimum-32-characters-long!"Security Requirements:
- Master password MUST be at least 32 characters
- Password is required for all credential encryption/decryption
- Credentials encrypted with old XOR format will NOT decrypt (must be re-entered)
If you have credentials encrypted with the old XOR format:
-
Delete old credential cache:
rm -rf ~/.cache/thalora/ai_memory/ -
Set new master password:
export THALORA_MASTER_PASSWORD="your-new-strong-password-32chars!"
-
Re-enter all credentials
Data Location: ~/.cache/thalora/ai_memory/
- Weak pattern matching (easily bypassed)
- eval(), Function() constructor not blocked
- No AST-based validation
- 10MB code size limit (too large)
- AST-based JavaScript validation using SWC parser
- Hard blocks (no feature flags, no overrides):
eval()calls - BLOCKEDFunction()constructor - BLOCKEDsetTimeout/setIntervalwith strings - BLOCKED__proto__access - BLOCKED (prototype pollution)constructor.constructor- BLOCKEDwithstatements - BLOCKEDimportstatements - BLOCKEDdocument.write- BLOCKED- WebAssembly instantiation - BLOCKED
Blocked Code:
eval('alert(1)') // ❌ BLOCKED
Function('return 1')() // ❌ BLOCKED
setTimeout('alert(1)', 1000) // ❌ BLOCKED
obj.__proto__ = {} // ❌ BLOCKED
obj.constructor.constructor() // ❌ BLOCKED
with (obj) { x = 1; } // ❌ BLOCKED
import { foo } from 'bar' // ❌ BLOCKEDAllowed Code:
const x = 1 + 2; // ✅ ALLOWED
function add(a, b) { return a + b; } // ✅ ALLOWED
setTimeout(() => console.log('ok'), 1000) // ✅ ALLOWED
const arr = [1, 2, 3].map(x => x * 2); // ✅ ALLOWEDNo Configuration Options: JavaScript security is enforced by default with no way to disable it. This is intentional to prevent security bypass.
- No per-origin storage isolation
- Site A could access Site B's localStorage
- Credentials accessible cross-origin
- Same-Origin Policy enforced
- localStorage/sessionStorage isolated per origin
- Credentials stored per-origin
- Origin validation for all storage access
scheme://host:port
Examples:
https://example.com(port 443 implied)https://example.com:8080(explicit port)http://localhost:3000
Cross-Origin Access: BLOCKED
// Page: https://example.com
localStorage.setItem('token', 'secret'); // ✅ Stored for example.com
// Page: https://attacker.com
localStorage.getItem('token'); // ❌ BLOCKED - Cannot access example.com's storage- Could access internal networks (localhost, 192.168.x.x, etc.)
- No IP filtering
- DNS rebinding possible
- IP Range Blocking (hard-coded, cannot be overridden)
- DNS Resolution before request
- Scheme Whitelist (http, https only)
IPv4:
127.0.0.0/8- Localhost10.0.0.0/8- Private172.16.0.0/12- Private192.168.0.0/16- Private169.254.0.0/16- Link-local (AWS metadata)224.0.0.0/4- Multicast
IPv6:
::1/128- Localhostfc00::/7- Unique local addressesfe80::/10- Link-local
Blocked Requests:
http://localhost # ❌ BLOCKED
http://127.0.0.1 # ❌ BLOCKED
http://192.168.1.1 # ❌ BLOCKED
http://10.0.0.1 # ❌ BLOCKED
http://169.254.169.254 # ❌ BLOCKED (AWS metadata)
file:///etc/passwd # ❌ BLOCKED (scheme not allowed)
ftp://example.com # ❌ BLOCKED (scheme not allowed)Allowed Requests:
https://example.com # ✅ ALLOWED (public IP)
http://api.github.com # ✅ ALLOWED (public IP)No Configuration Options: SSRF protection is always enabled and cannot be disabled.
- Default: Disabled
- Reason: Prevents IP address leaks
- Configuration: None (hard-disabled)
- Scope restrictions enforced
- Cannot intercept requests outside registered scope
- Scripts validated before registration
- Socket paths include random UUIDs (not predictable)
- Proper file permissions (0600)
- Temp directories created securely
The following headers are set automatically:
Strict-Transport-Security: max-age=31536000X-Content-Type-Options: nosniffX-Frame-Options: SAMEORIGINReferrer-Policy: strict-origin-when-cross-origin
- HTTPS pages cannot load HTTP resources (hard block)
# REQUIRED: Master password for credential encryption
export THALORA_MASTER_PASSWORD="your-strong-password-32-chars-minimum!"None - All security features are hard-coded and cannot be disabled.
Security events are logged to stderr:
# Enable security debug logging
export RUST_LOG=thalora=debugExample logs:
🔒 SECURITY: JavaScript validation failed: eval() is not allowed
🔒 SECURITY: Access to 127.0.0.1 is blocked (private IP range)
✅ Local Attackers
- Cannot decrypt stored credentials (AES-256-GCM)
- Cannot execute arbitrary code (JavaScript validation)
✅ Network Attackers
- Cannot intercept HTTPS traffic (TLS enforced)
- Cannot perform SSRF attacks (IP filtering)
- Cannot bypass CORS (enforced)
✅ Malicious Websites
- Cannot steal cross-origin data (Same-Origin Policy)
- Cannot execute dangerous JavaScript (AST validation)
- Cannot access internal networks (SSRF prevention)
✅ Prototype Pollution
__proto__access blockedconstructor.constructorblocked
✅ XSS Attacks
eval()blockeddocument.writeblocked- CSP enforced
❌ Compromised Master Password
- If attacker obtains
THALORA_MASTER_PASSWORD, credentials can be decrypted - Mitigation: Use strong password (32+ chars), store securely
❌ Physical Access
- If attacker has root access to machine, they can extract master password from environment
- Mitigation: Use OS-level security, encrypt home directory
❌ Malicious AI Models
- If AI model itself is compromised, it can abuse browser capabilities
- Mitigation: Only use trusted AI models
If you discover a security vulnerability in Thalora, please report it to:
Email: security@brainwires.com
What to include:
- Description of the vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if any)
Response Time: We aim to respond within 48 hours.
Disclosure Policy: We follow responsible disclosure. Please allow us 90 days to fix the issue before public disclosure.
| Date | Auditor | Scope | Findings | Status |
|---|---|---|---|---|
| 2025-11-07 | Internal Security | Full codebase | 10 Critical/High issues | FIXED |
-
Set a strong master password (32+ characters, random)
# Good export THALORA_MASTER_PASSWORD="$(openssl rand -base64 32)" # Bad export THALORA_MASTER_PASSWORD="password123" # Too weak!
-
Protect your environment variables
# Add to ~/.bashrc or ~/.zshrc export THALORA_MASTER_PASSWORD="your-strong-password" # Set proper permissions chmod 600 ~/.bashrc
-
Use HTTPS whenever possible
-
Regularly rotate master password (every 90 days recommended)
-
Enable debug logging to monitor security events
export RUST_LOG=thalora=debug
- Never disable security features in production
- Always validate user input
- Use secure defaults (all security features enabled)
- Log security events for audit trail
- Keep dependencies updated
- Run security tests before each release:
cargo test --test security_tests
Thalora implements security controls aligned with:
-
OWASP Top 10 (2021)
- A01: Broken Access Control ✅ FIXED
- A02: Cryptographic Failures ✅ FIXED
- A03: Injection ✅ FIXED (JavaScript validation)
- A07: Identification and Authentication Failures ✅ FIXED
- A10: Server-Side Request Forgery ✅ FIXED
-
CWE Top 25 Most Dangerous Software Weaknesses
- CWE-79: Cross-site Scripting ✅ PROTECTED
- CWE-89: SQL Injection ✅ N/A (no SQL)
- CWE-798: Use of Hard-coded Credentials ✅ FIXED
- CWE-918: Server-Side Request Forgery ✅ FIXED
Breaking Changes:
- Master password (32+ chars) now required
- Legacy XOR-encrypted credentials will not decrypt
- Dangerous JavaScript operations now blocked (no bypass)
Security Fixes:
- [CRITICAL] Replaced XOR with AES-256-GCM encryption
- [HIGH] Implemented AST-based JavaScript validation
- [HIGH] Added origin-based storage isolation
- [MEDIUM] Implemented SSRF prevention
- [LOW] Disabled WebRTC by default
- [LOW] Randomized socket paths
New Security Features:
- Argon2id key derivation
- Authenticated encryption with AES-256-GCM
- Same-Origin Policy enforcement
- IP range filtering
- CSP enforcement
- CORS validation
- Security headers
Migration Guide: See "Migration from Legacy Format" above.
This security policy is part of the Thalora project and is licensed under the MIT License.