Security
Locale Lending implements a layered security model spanning user, application, smart contract, and data layers.
Security Architecture
Security Layers
Application Security
Input validationRate limitingAccess control
Smart Contract Security
Audited contractsReentrancy guardsPausable
Protocol Security
Multi-sig adminTimelockEmergency stop
Cryptographic Layer
ZK ProofszkTLS AttestationsTEE Verification
Smart Contract Security
Audit Status
Audits Pending
Smart contract audits are in progress. This section will be updated with audit reports upon completion.
| Contract | Auditor | Status |
|---|---|---|
| StakingPool | TBD | Pending |
| SimpleLoanPool | TBD | Pending |
| BorrowerCredential | TBD | Pending |
| InvestorCredential | TBD | Pending |
| ProofVerifier | TBD | Pending |
Security Patterns
UUPS Upgradeable Proxy
All contracts use the Universal Upgradeable Proxy Standard:
| Feature | Description |
|---|---|
| Upgrade Authorization | Only DEFAULT_ADMIN_ROLE can upgrade |
| Timelock Protection | Planned delay on upgrades |
| Gas Efficient | Minimal proxy overhead |
Benefits:
- Bug fixes without migration
- Gas-efficient proxy pattern
- Upgrade authorization controls
Reentrancy Protection
All fund-handling functions are protected with OpenZeppelin's ReentrancyGuard modifier:
| Protected Functions | Description |
|---|---|
| stake | Deposit funds into pools |
| withdraw | Withdraw funds from pools |
| disburse | Loan disbursement |
| repay | Loan repayment |
Role-Based Access Control
| Role | Permissions |
|---|---|
| DEFAULT_ADMIN_ROLE | Full administrative access |
| POOL_ADMIN_ROLE | Pool configuration |
| MINTER_ROLE | Credential minting |
| REVOKER_ROLE | Credential revocation |
| PAUSER_ROLE | Emergency pause |
Emergency Pause
Critical contracts can be paused in emergencies:
| Action | Required Role |
|---|---|
| Pause | PAUSER_ROLE (any of 5 guardians) |
| Unpause | DEFAULT_ADMIN_ROLE |
Known Limitations
| Limitation | Planned Mitigation |
|---|---|
| Centralized Admin Keys | Multi-signature governance |
| Upgradeable Contracts | Timelock on upgrades |
Application Security
Authentication
- Wallet-Based — Web3 wallet signatures
- JWT Tokens — 1-hour expiry
- Refresh Tokens — Extended sessions
- httpOnly Cookies — XSS protection
- CSRF Protection — Token validation
API Protection
| Protection | Implementation |
|---|---|
| Rate Limiting | 100-1000 req/min by endpoint type |
| Input Validation | Zod schema validation |
| SQL Injection | Prisma parameterized queries |
| XSS | Content Security Policy |
Webhook Security
- Signature Verification — Plaid webhook signatures
- Secret Tokens — Automated task authentication
- IP Allowlisting — Trusted sources only
Data Security
Encryption
| Data Type | Protection |
|---|---|
| Plaid Tokens | AES-256 at rest |
| API Keys | AWS KMS |
| Transit | TLS 1.3 |
Privacy Principles
What we store:
- Hashed commitments
- Zero-knowledge proofs
- Verification status
What we never store:
- Raw financial data
- Personal documents
- Bank credentials
Operational Security
Multi-Signature Requirements
| Action | Required Signatures |
|---|---|
| Contract Upgrades | 3 of 5 |
| Admin Role Grants | 2 of 3 |
| Parameter Changes | 2 of 3 |
| Emergency Pause | 1 of 5 (any) |
Key Management
- Hardware wallets for admin keys
- 90-day API key rotation
- AWS KMS for secrets
Monitoring
- Real-time transaction monitoring
- Anomaly detection
- Alert escalation procedures
Bug Bounty Program
Locale operates a bug bounty program for responsible disclosure:
| Severity | Reward |
|---|---|
| Critical | Up to $50,000 |
| High | Up to $20,000 |
| Medium | Up to $5,000 |
| Low | Up to $1,000 |
Scope
In scope:
- Smart contracts
- API endpoints
- Frontend application
- Authentication flows
Out of scope:
- Social engineering
- DoS attacks
- Third-party services
Reporting
- Email: security@locale.cash
- Response: 24-hour acknowledgment
- Assessment: 72-hour initial review
Incident Response
Response Timeline
| Phase | Timeline |
|---|---|
| Detection | Automated + manual monitoring |
| Triage | < 1 hour |
| Containment | < 4 hours |
| Resolution | Depends on severity |
| Post-mortem | Within 7 days |
Communication
- User notification for data breaches
- Public disclosure after resolution
- Regular security updates
Next Steps
- Verification — How verification works
- Smart Contracts — Contract details
- FAQs — Common questions