askill
typescript-security

typescript-securitySafety 100Repository

Secure coding practices for building safe TypeScript applications.

197 stars
3.9k downloads
Updated 2/2/2026

Package Files

Loading files...
SKILL.md

TypeScript Security

Priority: P0 (CRITICAL)

Security standards for TypeScript applications based on OWASP guidelines.

Implementation Guidelines

  • Validation: Validate all inputs with zod/joi/class-validator.
  • Sanitization: Use DOMPurify for HTML. Prevent XSS.
  • Secrets: Use env vars. Never hardcode.
  • SQL Injection: Use parameterized queries or ORMs (Prisma/TypeORM).
  • Auth: Use bcrypt for hashing. Implement strict RBAC.
  • HTTPS: Enforce HTTPS. Set secure, httpOnly, sameSite cookies.
  • Rate Limit: Prevent brute-force/DDoS.
  • Deps: Audit with npm audit.

Anti-Patterns

  • No eval(): Avoid dynamic execution.
  • No Plaintext: Never commit secrets.
  • No Trust: Validate everything server-side.

Code

// Validation (Zod)
const UserSchema = z.object({
  email: z.string().email(),
  password: z.string().min(8),
});

// Secure Cookie
const cookieOpts = {
  httpOnly: true,
  secure: process.env.NODE_ENV === 'prod',
  sameSite: 'strict' as const,
};

Reference & Examples

For authentication patterns and security headers: See references/REFERENCE.md.

Related Topics

best-practices | language

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

88/100Analyzed 2/4/2026

Excellent technical reference for TypeScript security with actionable guidelines, code examples, and clear triggers. While the path is agent-specific, the content is highly reusable.

100
95
95
90
85

Metadata

Licenseunknown
Version-
Updated2/2/2026
PublisherHoangNguyen0403

Tags

databasesecurity