Imported from HoangDuc1003/Cinema-booking (
skills/security-hardening/SKILL.md). Install upstream withnpx skills add HoangDuc1003/Cinema-booking --skill security-hardening. Copyright stays with the author.
Harden Security
- Search tracked files for credential patterns; report exposure without echoing values.
- Keep secrets server-side and document placeholders only in
.env.example. - Validate and normalize every untrusted route parameter and body field.
- Derive booking prices and user identity server-side; never trust client totals or user IDs.
- Verify Stripe signatures against the raw body and make callbacks idempotent.
- Enforce ownership on pay, cancel, and read operations; enforce admin authorization on mutations.
- Avoid returning stack traces, provider errors, connection strings, or internal identifiers unnecessarily.
- Review CORS and origin-derived redirect URLs against an allowlist for production.
- Add rate limiting or note it as follow-up when endpoints are abuse-sensitive.
- Verify failure behavior for missing or unavailable Redis because security invariants must not depend solely on it.
Prioritize exploitable findings and keep remediation scoped. Re-run secret scanning and regression tests before handoff.