We release security updates for the following versions:
| Version | Supported | Status |
|---|---|---|
| 1.x | β Yes | Current stable release |
| < 1.0 | β No | Legacy, no longer supported |
We take security vulnerabilities seriously. If you discover a security issue, please follow these steps:
Do not disclose security vulnerabilities through public GitHub issues, discussions, or pull requests.
- Email us: fernando@viverdepj.com.br
- Subject:
[SECURITY] Brief description of the issue - Include:
- Detailed description of the vulnerability
- Steps to reproduce the issue
- Potential impact assessment
- Affected versions
- Suggested fix (if available)
- Your contact information
- Initial Response: Within 48 hours (weekdays)
- Status Update: Within 5 business days
- Fix Timeline:
- Critical: 24-72 hours
- High: 7 days
- Medium: 14 days
- Low: 30 days
Security researchers who responsibly disclose vulnerabilities will be acknowledged in:
- Release notes
- SECURITY.md (with permission)
- Hall of Fame (coming soon)
- β JWT-based authentication with refresh tokens
- β Access tokens: 15-minute expiration
- β Refresh tokens: 7-day expiration with rotation
- β Bcrypt password hashing (cost factor: 10)
- β Rate limiting on authentication endpoints (100 req/15min)
- β Account lockout after failed login attempts
- β Secure password reset flow with time-limited tokens
- β Express-validator for input validation
- β Mongo-sanitize for NoSQL injection prevention
- β XSS-clean middleware
- β HPP (HTTP Parameter Pollution) protection
- β Prepared statements for SQL queries (100% coverage)
- β
Helmet.js configured with:
- Content Security Policy (CSP)
- X-Content-Type-Options: nosniff
- X-Frame-Options: DENY
- X-XSS-Protection: 1; mode=block
- Strict-Transport-Security (HSTS)
- Referrer-Policy: no-referrer
- β CORS properly configured
- β Comprehensive audit logging system
- β Automated log rotation (90-day retention)
- β Sensitive data masking in logs (CPF, passwords)
- β Failed login attempt tracking
- β IP address and User-Agent logging
- β Regular npm audit scans
- β Automated dependency updates via Dependabot
- β No known critical vulnerabilities
- β Sensitive environment variables (.env not committed)
- β Secrets rotation policy (every 6 months)
- β Password strength requirements enforced
- β HTTPS enforced in production
- β Secure cookie settings
Auditor: Claude (Anthropic AI) Score: 8.5/10 OWASP Top 10 Compliance: 85%
Issues Fixed:
- β CRITICAL: JWT_SECRET was weak β Rotated to cryptographically strong secret
- β CRITICAL: jspdf vulnerabilities (8 CVEs) β Updated to v4.2.0
- β HIGH: Refresh tokens not implemented β Full implementation complete
- β MEDIUM: Console.log in production β Terser configured to remove
- β MEDIUM: CORS hardcoded β Moved to environment variables
Remaining Issues:
β οΈ HIGH: xlsx library vulnerability β Documented as technical debt, mitigations in placeβ οΈ LOW: CSP uses unsafe-inline β Acceptable for internal app, nonce implementation planned
Full Report: SECURITY-AUDIT-REPORT.md
Auditor: Internal Team Score: 7.0/10
Issues Fixed:
- β Implemented audit logging system
- β Added rate limiting on sensitive endpoints
- β Configured Helmet security headers
- β Implemented input validation middleware
- Dependency Audits: Weekly (automated via Dependabot)
- Manual Security Review: Monthly
- Penetration Testing: Quarterly (planned)
- Credential Rotation: Every 6 months
- Next Credential Rotation: 2026-09-03
- Next Full Audit: 2026-06-03
- Next Dependency Update: Automated (ongoing)
Severity: HIGH Discovered: 2026-03-03 Status: Documented as Technical Debt CVEs: Multiple (see npm audit)
Mitigation:
- File size limits enforced (5MB)
- Rate limiting on upload endpoints
- Filename sanitization
- User input validation
- Uploads isolated from application code
Planned Fix: Migration to exceljs library (Q2 2026)
Tracking: TECH-DEBT.md #1
Severity: CRITICAL CVEs: LFI, PDF Injection, XSS, DoS, XMP Injection Fixed: Updated from v3.0.4 β v4.2.0 Details: JSPDF-UPDATE-NOTES.md
Severity: CRITICAL Issue: JWT_SECRET was potentially weak Fixed: Rotated to cryptographically strong 256-bit secret Details: SECURITY-CREDENTIALS-ROTATION.md
- β Web application (frontend + backend API)
- β Authentication & authorization mechanisms
- β Data validation and sanitization
- β Session management
- β API endpoints
- β File upload functionality
- β Database interactions
- β Third-party dependencies
- β Infrastructure (hosting, network, firewall)
- β Physical security
- β Social engineering
- β DDoS attacks (handled at infrastructure level)
- β DNS vulnerabilities
// β
GOOD: Use refresh tokens
const { accessToken, refreshToken } = await auth.login(username, password);
// β BAD: Long-lived tokens
const token = jwt.sign(payload, secret, { expiresIn: '30d' });// β
GOOD: Validate and sanitize
const schema = {
email: { isEmail: true, normalizeEmail: true },
amount: { isFloat: { min: 0 } },
};
app.post('/api/endpoint', validate(schema), handler);
// β BAD: Trust user input
const { email, amount } = req.body;
await db.query(`INSERT INTO table VALUES ('${email}', ${amount})`);// β
GOOD: Prepared statements
await pool.query('SELECT * FROM users WHERE id = $1', [userId]);
// β BAD: String concatenation
await pool.query(`SELECT * FROM users WHERE id = '${userId}'`);// β
GOOD: Environment variables
const apiKey = process.env.API_KEY;
// β BAD: Hardcoded secrets
const apiKey = 'sk_live_1234567890abcdef';// β
GOOD: Generic error messages to client
res.status(500).json({ error: 'Internal server error' });
console.error('Database error:', error); // Log detailed error server-side
// β BAD: Expose internal details
res.status(500).json({ error: error.stack });Before submitting a PR, verify:
- No hardcoded secrets or API keys
- All user inputs are validated and sanitized
- SQL queries use prepared statements
- Sensitive data is not logged
- New endpoints have authentication/authorization
- Rate limiting applied to sensitive endpoints
- Error messages don't expose internal details
- Dependencies are up to date (
npm audit) - No console.log in production code
- CORS properly configured for new endpoints
- Audit logging added for sensitive operations
- SECURITY-AUDIT-REPORT.md - Comprehensive security audit
- SECURITY-CREDENTIALS-ROTATION.md - Credential management
- TECH-DEBT.md - Known technical debt and planned fixes
- REFRESH-TOKENS-GUIDE.md - Refresh token implementation
- AUDIT-LOG-ROTATION-SETUP.md - Log management
- OWASP Top 10
- OWASP Cheat Sheet Series
- Node.js Security Best Practices
- Express Security Best Practices
- JWT Best Practices
Security researchers who have responsibly disclosed vulnerabilities:
| Date | Researcher | Vulnerability | Severity |
|---|---|---|---|
| Coming soon | - | - | - |
For security-related questions or concerns:
- Email: fernando@viverdepj.com.br
- Emergency Escalation: Contact form
- GPG Key: Available upon request
Response Time: Within 48 hours (weekdays)
This security policy is part of the ALYA project and is provided for transparency and responsible disclosure.
Last Updated: 2026-03-04 Next Review: 2026-06-04 Version: 1.0