Download SECURITY.md from Snapkitty/assertica: direct link, hf CLI and curl.
- Browser
- Download file 18.2 kB
-
https://huggingface.co/Snapkitty/assertica/resolve/main/SECURITY.md
- Command line
-
hf download hf://Snapkitty/assertica/SECURITY.md
-
curl -L -o SECURITY.md https://huggingface.co/Snapkitty/assertica/resolve/main/SECURITY.md
Security Policy for Assertica
Assertica is a formal verification tool designed for mathematical certainty in proof checking. This document outlines the security model, threat analysis, and vulnerability reporting process.
Table of Contents
- Security Model
- Threat Analysis
- Scope of Guarantees
- Trust Boundary
- Known Limitations
- Vulnerability Reporting
- Incident Response
- Audit & Certification
Security Model
Design Philosophy
Assertica's security model prioritizes verification correctness over cryptographic security. The system is designed to ensure:
- Proof Integrity: Every mathematical claim must have explicit proof
- Deterministic Verification: Same input always produces identical result
- Fail-Closed Semantics: Unknown claims are rejected, never silently accepted
- Auditable Kernel: Small, reviewable trusted core (243 lines)
- No Hidden Reasoning: All inference is explicit and traceable
Security vs. Cryptography
This is NOT a cryptographic system. It does not provide:
- Encryption or decryption
- Digital signatures
- Key management
- Confidentiality guarantees
- Authentication protocols
This IS a formal verification system providing:
- Proof verification guarantees
- Deterministic computation
- Rejection of unproven claims
- Explicit reasoning traces
Threat Analysis
Protected Against
1. Silent Acceptance of Unproven Claims
Threat: Verification accepts proof when no valid proof exists.
Mitigation:
- Proof Checker module (Proof Checker) implements deterministic verification
- All proof primitives have explicit checking logic
- Unknown proofs are rejected (fail-closed)
- Negative tests verify rejection paths
- Property tests confirm determinism
Risk Level: CRITICAL | Mitigation: STRONG
2. Nondeterministic Verification Results
Threat: Same proof submitted twice produces different results (accept/reject).
Mitigation:
- Property tests:
β proof. verify(proof) = verify(proof)always holds - No random number generation
- No hash-based data structures (deterministic ordering)
- Sequential execution (no concurrency)
- Determinism verified by 80+ property tests
Risk Level: CRITICAL | Mitigation: STRONG
3. Hidden Algebraic Axiom Invocation
Threat: Equality checker secretly assumes commutativity/associativity without proof.
Mitigation:
- Negative tests explicitly verify rejection of:
- Assumed commutativity: a + b β b + a (without proof)
- Assumed associativity: (a + b) + c β a + (b + c) (without proof)
- Assumed distributivity: a * (b + c) β ab + ac (without proof)
- Kernel only checks Ξ²-reduction, Ξ±-equivalence, Ξ·-conversion
- No axiom database
- Complete equality checker source (243 lines) is auditable
Risk Level: CRITICAL | Mitigation: STRONG
4. Infinite Recursion in Verification
Threat: Malformed proof or program causes verification to hang.
Mitigation:
- Termination/Positivity module (Termination Checker) validates all recursion is structurally decreasing
- Beta reduction on non-terminating definitions fails termination check
- Module system detects circular dependencies
- No infinite loops possible in verified programs
Risk Level: HIGH | Mitigation: STRONG
5. Logical Inconsistency from Impredicative Types
Threat: Type system admits Girard's paradox, making system inconsistent.
Mitigation:
- Termination/Positivity module (Positivity Checker) validates inductive types are strictly positive
- Type constructor arguments checked for polarity
- Negative positions in function domains cause rejection
- Prevents impredicative type definitions
- Type universe hierarchy enforces stratification
Risk Level: HIGH | Mitigation: STRONG
6. Circular Module Dependencies
Threat: Circular imports create inconsistent state or infinite loops.
Mitigation:
- Module System module (Module System) performs circular dependency detection
- Topological sorting ensures loading order
- Rejects programs with circular dependencies
- Module environment tracks visited modules
- Prevents initialization cycles
Risk Level: MEDIUM | Mitigation: STRONG
7. Code Generation Producing Unsafe Output
Threat: Generated Haskell code uses unsafe operations (unsafeCoerce, etc.).
Mitigation:
- Code Generator module (Backend) generates only safe Haskell constructs
- No
unsafeCoerce,unsafePerformIO,unsafeDupablePerformIO - Generated code passes GHC type checker
- Generated code uses only safe library functions
- Code generation reviewed in CI
Risk Level: MEDIUM | Mitigation: STRONG
8. Type Confusion via Proof Injection
Threat: Proof term for type A is used to justify claim of type B.
Mitigation:
- Proof Checker module checks proof against specific proposition
- Proof type must match claimed property
- Type environment (Type Checker module) tracks binding contexts
- Mismatch causes rejection
Risk Level: MEDIUM | Mitigation: STRONG
Not Protected Against
1. Malicious Hardware
Threat: CPU, memory, or storage deliberately corrupted.
Status: OUT OF SCOPE | This is a property of the execution environment, not the compiler.
Mitigation: Use trusted hardware. Run on air-gapped systems if paranoia warrants.
2. Side-Channel Attacks
Threat: Timing analysis, cache analysis, or power analysis reveals secrets.
Status: OUT OF SCOPE | Assertica is not a cryptographic system.
3. Compiler Bugs in GHC
Threat: GHC (Haskell compiler) has bug that miscompiles Assertica.
Status: OUT OF SCOPE | Assuming trustworthy compiler toolchain.
Mitigation: Use verified version of GHC. Build on reproducible system (Nix, Docker).
4. Denial of Service via Resource Exhaustion
Threat: Malformed input causes excessive memory or CPU use.
Status: PARTIALLY MITIGATED
Mitigation:
- Termination checker prevents non-terminating recursion
- Parse error recovery prevents unbounded parsing
- Type checking bounded by program size
- Resource limits at OS level recommended
5. Unintended Proof Acceptance (Logic Errors)
Threat: Proof checker has bug that accepts invalid proof.
Status: MITIGATED VIA REVIEW | Kernel designed for auditability (243 lines).
Mitigation: Regular security audits. External review of kernel logic.
Scope of Guarantees
What Assertica Guarantees
If Assertica accepts a proof, then:
- The proof is structurally valid: All proof terms type-check against their propositions
- No hidden axioms invoked: Only Ξ², Ξ±, Ξ· reductions applied
- Verification is deterministic: Identical input β identical output
- All reasoning is explicit: Every inference is traceable
What Assertica Does NOT Guarantee
- Correctness of user-supplied axioms: If user declares
axiom contradiction : False, Assertica accepts it. Users are responsible for axiom correctness. - Performance: Verification may be slow for large proofs. No performance SLA.
- Availability: No guarantees on build time, resource requirements, or uptime.
- Compatibility: Assertica versions may not be forward/backward compatible. Pin versions.
Limitations of Formal Verification
Only Proofs About Models: Assertica proves properties of abstract specifications. Real systems have:
- Implementation bugs
- Compiler bugs
- Hardware faults
- Network failures
Assumptions Can Be Wrong: Proof depends on premises. If premises are false, conclusion is meaningless.
Incomplete Coverage: Proof of Property P doesn't prove absence of other bad Property Q.
Trust Boundary
Trusted Component (TCB - Trusted Computing Base)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β TRUSTED COMPUTING BASE (TCB) β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Equality Kernel module: Equality Kernel (243 lines) β β
β β β’ Beta reduction logic β β
β β β’ Alpha equivalence check β β
β β β’ Eta conversion β β
β β β’ Normalization β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Proof Checker module: Proof Checker Core (200 lines approx) β β
β β β’ Pattern matching on proof primitives β β
β β β’ Proof type checking β β
β β β’ Refl, Symm, Trans verification β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β TOTAL TCB: ~450 lines of Haskell β
β Audit Time: ~3 hours for expert review β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Outside Trusted Boundary (Verified Against TCB)
- Parser (subject to misparse risk, but caught by elaborator)
- Type checker (subject to bugs, but proofs must be valid regardless)
- Module system (subject to bugs, but circular dependencies caught)
- Code generator (outputs to GHC, which verifies)
Attack Surface
| Component | Risk | Mitigation |
|---|---|---|
| TCB kernel (450 lines) | CRITICAL | 100% test coverage, multiple reviews |
| Parser (836 lines) | MEDIUM | Error recovery, type checking |
| Type system (1,099 lines) | MEDIUM | Proof checking gates acceptance |
| Module system (766 lines) | LOW | Circular dependency detection |
| Code generator (1,507 lines) | LOW | GHC re-verifies output |
| Testing infrastructure | LOW | Test generation not exposed |
Known Limitations
1. No Proof of Implementation Correctness
Assertica verifies specifications are consistent. It does not verify implementations of Assertica itself.
Implication: There could be a bug in the type checker that causes it to accept invalid programs. But proofs must still be valid by the proof checker.
Mitigation: Keep TCB small (450 lines). Have external review.
2. User Axioms Are Trusted
If a user declares:
axiom my_axiom : P
Assertica trusts it. Proof of P is not required. This is intentional (allows building on prior work), but means axioms are attack surface.
Mitigation: Audit axioms carefully. Use only well-known axioms from literature.
3. Termination Checking is Conservative
Termination checker requires structural recursion (provably terminating by structural argument). Some terminating programs are rejected.
Example (Rejected):
ackermann : Nat β Nat β Nat
ackermann 0 n = n + 1
ackermann (S m) 0 = ackermann m 1
ackermann (S m) (S n) = ackermann m (ackermann (S m) n)
This is intentional: Fail-closed. False positives (rejection of valid) are safer than false negatives (acceptance of non-terminating).
4. Performance Not Guaranteed
Verification of large proofs may be slow. No SLA. Example timings:
- 1 KB program: ~100 ms
- 100 KB program: ~500 ms
- 1 MB program: ~2 seconds
- Very large programs: may time out
Mitigation: Break large proofs into modules. Use proof caching.
5. No Cryptographic Security
Assertica does not provide:
- Confidentiality (no encryption)
- Integrity protection (no signatures)
- Authentication (no proof of identity)
- Non-repudiation
Implication: Do not use Assertica for security-critical decisions (authentication, authorization, key management).
Vulnerability Reporting
Reporting Process
DO NOT open public issues for security vulnerabilities.
Instead, report to: security@example.com (placeholder - use actual email)
Email template:
Subject: [SECURITY] Vulnerability in Assertica [component] [type]
Description:
Clear description of vulnerability
Impact:
What is affected? How severe?
Reproduction:
Steps to reproduce (include code sample if applicable)
Suggested Fix (optional):
If you have a proposed fix
Your Information:
Your name (will be credited if you wish)
Preferred contact method
Response Timeline
| Stage | Timeline |
|---|---|
| Initial acknowledgment | 24 hours |
| Vulnerability assessment | 5 business days |
| Fix development | 7-14 days |
| Security review of fix | 3-7 days |
| Patch release | Within 30 days of report |
| Public disclosure | After patch is available |
Vulnerability Scoring
Vulnerabilities are scored using CVSS 3.1:
| CVSS Score | Category | Example |
|---|---|---|
| 9.0-10.0 | CRITICAL | Proof checker accepts invalid proofs |
| 7.0-8.9 | HIGH | Nondeterministic verification results |
| 4.0-6.9 | MEDIUM | Denial of service via resource exhaustion |
| 0.1-3.9 | LOW | Performance regression, non-critical bug |
Embargo Period
- CRITICAL, HIGH: 30-day embargo (time to patch before disclosure)
- MEDIUM: 14-day embargo
- LOW: No embargo (can disclose immediately)
Researcher Credit
- Security researchers are credited by name (with permission)
- Listed in release notes
- Eligible for research collaboration opportunities
Incident Response
Security Incident Definition
A security incident is:
- Reported vulnerability with CVSS >= 4.0
- Confirmed bug in TCB (Equality Kernel module, Proof Checker module core)
- Evidence of vulnerability being exploited
- Bug that violates stated guarantees
Response Phases
Phase 1: Confirmation (0-3 days)
- Verify vulnerability is real
- Determine scope and severity
- Notify affected users (if any)
- Create security patch branch
Phase 2: Remediation (3-7 days)
- Develop fix
- Security review of fix
- Add regression tests
- Full test suite passes
- Code review by 2+ people
Phase 3: Release (7-14 days)
- Release patch version
- Tag as security release
- Publish security advisory
- Credit researcher (with permission)
- Post-incident analysis
Phase 4: Follow-up (Post-release)
- Monitor for related issues
- Improve test coverage to prevent recurrence
- Document lessons learned
- Update security guidelines if needed
Post-Incident Analysis
After every security incident:
- Root cause analysis
- Prevention strategies
- Detection improvements
- Process updates
- Team debrief
Audit & Certification
Self-Audit Checklist
Run this checklist quarterly:
- All 768+ tests pass
- Code coverage >95% (TCB 100%)
- No compiler warnings (cabal build)
- Determinism property tests pass
- Fail-closed behavior verified
- No new dependencies on external solvers
- Kernel unchanged (Equality Kernel module, 2B core)
- Security policy up to date
- No open security issues
External Audit Recommendations
Recommended for:
- Organizations using Assertica in safety-critical contexts
- Institutions adopting Assertica for research
Audit Scope:
- Code review of TCB (Equality Kernel module, Proof Checker module) - ~450 lines
- Test coverage verification (>95%)
- Determinism verification (run tests 1000x)
- Threat model assessment
- Dependency analysis
- Supply chain review
Estimated Effort: 40-60 person-hours
Certification Bodies: Currently self-certified. Third-party certification available upon request.
Supply Chain Security
Dependencies
Assertica's dependencies are:
- GHC: Haskell compiler (trusted)
- Cabal: Build system (trusted)
- Standard library modules: Data.Set, Data.Map, etc. (Haskell standard library)
No external theorem provers. No SMT solvers. No experimental libraries.
Build Integrity
Reproducible builds:
# Same source always produces identical binary
nix build
# Verify hash
nix build --out-link result
sha256sum result
Vendor Lock-in Resistance
Assertica is:
- Open source (Boost Software License 1.0)
- Self-contained (no proprietary dependencies)
- Portable (runs on any system with GHC 9.2+)
- Forkable (easy to fork if needed)
Security Contact
For vulnerability reports:
- Email: security@example.com (placeholder)
- PGP Key: [public key URL]
- Response time: 24 hours acknowledged, 5 days assessment
For general security questions:
- GitHub Discussions (public)
- security-questions@example.com (private)
References
Formal Methods Standards
- IEEE Std 1012-2017: Software Verification and Validation
- IEC 61508: Functional Safety
Proof Theory References
- "Lectures on the Curry-Howard Isomorphism" (Sorensen & Urzyczyn)
- "Type Theory and Formal Proof" (Nederpelt & Geuvers)
- "Proofs and Types" (Girard, Taylor, Lafont)
Formal Verification in Practice
- Coq proof assistant documentation
- Agda documentation
- Lean 4 documentation
Last Updated: 2026-10-03 Version: 1.0.0 Policy Effective Date: 2026-10-03 Next Review Date: 2027-10-03