Documentation
Why Validation Matters: Protecting Your Network and Privacy
For Everyone: This document explains why our validation system is essential for keeping your network safe and your data private. Written for both technical users and non-technical users.
Table of Contents
- Quick Start: What You Need to Know
- The Simple Explanation
- The Real-World Risks
- How Validation Protects You
- For Technical Users
- Frequently Asked Questions
Quick Start: What You Need to Know
β±οΈ 30 seconds: Here's everything you need to know about validation:
β Validation is automatic - You don't need to do anything special β Validation is fast - Adds less than 100ms to compilation β Validation is mandatory - For your protection, it cannot be disabled (except in testing mode) β Validation prevents attacks - Stops malicious lists, tampering, and man-in-the-middle attacks β Validation gives you control - You're alerted if anything changes, and you decide whether to trust it
In short: Validation works silently in the background to keep you safe. You get all the benefits with none of the hassle.
Want to learn more? Keep reading below. β¬οΈ
The Simple Explanation
Think of filter lists like a security guard's "do not allow" list for your internet connection. These lists tell your ad-blocker or DNS service which websites and trackers to block.
The Problem: What if someone sneaks malicious entries onto that list?
The Solution: Our validation system acts as a verification checkpoint, ensuring:
- β Lists come from trusted sources only
- β Lists haven't been tampered with
- β Lists don't contain malicious entries
- β Everything is exactly what you intended to use
Why This Matters to You
When you use ad-blocking or DNS filtering, you're trusting these lists to protect your network. Without validation:
- Someone could redirect you to fake banking sites
- Malware could be installed on your devices
- Your personal data could be stolen
- Your network could be taken over
With validation, you're protected automatically.
The Real-World Risks
π¨ Risk #1: Man-in-the-Middle Attacks
What is it? Someone intercepts the filter list while you're downloading it and replaces it with a malicious version.
Real example: You try to download a popular ad-blocking list, but an attacker intercepts the download and sends you a modified list that:
- Unblocks ads from their paid sponsors
- Redirects banking sites to fake lookalikes
- Adds malware-distributing sites to your "allowed" list
How validation prevents this:
- β Every downloaded list must match a known fingerprint (hash)
- β If even 1 character is changed, validation fails immediately
- β You get an error instead of using a compromised list
π¨ Risk #2: Compromised Sources
What is it? The website hosting the filter list gets hacked, and attackers replace the legitimate list with a malicious one.
Real example: A popular filter list website gets hacked. The attackers replace the list with one that:
- Blocks access to security warning sites
- Allows phishing domains
- Redirects users to malware
How validation prevents this:
- β We store fingerprints of known-good versions
- β If the list changes unexpectedly, you're alerted
- β You decide whether to trust the new version or not
π¨ Risk #3: Local File Tampering
What is it? Malware on your computer modifies your local filter lists.
Real example: Malware infects your computer and:
- Removes its own domains from your blocklists
- Adds legitimate security tools to the blocklist
- Modifies entries to create backdoors
How validation prevents this:
- β We track the fingerprint of every file on your system
- β Before each use, we verify files haven't changed
- β If tampering is detected, compilation stops
π¨ Risk #4: Typosquatting & Fake Lists
What is it? Attackers create fake lists with names similar to trusted lists.
Real example:
- Real list:
https://easylist.to/easylist/easylist.txt - Fake list:
https://easy1ist.to/easylist/easylist.txt(note the "1" instead of "l")
How validation prevents this:
- β Only HTTPS URLs are allowed (no insecure HTTP)
- β Domain names are verified via DNS
- β Content is scanned to ensure it's actually a filter list
- β URLs are checked against known malicious domains
How Validation Protects You
Our validation system provides 5 layers of protection:
π‘οΈ Layer 1: HTTPS-Only Enforcement
What it does: Only allows secure downloads (HTTPS), blocks insecure HTTP.
Why it matters: HTTP connections can be intercepted and modified. HTTPS encrypts the connection, making interception nearly impossible.
User impact: You can only use lists from secure sources. This is a feature, not a limitation.
π‘οΈ Layer 2: Domain Verification
What it does: Checks that the domain hosting the list is legitimate and resolvable.
Why it matters: Prevents typosquatting attacks and ensures the domain actually exists.
User impact: Typos in URLs will be caught before download, preventing accidents.
π‘οΈ Layer 3: Content Validation
What it does: Scans downloaded content to ensure it's actually a filter list, not malware or a fake page.
Why it matters: Even if someone redirects a valid URL, we verify the content is what we expect.
User impact: Accidental downloads of HTML pages or malware are prevented.
π‘οΈ Layer 4: Cryptographic Fingerprinting (Hashing)
What it does: Creates a unique "fingerprint" (SHA-384 hash) for every file and URL.
Why it matters: Even changing a single character creates a completely different fingerprint, making tampering impossible to hide.
How it works:
Original file: "||example.com^"
Fingerprint: "abc123def456..." (96 characters)
Tampered file: "||examp1e.com^" (changed "l" to "1")
Fingerprint: "xyz789uvw321..." (completely different!)
User impact: Automatic tamper detection with mathematical certainty.
π‘οΈ Layer 5: Audit Trail
What it does: Keeps a record of what was validated, when, and by which version of the validator.
Why it matters: If something goes wrong, you can trace exactly what happened.
User impact: Full transparency and accountability.
For Technical Users
Security Features Overview
| Feature | Purpose | Attack Prevention |
|---|---|---|
| SHA-384 Hashing | Cryptographic fingerprinting | MITM, tampering, corruption |
| HTTPS Enforcement | Encrypted transport only | MITM, eavesdropping |
| DNS Validation | Domain legitimacy check | Typosquatting, DNS hijacking |
| Content-Type Verification | Ensure text/plain response | Malware downloads, HTML injection |
| Syntax Validation | Verify filter rule format | Malformed rules, injection attacks |
| File Size Limits | Prevent resource exhaustion | DoS attacks, zip bombs |
| Hash Database | Track known-good versions | Version rollback attacks |
| Cryptographic Signatures | Proof of validation | Metadata forgery |
| Strict Mode | Fail on any anomaly | Zero-trust security posture |
Why SHA-384?
SHA-384 was chosen over SHA-256 for enhanced security:
- Collision resistance: ~2^192 operations required to find collision (vs 2^128 for SHA-256)
- Pre-image resistance: Impossible to reverse-engineer original content from hash
- Avalanche effect: Single bit change causes 50% of hash bits to flip
- FIPS 180-4 compliant: Approved by NIST for cryptographic use
- Performance: Fast enough for real-time validation (<1ms per file)
Hash Verification Modes
Strict Mode (Production Recommended)
{
"hashVerification": {
"mode": "strict",
"requireHashesForRemote": true,
"failOnMismatch": true
}
}
- Behavior: Any hash mismatch fails compilation immediately
- Use case: Production environments, critical infrastructure
- Security: Maximum protection, zero tolerance for anomalies
Warning Mode (Development Default)
{
"hashVerification": {
"mode": "warning",
"requireHashesForRemote": false,
"failOnMismatch": false
}
}
- Behavior: Hash mismatches generate warnings but allow compilation
- Use case: Development, testing, exploring new lists
- Security: Provides visibility without blocking workflow
Disabled Mode (Testing Only)
{
"hashVerification": {
"mode": "disabled"
}
}
- Behavior: No hash verification performed
- Use case: Offline testing, CI/CD pipeline debugging
- Security: β οΈ NOT RECOMMENDED FOR PRODUCTION
Attack Scenarios & Mitigations
Scenario 1: MITM with Certificate Validation Bypass
Attack: Attacker compromises network and installs rogue CA certificate to decrypt HTTPS.
Mitigation:
- HTTPS provides transport security
- Hash verification provides content authenticity
- Even if HTTPS is compromised, hash mismatch detected
- Compilation fails, user alerted
Result: β Attack prevented
Scenario 2: Compromised Repository
Attack: Attacker gains access to filter list repository and pushes malicious update.
Mitigation:
- Hash database tracks known-good versions
- New version has different hash
- Strict mode requires manual hash approval
- User reviews changes before accepting
Result: β Attack prevented (with user awareness)
Scenario 3: Local Malware Modification
Attack: Malware modifies local filter files to remove its own domains.
Mitigation:
- At-rest hash verification checks files before each compilation
- Hash mismatch detected immediately
- Compilation aborted
- User alerted to file modification
Result: β Attack prevented
Scenario 4: Metadata Forgery
Attack: Attacker tries to bypass validation by forging ValidationMetadata.
Mitigation:
- Metadata includes cryptographic signature
- Signature formula:
SHA-384(timestamp:local_count:remote_count:version:strict_mode) - Cannot be forged without knowing exact validation details
- Verification function detects invalid signatures
Result: β Attack prevented
Threat Model
Assumptions:
- β User's operating system is trusted
- β Rust validation library is trusted
- β SHA-384 cryptographic properties hold
- β οΈ User may click through warnings (user education critical)
- β οΈ Filter list sources may be compromised
Out of Scope:
- Root-level OS compromise (game over scenario)
- Quantum computing attacks on SHA-384 (decades away)
- Social engineering to disable validation (user education)
- Physical access to hardware (physical security domain)
Frequently Asked Questions
Q: Do I have to use validation?
A: Yes, for your own safety.
The validation system is mandatory by design. This isn't to restrict youβit's to protect you from attacks you may not even know exist.
Think of it like seatbelts in a car: they're mandatory because they save lives, even if most drives are uneventful.
Q: What if I trust the source and want to skip validation?
A: You can use "warning mode" for development, but we strongly recommend "strict mode" for production.
If you absolutely trust a source and want to bypass warnings:
- Switch to
"mode": "warning"in your config - Review the warnings carefully
- If everything looks safe, update your hash database
- Switch back to
"mode": "strict"for ongoing protection
Never use "mode": "disabled" for production use.
Q: Will validation slow down my compilation?
A: No. Validation adds less than 100 milliseconds to compilation time.
Performance benchmarks:
- SHA-384 hash computation: ~0.5ms per file
- URL validation: ~10ms (DNS lookup)
- Syntax validation: ~5ms per file
- Total overhead: <100ms for typical compilation
This is negligible compared to:
- Downloading remote lists: 500ms - 5000ms
- Compilation: 1000ms - 10000ms
- Total time saved by catching issues early: immeasurable
Q: What if a legitimate list gets updated and validation fails?
A: This is a feature, not a bug.
When a list is legitimately updated:
- Validation detects the change (hash mismatch)
- In strict mode: Compilation fails with clear message
- You review the change (what was added/removed?)
- If legitimate: Update your hash database
- Compilation proceeds with new hash
This gives you visibility and control over what enters your network.
Q: Can I use lists that don't provide hashes?
A: Yes, but with a warning.
In warning mode (default for development):
- Lists without hashes are allowed
- You'll get a warning about missing verification
- The first compilation creates a hash for future verification
In strict mode (recommended for production):
- Lists without hashes are rejected
- You must manually add the hash to proceed
- This ensures every source is verified
Q: What happens if validation detects a problem?
A: Compilation stops immediately, and you get a detailed error message.
Example error:
β Validation Error: Hash mismatch detected
File: data/input/custom-rules.txt
Expected: abc123def456...
Actual: xyz789uvw321...
This file has been modified since last validation.
Possible causes:
- File was edited manually
- Malware modified the file
- File corruption
Action required:
1. Review changes to the file
2. If changes are legitimate, update hash database
3. If changes are suspicious, restore from backup
Q: How do I know validation is actually running?
A: Multiple ways:
-
Validation metadata in output:
{ "validation_metadata": { "validation_timestamp": "2024-12-27T10:30:00Z", "local_files_validated": 5, "remote_urls_validated": 3, "hash_database_entries": 8, "validation_library_version": "1.0.0", "signature": "abc123..." } } -
CI/CD enforcement: GitHub Actions workflow fails if validation is bypassed
-
Verification function:
verify_compilation_was_validated(result); // Throws if validation missing -
Audit logs: All validations are logged with timestamps
Q: Is validation overkill for personal use?
A: No. Attacks don't discriminate by network size.
Threats don't care if you're:
- A home user with one device
- A small business with 10 computers
- An enterprise with 10,000 endpoints
The same attack techniques work against everyone. Validation protects you equally.
Q: Can I contribute to improving validation?
A: Absolutely! We welcome contributions.
Areas we're always improving:
- Additional hash verification methods
- Faster validation algorithms
- Better error messages
- More comprehensive threat detection
- Easier configuration
See CONTRIBUTING.md for how to get involved.
Summary
Validation is your safety net. It works silently in the background, catching threats before they reach your network.
Key takeaways:
- β Validation is mandatory by design for your protection
- β Adds less than 100ms to compilation time
- β Prevents 6+ types of attacks automatically
- β Provides mathematical certainty with cryptographic hashing
- β Gives you visibility and control over what enters your network
- β Works for everyone: home users to enterprises
Remember: The best security is security you don't have to think about. Validation handles the complexity so you can focus on what mattersβstaying safe online.
Further Reading
- Runtime Enforcement Architecture - How validation is enforced at runtime
- Validation Enforcement - CI/CD enforcement mechanisms
- Configuration Reference - Complete configuration guide
- Security Best Practices - Detailed security documentation
Questions or concerns? Open an issue on GitHub.