security-and-hardening

Hardens web application code against OWASP vulnerabilities, SSRF, and LLM-specific attack surfaces.

2|Updated Jul 1, 2026
One-click install
npx skills add https://github.com/Lazare-Panam/mars-api --skill security-and-hardening-lazare-panam
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: security-and-hardening
Source: https://github.com/Lazare-Panam/mars-api/tree/main/Mars.API/.claude/skills/security-and-hardening
Command: npx skills add https://github.com/Lazare-Panam/mars-api --skill security-and-hardening-lazare-panam

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Web applications that accept user input, manage sessions, or integrate external services are exposed to injection, XSS, broken access control, SSRF, and supply-chain attacks. This Skill provides a threat-model-first process and concrete prevention patterns so security is built into every feature rather than bolted on later. ## Core Features & Use Cases - Threat Modeling with STRIDE: Map trust boundaries, name assets, and run STRIDE over each boundary before writing controls, with abuse cases written next to use cases. - OWASP Prevention Patterns: Copy-ready code for parameterized queries, bcrypt password hashing, secure session cookies, CSP/security headers, CORS restriction, schema validation with zod, file upload safety, and SSRF defenses with DNS resolution checks. - Supply-Chain and Dependency Triage: A decision tree for triaging audit findings by severity and reachability, plus lockfile hygiene, install-script blocking, and typosquat detection. - Privacy and LLM Security: Data classification, retention, and deletion-path guidance for GDPR/CCPA, plus OWASP LLM Top 10 mitigations such as treating model output as untrusted input. - Use Case: Before shipping an endpoint that accepts a user-supplied webhook URL, apply the SSRF allowlist pattern and the security review checklist to confirm no private IP ranges are reachable. ## Quick Start Ask the assistant to review your authentication endpoint or user-input handler using the security-and-hardening checklist and point out the exact fixes needed.

Frequently Asked Questions about security-and-hardening

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent SQL injection in a web application?

Prevent SQL injection by using parameterized queries or an ORM instead of string concatenation. Pass user input as bound parameters, for example db.query('SELECT * FROM users WHERE id = $1', [userId]), so input is never interpreted as SQL syntax.

How do I protect a server from SSRF attacks on user-supplied URLs?

Protect against SSRF by allowlisting schemes and hosts, resolving all DNS records, and rejecting any private or reserved IP ranges including 169.254.169.254. Disable redirects and be aware of DNS-rebinding TOCTOU gaps, which require pinned IPs or a filtering agent for high-risk surfaces.

What session cookie settings prevent session hijacking?

Secure session cookies require the httpOnly flag to block JavaScript access, the secure flag for HTTPS-only transmission, and sameSite set to lax or strict for CSRF protection. Never store auth tokens in localStorage, and hash passwords with bcrypt, scrypt, or argon2.

How should I triage npm audit vulnerability results?

Triage audit results by severity and reachability: fix reachable critical and high findings immediately, schedule moderate production issues for the next release, and track low findings. Never run forced fixes like npm audit fix --force without reviewing changelogs and testing upgrades.

Does LLM output need validation before use in an application?

Yes, LLM output must be treated as untrusted input under OWASP LLM05. Never pass it directly into eval, SQL, shells, or innerHTML; instead parse it defensively, validate against a schema, and encode it before rendering or execution.

When should security changes require human approval?

Approval is required before adding authentication flows, storing new PII categories, changing CORS configuration, adding file upload handlers, modifying rate limits, or granting elevated permissions. Routine controls like input validation and output encoding are always applied without asking.