A resilient, blockchain-based CVE (Common Vulnerabilities and Exposures) database that ensures continuity of service and community contribution. This system backs up the main CVE database from multiple sources and stores data on a blockchain for immutability and decentralization.
- Blockchain Storage: CVE data stored on an immutable blockchain for tamper-proof records
- Multi-Source Backup: Automatically backs up CVEs from NVD (National Vulnerability Database)
- Community Reporting: Users can report new CVEs directly to the system
- Resilient Design: Decentralized architecture ensures the database stays online
- RESTful API: Easy-to-use API for querying and managing CVE data
- Local Caching: Redundant local storage for additional reliability
- Python 3.7+
- pip (Python package manager)
- Clone the repository:
git clone https://github.com/OWASP-BLT/BLT-CVE.git
cd BLT-CVE- Install dependencies:
pip install -r requirements.txt- Configure environment (optional):
cp .env.example .env
# Edit .env with your NVD API key (optional but recommended for higher rate limits)Start the API server:
python app.pyThe server will start on http://localhost:5000
GET /healthReturns the health status of the system and blockchain validity.
GET /cvesRetrieves all CVEs from the blockchain. Supports filtering:
?severity=HIGH- Filter by severity?source=NVD- Filter by source
GET /cves/<cve_id>Example: GET /cves/CVE-2023-12345
POST /report
Content-Type: application/json
{
"cve_id": "CVE-2024-12345",
"description": "Description of the vulnerability",
"severity": "HIGH",
"cvss_score": 7.5,
"references": [
{"url": "https://example.com/advisory", "source": "vendor"}
],
"reporter": "your_name"
}POST /sync?days=7Fetches recent CVEs from NVD (last 7 days by default) and adds them to pending.
POST /mineMines all pending CVEs into a new block on the blockchain.
GET /search?cve_id=CVE-2023-12345Searches for a CVE in the blockchain and NVD.
GET /blockchainReturns blockchain status and statistics.
- Sync CVEs from NVD:
curl -X POST http://localhost:5000/sync?days=7- Mine them into the blockchain:
curl -X POST http://localhost:5000/mine- Query CVEs:
curl http://localhost:5000/cves- Report a new CVE:
curl -X POST http://localhost:5000/report \
-H "Content-Type: application/json" \
-d '{
"cve_id": "CVE-2024-99999",
"description": "Test vulnerability",
"severity": "MEDIUM",
"reporter": "community_user"
}'- Mine the reported CVE:
curl -X POST http://localhost:5000/mine-
Blockchain (
blockchain.py):- Simple proof-of-work blockchain implementation
- Stores CVE data in immutable blocks
- Validates chain integrity
-
CVE Fetcher (
cve_fetcher.py):- Fetches CVE data from NVD API
- Supports multiple data sources for redundancy
- Local caching for backup
-
API Server (
app.py):- Flask-based REST API
- Endpoints for querying and managing CVEs
- User reporting interface
NVD API β CVE Fetcher β Pending CVEs β Mining β Blockchain
β
User Reports
- Immutability: Once CVEs are mined into the blockchain, they cannot be altered
- Decentralization: Blockchain can be distributed across multiple nodes
- Redundancy: Multiple backup sources and local caching
- Validation: Blockchain integrity is continuously verified
- Community Contribution: Users can report CVEs even if official sources are unavailable
- Difficulty: Configurable proof-of-work difficulty (default: 4)
- Block Structure: Each block contains a batch of CVEs with metadata
- Hash Algorithm: SHA-256
- Persistence: Blockchain saved to JSON file for durability
Environment variables (.env file):
# NVD API Configuration
NVD_API_KEY=your_api_key_here # Get from https://nvd.nist.gov/developers/request-an-api-key
NVD_API_URL=https://services.nvd.nist.gov/rest/json/cves/2.0
# Server Configuration
FLASK_HOST=0.0.0.0
FLASK_PORT=5000
FLASK_DEBUG=False
# Blockchain Configuration
BLOCKCHAIN_DIFFICULTY=4 # Higher = more secure but slowerThis project is licensed under the terms included in the LICENSE file.
Contributions are welcome! This is an OWASP project aimed at ensuring CVE database resilience.
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is part of the OWASP BLT initiative. Visit BLT Website for more information.
- This is a backup/mirror system and should not replace official CVE sources
- Always verify critical CVE information with official sources
- NVD API key is recommended for production use to avoid rate limiting
- The blockchain file can grow large over time; plan for storage accordingly