Repository note, April 21, 2026: this is the original
peether-protocolworkspace. Current public release work has moved to:
- Backend API: https://github.com/pinkpeether/ptdt-settlement-api
- Frontend UI: https://github.com/pinkpeether/ptdt-settlement-frontend
Apply this policy to the active split repositories as well.
PLEASE DO NOT open public GitHub issues for security vulnerabilities.
If you discover a security vulnerability in the PTDT Settlement API, please report it privately to:
- Description: Clear explanation of the vulnerability
- Location: Which file(s) and line numbers (if applicable)
- Severity: Low / Medium / High / Critical
- Impact: What could an attacker do?
- Steps to Reproduce: How to trigger the vulnerability
- Your Contact: Email or preferred contact method
- 24 hours: Initial acknowledgment
- 7 days: Assessment and severity determination
- 14 days: Fix development begins
- 30 days: Fix released (or disclosure discussion if complex)
We ask that you:
- β Give us reasonable time to fix before public disclosure
- β Avoid testing on production systems without permission
- β Don't access or modify others' data
- β Don't disrupt service or testing environment
- β Keep vulnerability details confidential until fixed
We acknowledge all responsible disclosures in:
- Our SECURITY_ACKNOWLEDGMENTS.md file
- Public thanks (if you wish)
- Potential bug bounty (for critical vulnerabilities)
NEVER commit to repository:
.envfiles (use.env.exampleonly)- API keys, tokens, or credentials
- Database passwords
- Private keys or mnemonics
- JWT secrets
- Blockchain RPC URLs with auth
Use GitHub Secrets for deployment:
# GitHub Settings β Secrets β New repository secret
DATABASE_URL=postgresql://...
JWT_SECRET=...
BSC_RPC_URL=...
API_KEYS=...All code changes require:
- β At least 1 code review (team members)
- β All tests passing
- β No security warnings from SAST tools
- β No new dependencies without security audit
# Check for vulnerabilities in dependencies
npm audit
# Fix automatically where possible
npm audit fix
# Review and update regularly
npm update- β Use connection pooling (configured in src/config/database.ts)
- β Enable SSL/TLS for production connections
- β Use Prisma ORM (prevents SQL injection)
- β Implement row-level security where sensitive
- β Regular automated backups
Implemented:
- β JWT token authentication (src/middleware/auth.ts)
- β API key validation
- β Rate limiting (src/middleware/rateLimit.ts)
- β CORS configuration
- β Request validation (Joi)
- β Error sanitization (no stack traces in production)
- β Request logging for audit trail
Additional measures:
- β HTTPS/TLS for all endpoints (enforce in production)
- β Helmet.js for security headers (configured in src/index.ts)
- β Input validation on all endpoints
- β Output encoding to prevent XSS
Smart Contract Interaction (src/utils/bsc.ts):
- β Use audited contract ABI
- β Validate transaction signatures
- β Implement transaction confirmation checks
- β Never store private keys in code
- β Use hardware wallets for production operations
Before Production Deployment:
- Security audit of all code
- Penetration testing
- Load testing (verify rate limits work)
- Backup & disaster recovery testing
- Incident response plan documented
- Team security training completed
# Monitor application logs
# Watch for:
- Repeated authentication failures
- Rate limit violations
- Unusual API usage patterns
- Database query errors
- Blockchain transaction failuresConfigure alerts for:
- β Failed deployments
- β API error rate spike (>5% errors)
- β Database connection failures
- β Rate limit threshold reached
- β Unusual payment patterns
- Run
npm audit- all vulnerabilities fixed - All tests passing (
npm test) - No console.log statements in production code
- No hardcoded secrets or credentials
- All dependencies up to date
- Security headers configured (Helmet.js)
- Rate limiting enabled
- Database backups created
- Rollback plan documented
- Team notified of changes
- Monitor error logs for 24 hours
- Monitor application performance
- Check security alerts
- Verify all features working as expected
- Document any issues for next release
-
Immediate Actions (0-1 hour)
- Isolate affected systems
- Preserve evidence/logs
- Notify security team
- Assess severity
-
Short-term (1-24 hours)
- Investigate root cause
- Deploy temporary mitigation
- Notify affected users
- Begin formal investigation
-
Long-term (24+ hours)
- Develop permanent fix
- Test thoroughly
- Deploy fix
- Post-incident review
- Update security policies
# Check for vulnerabilities
npm audit
# Security linting (if configured)
npm run lint
# Type checking (catch many bugs)
npx tsc --noEmit
# View production environment
echo $NODE_ENV # Should be 'production'
# Check for exposed secrets
git log --oneline | head -20
git diff --cached # Before committingFor security-related questions:
- π§ Email: security@pinkpeether.com
- π Encrypted message: [Your PGP key]
- π Emergency: [Your emergency contact]
Last Updated: January 26, 2026
Version: 1.0
Status: Active & Enforced