Skip to content

Security: Ciscode-M/DatabaseKit

Security

SECURITY.md

Security Policy

We take the security of DatabaseKit and our users' data seriously. This document outlines our security practices and how to report vulnerabilities.


🔐 Supported Versions

We provide security updates for the following versions:

VersionSupported
1.x.x✅ Actively supported
< 1.0❌ No longer supported

Recommendation: Always use the latest version to ensure you have the latest security patches.


🚨 Reporting a Vulnerability

Private Disclosure

If you discover a security vulnerability, please do NOT file a public issue.

Instead, report it privately to our security team:

📧 info@ciscod.com

Or use GitHub's private vulnerability reporting:

  1. Go to the Security tab
  2. Click "Report a vulnerability"
  3. Fill out the form with details

What to Include

Please provide as much information as possible:

  • Description of the vulnerability
  • Steps to reproduce the issue
  • Affected versions of DatabaseKit
  • Potential impact assessment
  • Proof of concept code (if applicable)
  • Suggested fix (if you have one)

Response Timeline

ActionTimeline
AcknowledgmentWithin 72 hours
Initial assessmentWithin 1 week
Fix developmentDepends on severity
Coordinated disclosureAfter fix is released

🛡️ Security Best Practices

For Database Connections

// ✅ DO: Use environment variablesconstconfig={type: 'postgres',connectionString: process.env.DATABASE_URL,};// ❌ DON'T: Hardcode credentialsconstconfig={type: 'postgres',connectionString: 'postgresql://admin:password123@localhost/mydb',};

For Connection Strings

  1. Use SSL/TLS in production:

    postgresql://user:pass@host:5432/db?sslmode=require
    mongodb+srv://user:pass@cluster.mongodb.net/db?ssl=true
    
  2. Rotate credentials regularly

  3. Use read-only users where possible

  4. Limit network access via firewall rules

For Query Safety

// ✅ DO: Let the library handle parameterizationawaitrepo.findAll({user_id: userId});// ❌ DON'T: Interpolate user input into queriesawaitrepo.findAll({name: `%${userInput}%`});// Risky!

For Column Whitelisting

// ✅ DO: Explicitly whitelist columnsconstrepo=db.createPostgresRepository({table: 'users',columns: ['id','name','email'],// Only these columns are queryable});// ❌ DON'T: Allow all columns (unless necessary)constrepo=db.createPostgresRepository({table: 'users',columns: [],// Empty = all columns allowed});

🔍 Security Features

Built-in Protections

  1. Parameterized Queries

    • All queries use parameterized statements
    • Prevents SQL injection in PostgreSQL
    • Prevents NoSQL injection in MongoDB
  2. Column Whitelisting

    • Restrict which columns can be queried
    • Prevents unauthorized data access
  3. Default Filters

    • Apply automatic filters (e.g., soft delete)
    • Prevents accidental exposure of deleted data
  4. Error Sanitization

    • Database exception filter sanitizes error messages
    • Prevents leaking internal details to clients

Recommended Additional Measures

  1. Use Guards for Authorization

    @UseGuards(AuthGuard)
    @Controller('users')exportclassUsersController{}
  2. Validate Input with DTOs

    classCreateUserDto{
    @IsString()
    @MinLength(2)name!: string;}
  3. Rate Limit API Endpoints

  4. Log and Monitor Database Access


📋 Security Checklist for Maintainers

Before each release:

  • All dependencies updated to latest secure versions
  • No hardcoded secrets in codebase
  • All user inputs are validated
  • Error messages don't expose internals
  • Parameterized queries used everywhere
  • CHANGELOG documents security fixes
  • npm audit shows no critical vulnerabilities
  • Tests cover security-sensitive code paths

🔒 Dependency Security

We use these tools to maintain dependency security:

  • npm audit - Regular vulnerability scanning
  • Dependabot - Automated dependency updates
  • Snyk - Deep dependency analysis

To check your project:

npm audit
npm audit fix

📜 Disclosure Guidelines

We follow responsible disclosure practices:

  1. Do not publicly share vulnerability details until a fix is released
  2. Do not exploit vulnerabilities beyond what's needed for investigation
  3. Do not access, modify, or delete user data
  4. Do not perform denial-of-service testing

We will:

  1. Credit your contribution in release notes (unless you prefer anonymity)
  2. Keep you updated on fix progress
  3. Coordinate disclosure timing with you

🏆 Hall of Fame

We appreciate security researchers who help keep DatabaseKit secure:


📚 Security Resources


📞 Security Contact

Email:info@ciscod.com

PGP Key: Available upon request for encrypted communications.


Last updated: January 2026

There aren't any published security advisories