CtrlK
BlogDocsLog inGet started
Tessl Logo

moai-ref-owasp-checklist

OWASP Top 10 security checklist, authentication patterns, input validation, and HTTP security headers reference. Agent-extending skill that amplifies backend-implementation and security-audit workflows with production-grade security patterns. NOT for: frontend UI, DevOps deployment, performance optimization, testing strategy.

68

Quality

83%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide

SecuritybySnyk

Passed

No findings from the security scan

SKILL.md
Quality
Evals
Security

OWASP Security Checklist Reference

Target Agents

  • manager-develop - Applies checklist during backend API implementation (cycle_type=tdd or cycle_type=ddd context)
  • /moai review --security - Primary security-audit invocation surface (replaces the retired /moai security subcommand per SPEC-SUBCOMMAND-RETIRE-001); equivalently available as a per-spawn Agent(general-purpose) security specialist per archived-agent-rejection.md §C

OWASP API Security Top 10

RankVulnerabilityCheckDefense
A1BOLA (Broken Object Level Authorization)Can user A access user B's resources?Verify object ownership at every endpoint
A2Broken AuthenticationWeak passwords, unlimited login attempts?bcrypt (cost 12+), rate limit, MFA
A3Broken Object Property Level AuthorizationAre hidden fields exposed in responses?Response DTOs, field-level filtering
A4Unrestricted Resource ConsumptionCan mass requests crash the server?Rate limiting, enforce pagination limits
A5Broken Function Level AuthorizationCan regular users call admin APIs?RBAC middleware, permission checks
A6SSRF (Server-Side Request Forgery)Can URL input access internal resources?URL whitelist, block internal IPs
A7Security MisconfigurationDebug mode, default accounts exposed?Separate prod config, inspect headers
A8Lack of Automated Threat ProtectionCan APIs be called in abnormal sequences?State machine validation, business rules
A9Improper Asset ManagementUnused APIs, old versions exposed?API inventory, version deprecation
A10Unsafe API ConsumptionAre external API responses trusted blindly?Validate external responses, set timeouts

Authentication Checklist

Password Policy

  • Minimum 8 characters, show strength meter (not strict rules)
  • bcrypt (cost factor 12+) or Argon2id
  • Temporary lock after 5 failed attempts (15 min) or CAPTCHA
  • Prevent reuse of last 5 passwords

JWT Configuration

SettingRecommended Value
Access Token Expiry15-30 minutes
Refresh Token Expiry7-14 days
AlgorithmRS256 (asymmetric) or HS256
StoragehttpOnly + secure + sameSite cookie
PayloadMinimal: userId, role only (no PII)
RenewalSilent refresh or token rotation

Session Security

  • Regenerate session ID after login
  • Invalidate session on logout (server-side)
  • Set session timeout (30 min idle)
  • Bind session to IP/User-Agent (optional, strict)

HTTP Security Headers

HeaderValuePurpose
Strict-Transport-Securitymax-age=31536000; includeSubDomainsForce HTTPS
X-Content-Type-OptionsnosniffPrevent MIME sniffing
X-Frame-OptionsDENY or SAMEORIGINPrevent clickjacking
Content-Security-Policydefault-src 'self'Prevent XSS
Referrer-Policystrict-origin-when-cross-originLimit referrer
Permissions-Policycamera=(), microphone=()Restrict browser features

Input Validation Checklist

TypeMethodTool
Schema validationType + structure checkZod, Joi, pydantic, Go validator
Length limitsMin/max constraintsSchema definitions
SQL InjectionParameterized queriesORM (Prisma, GORM, SQLAlchemy)
XSS PreventionHTML escapingDOMPurify (client), server escape
Path TraversalPath normalizationfilepath.Clean + whitelist
File UploadType + size validationMIME type + magic number check
CORSOrigin whitelistNever origin: '*' with credentials

Sensitive Data Handling

Data TypeStorageTransmissionLogging
Passwordsbcrypt hash onlyHTTPS onlyNEVER
API KeysEnvironment variablesHeader (Authorization)Masked (first 4 chars)
PIIEncrypted (AES-256)HTTPS onlyMasked
Credit CardsTokenized (payment provider)Provider SDKNEVER
SessionshttpOnly cookieHTTPS onlyNEVER

Security Review Severity Levels

LevelLabelActionExample
P0CRITICALBlock releaseSQL injection, auth bypass
P1HIGHFix before mergeMissing authorization check
P2MEDIUMFix within sprintWeak password policy
P3LOWTrack in backlogMissing security header

Trust Boundary Verification Principles

PrincipleApplies ToDefense
Cached/client-supplied session state is not proof of current identityAny framework caching or locally decoding a session/JWT valueRe-verify identity against the server-side source of truth (session store, token introspection, identity provider) before every authorization decision
Edge/gateway/middleware auth checks are a UX convenience, not a security boundaryReverse proxies, framework middleware, API gateways, serverless edge functionsEvery mutation-handling endpoint independently re-checks authentication AND resource-ownership authorization
Scheduled/cron-triggered HTTP endpoints are still public URLsAny scheduler that invokes an HTTP endpoint (cron jobs, scheduled serverless functions, container-orchestrator scheduled jobs)Require a shared-secret bearer check (constant-time compare) on every scheduled-endpoint invocation
Production builds must not expose source maps or equivalent debug artifactsAny bundler/build toolDisable production source maps, verbose stack traces, and build manifests in production configuration
Webhook receivers must verify a signature/HMAC header before trusting the payloadAny webhook providerVerify signature/HMAC against a shared secret before treating the payload as legitimate business data

Common Rationalizations

RationalizationReality
"This is an internal application, OWASP does not apply"Internal applications are reachable from compromised internal services. OWASP applies to all web applications.
"The framework handles XSS protection"Frameworks protect default rendering paths. Dynamic HTML insertion, innerHTML, and template literals bypass the protection.
"We do not store sensitive data, so encryption is unnecessary"Session tokens, API keys, and PII are sensitive data. If the application has users, it has sensitive data.
"Security headers are just defense-in-depth, not critical"Each security header blocks a specific attack class. Missing CSP enables XSS even when output is escaped.
"I will do a security review before release"Late security reviews find issues that are expensive to fix. Secure coding practices prevent them from the start.

Red Flags

  • User input rendered in HTML without escaping or sanitization
  • SQL query built with string concatenation instead of parameterized queries
  • Authentication token stored in localStorage instead of httpOnly cookie
  • Missing Content-Security-Policy header on response
  • Secrets (API keys, passwords) found in source code or configuration files committed to git

Verification

  • OWASP Top 10 checklist reviewed for the change (show which items were evaluated)
  • User input sanitized before rendering in HTML output
  • All database queries use parameterized statements
  • Security headers present (CSP, X-Frame-Options, X-Content-Type-Options)
  • No secrets found in source code (show grep results for common secret patterns)
  • Authentication tokens use httpOnly, Secure, SameSite cookie attributes
Repository
modu-ai/moai-adk
Last updated
First committed

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.