This document outlines our security policy and how to report vulnerabilities.
We take security seriously. If you discover a security vulnerability, please follow these steps:
- Do not create a public GitHub issue for the vulnerability
- Email us directly at security@calimero.network
- Include detailed information about the vulnerability
- Provide steps to reproduce if possible
- Wait for our response before disclosing publicly
- Initial response: Within 72 hours
- Triage and assessment: Within 1 week
- Fix timeline: Depends on severity and complexity
- Public disclosure: Coordinated with reporter
- Description of the vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if you have one)
- Your contact information
This document also outlines the security measures and configuration options for the Calimero Registry.
- Ed25519 Signature Verification - Cryptographic signature validation
- JSON Canonicalization Scheme (JCS) - Deterministic JSON for signing
- Input Validation - SemVer and public key validation
- CORS Configuration - Cross-origin request protection
- Security Headers - HTTP security headers
- Version immutability - The push API ignores client-supplied
_overwrite; overwrite is only allowed whenALLOW_BUNDLE_OVERWRITEis set server-side (e.g. for migrations).
- npm Audit Integration - Automated vulnerability scanning
- Snyk Security Scanning - Advanced security analysis (optional)
- Regular Updates - Dependency update workflows
# Run security audit
pnpm audit
# Run with specific severity level
pnpm audit --audit-level=moderate
# Generate detailed report
pnpm audit --json > audit-report.json# Install Snyk CLI
npm install -g snyk
# Authenticate with Snyk
snyk auth
# Run security scan
snyk test --severity-threshold=high
# Monitor dependencies
snyk monitorThe basic CI workflow includes:
- npm audit with high severity threshold
- Continues on error to avoid blocking builds
The full CI workflow includes:
- npm audit with detailed reporting
- Snyk security scanning (requires token)
- Vulnerability count checking
- JSON report generation
// Configure in src/config.js
const securityHeaders = {
'X-Content-Type-Options': 'nosniff',
'X-Frame-Options': 'DENY',
'X-XSS-Protection': '1; mode=block',
'Strict-Transport-Security': 'max-age=31536000; includeSubDomains',
'Content-Security-Policy': "default-src 'self'",
};// Configure in src/config.js
const corsConfig = {
origin: process.env.CORS_ORIGIN || 'http://localhost:3000',
credentials: true,
methods: ['GET', 'POST', 'PUT', 'DELETE'],
allowedHeaders: ['Content-Type', 'Authorization'],
};- Create account at snyk.io
- Generate API token
- Add to GitHub repository secrets:
# In GitHub repository settings Settings > Secrets and variables > Actions Add secret: SNYK_TOKEN
Create .snyk file in project root:
version: v1.25.0
ignore:
'npm:package-name@version':
- path/to/vulnerable/file.js:
reason: 'Temporary ignore for development'
expires: 2024-12-31T00:00:00.000Z- Input Validation - Always validate user inputs
- Output Encoding - Encode outputs to prevent XSS
- Error Handling - Don't expose sensitive information in errors
- Authentication - Implement proper authentication (future)
- Authorization - Implement role-based access control (future)
- Regular Updates - Keep dependencies updated
- Security Audits - Run audits regularly
- Vulnerability Monitoring - Monitor for new vulnerabilities
- Minimal Dependencies - Only include necessary packages
- HTTPS Only - Use HTTPS in production
- Security Headers - Implement security headers
- Rate Limiting - Implement rate limiting (future)
- Logging - Secure logging practices
- Monitoring - Security monitoring and alerting
- Run
pnpm auditand fix high/critical vulnerabilities - Review Snyk security report (if configured)
- Check for exposed secrets in code
- Verify CORS configuration
- Test input validation
- Review error messages for sensitive data
- Monitor security logs
- Set up vulnerability alerts
- Regular security audits
- Keep dependencies updated
- Monitor for suspicious activity
// Security event logging
server.log.info({
event: 'security',
type: 'authentication_failure',
ip: request.ip,
userAgent: request.headers['user-agent'],
});- Failed authentication attempts
- Unusual request patterns
- High error rates
- Dependency vulnerabilities
ERROR Authentication error (SNYK-0005)
Solution:
- Verify SNYK_TOKEN is set correctly
- Check token permissions
- Use
continue-on-error: truein workflows
npm ERR! code EAUDITNOPJSON
Solution:
- Ensure package.json exists
- Run
pnpm installfirst - Check for lock file issues
Access to fetch at 'http://localhost:8080' from origin 'http://localhost:3000' has been blocked by CORS policy
Solution:
- Update CORS configuration in
src/config.js - Add frontend origin to allowed origins
- Restart server after configuration changes
# Update dependencies
pnpm update
# Check for outdated packages
pnpm outdated
# Update with interactive mode
pnpm update --interactive- Monthly dependency reviews
- Quarterly security audits
- Annual penetration testing (recommended)