Skip to content

Security: pinkpeether/peether-protocol

Security

SECURITY.md

πŸ” Security Policy & Responsible Disclosure

Repository note, April 21, 2026: this is the original peether-protocol workspace. Current public release work has moved to:

Apply this policy to the active split repositories as well.

Reporting Security Vulnerabilities

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:

πŸ“§ security@pinkpeether.com

What to Include:

  1. Description: Clear explanation of the vulnerability
  2. Location: Which file(s) and line numbers (if applicable)
  3. Severity: Low / Medium / High / Critical
  4. Impact: What could an attacker do?
  5. Steps to Reproduce: How to trigger the vulnerability
  6. Your Contact: Email or preferred contact method

Response Timeline:

  • 24 hours: Initial acknowledgment
  • 7 days: Assessment and severity determination
  • 14 days: Fix development begins
  • 30 days: Fix released (or disclosure discussion if complex)

Responsible Disclosure:

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

Recognition:

We acknowledge all responsible disclosures in:

  • Our SECURITY_ACKNOWLEDGMENTS.md file
  • Public thanks (if you wish)
  • Potential bug bounty (for critical vulnerabilities)

Security Best Practices for This Codebase

Secrets & Environment Variables

NEVER commit to repository:

  • .env files (use .env.example only)
  • 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=...

Code Review Requirements

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

Dependency Security

# Check for vulnerabilities in dependencies
npm audit

# Fix automatically where possible
npm audit fix

# Review and update regularly
npm update

Database Security

  • βœ… 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

API Security

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

Blockchain Security

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

Deployment Security

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

Monitoring & Alerting

# Monitor application logs
# Watch for:
- Repeated authentication failures
- Rate limit violations
- Unusual API usage patterns
- Database query errors
- Blockchain transaction failures

Configure alerts for:

  • βœ… Failed deployments
  • βœ… API error rate spike (>5% errors)
  • βœ… Database connection failures
  • βœ… Rate limit threshold reached
  • βœ… Unusual payment patterns

Security Checklist for Releases

Before Every Release:

  • 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

After Release:

  • Monitor error logs for 24 hours
  • Monitor application performance
  • Check security alerts
  • Verify all features working as expected
  • Document any issues for next release

Incident Response

If a Security Incident Occurs:

  1. Immediate Actions (0-1 hour)

    • Isolate affected systems
    • Preserve evidence/logs
    • Notify security team
    • Assess severity
  2. Short-term (1-24 hours)

    • Investigate root cause
    • Deploy temporary mitigation
    • Notify affected users
    • Begin formal investigation
  3. Long-term (24+ hours)

    • Develop permanent fix
    • Test thoroughly
    • Deploy fix
    • Post-incident review
    • Update security policies

Security Tools & Commands

# 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 committing

Questions?

For 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

There aren't any published security advisories