We take the security of DatabaseKit and our users' data seriously. This document outlines our security practices and how to report vulnerabilities.
We provide security updates for the following versions:
| Version | Supported |
|---|---|
| 1.x.x | β Actively supported |
| < 1.0 | β No longer supported |
Recommendation: Always use the latest version to ensure you have the latest security patches.
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:
- Go to the Security tab
- Click "Report a vulnerability"
- Fill out the form with details
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)
| Action | Timeline |
|---|---|
| Acknowledgment | Within 72 hours |
| Initial assessment | Within 1 week |
| Fix development | Depends on severity |
| Coordinated disclosure | After fix is released |
// β
DO: Use environment variables
const config = {
type: "postgres",
connectionString: process.env.DATABASE_URL,
};
// β DON'T: Hardcode credentials
const config = {
type: "postgres",
connectionString: "postgresql://admin:password123@localhost/mydb",
};-
Use SSL/TLS in production:
postgresql://user:pass@host:5432/db?sslmode=require mongodb+srv://user:pass@cluster.mongodb.net/db?ssl=true -
Rotate credentials regularly
-
Use read-only users where possible
-
Limit network access via firewall rules
// β
DO: Let the library handle parameterization
await repo.findAll({ user_id: userId });
// β DON'T: Interpolate user input into queries
await repo.findAll({ name: `%${userInput}%` }); // Risky!// β
DO: Explicitly whitelist columns
const repo = db.createPostgresRepository({
table: "users",
columns: ["id", "name", "email"], // Only these columns are queryable
});
// β DON'T: Allow all columns (unless necessary)
const repo = db.createPostgresRepository({
table: "users",
columns: [], // Empty = all columns allowed
});-
Parameterized Queries
- All queries use parameterized statements
- Prevents SQL injection in PostgreSQL
- Prevents NoSQL injection in MongoDB
-
Column Whitelisting
- Restrict which columns can be queried
- Prevents unauthorized data access
-
Default Filters
- Apply automatic filters (e.g., soft delete)
- Prevents accidental exposure of deleted data
-
Error Sanitization
- Database exception filter sanitizes error messages
- Prevents leaking internal details to clients
-
Use Guards for Authorization
@UseGuards(AuthGuard) @Controller("users") export class UsersController {}
-
Validate Input with DTOs
class CreateUserDto { @IsString() @MinLength(2) name!: string; }
-
Rate Limit API Endpoints
-
Log and Monitor Database Access
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
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 fixWe follow responsible disclosure practices:
- Do not publicly share vulnerability details until a fix is released
- Do not exploit vulnerabilities beyond what's needed for investigation
- Do not access, modify, or delete user data
- Do not perform denial-of-service testing
We will:
- Credit your contribution in release notes (unless you prefer anonymity)
- Keep you updated on fix progress
- Coordinate disclosure timing with you
We appreciate security researchers who help keep DatabaseKit secure:
- OWASP Top 10
- Node.js Security Best Practices
- MongoDB Security Checklist
- PostgreSQL Security
- NestJS Security
Email: info@ciscod.com
PGP Key: Available upon request for encrypted communications.
Last updated: January 2026