Accepting files or archives
- Design a safer file-upload pipeline
- Extract archives without escaping the destination
- Prevent file inclusion: LFI, RFI, dynamic imports and template names
- Create temporary files safely: mkstemp, O_EXCL and private directories
- Parse bounded JSON and XML into an explicit application schema
- Convert untrusted office documents and PDFs in an isolated parser
Practice: Path traversal lab · Project: Keep extracted files inside their boundary · Project: Parse bounded JSON and XML invoices safely · Project: Convert untrusted documents in a locked-down container
Receiving webhooks or calling other services
- Verify webhook deliveries before acting
- Consume third-party APIs safely (OWASP API10:2023)
- Constrain server-side fetches to their intended destinations
- Bound API work, not just request counts
- Bound background jobs and make retries safe
Practice: Webhook signature and replay lab
Exposing data through an API
- Enforce authorization for every object action
- Authorize functions and fields as well as objects
- Authorization models: RBAC, ABAC, ReBAC and policy as code you can test
- Apply security limits to GraphQL, WebSocket and gRPC operations
- Preserve business invariants under concurrent requests
- Prevent business-logic flaws with server-side invariants
Practice: IDOR lab · Race condition lab · Project: Secure a real HTTP API · Project: Make a checkout transaction atomic
Rendering user content in the browser
- Prevent XSS at the output boundary
- Render rich text without granting it application privileges
- Protect cookie-authenticated actions against CSRF
- Configure CORS and CSP around the browser capabilities you need
- Configure HTTP security headers from a tested baseline
- Preserve framework security controls across the request lifecycle
Adding sign-in, sessions or tokens
- Session management: cookies, timeouts, rotation and revocation
- OAuth 2.0 and OpenID Connect login: authorization code with PKCE
- JWT validation: algorithms, keys, claims and key rollover
- Passkeys and MFA: WebAuthn enrollment, sign-in and replacement
- Stop account takeover with the right MFA and login defenses
- Password storage: hashing parameters and rehash on login
- Account recovery: password resets, help-desk resets and account linking
Practice: JWT validation lab · Password reset token lab · Project: Verify tokens through rotation and revocation
Storing secrets and sensitive data
- Secrets management: storage, rotation and leaked-secret response
- AEAD records: AES-GCM nonces, associated data and key limits
- Envelope encryption and key rotation: data keys, KMS keys and backups
- Data minimization and retention: collect less and prove that deletion works
- Tokenization, pseudonymization and privacy transformations: choose deliberately
- Secrets at runtime: Vault, Kubernetes Secrets, CSI driver, External Secrets and SOPS
- Case study: the LastPass breach (2022)
- Case study: Microsoft AI researchers' over-permissive SAS token (2023)
Practice: AES-GCM nonce reuse lab · Project: Bind ciphertext to the correct record
Shipping an LLM or agent feature
- Contain prompt injection at the application boundary
- Call a hosted LLM API safely
- Keep generated output out of executable contexts
- Contain LLM misinformation (OWASP LLM07:2026)
- Keep retrieval inside the user’s data boundary
- Authorize agent tools outside the model
- Constrain MCP and multi-agent trust boundaries
- Bound agent spending, memory and recovery
- Contain cascading failures and rogue agents
- Sandbox model-generated code and computer-use agents
- Keep secrets and controls out of hidden context (OWASP LLM08:2026)
- Defend agent memory and context against poisoning (OWASP ASI06)
- Case study: Moffatt v. Air Canada, a chatbot that misstated the refund policy (2022-2024)
Practice: RAG access control lab · Excessive agency lab · XSS lab · Project: Enforce retrieval and tool boundaries across crashes · Project: Run model-generated Python in a locked-down container
- Turn intended behavior into a trust-boundary contract.
- Choose controls from versioned requirements that interrupt specific failure paths.
- Define acceptance and operating evidence before release.
A feature contract, control-to-test table and operating note that accompany the implementation.
- Understand the feature’s normal request and response.
- Use the upload, webhook or agent-gateway guide fixture if no real feature is available.
Produce a one-page feature contract naming caller, tenant, protected data, permitted action, resource budget and failure behavior. For uploads, trace receive → quarantine → inspect → publish → download; for webhooks, raw bytes → verification → event decision → business effect; for an LLM feature, user and retrieved text → model proposal → tool gateway → effect. Label which values come from the caller and which come from trusted state. Finish when every transition has a responsible component and an explicit condition for advancing.
Start from the ASVS 5.0 requirements for the feature’s area at your target level, such as chapter V5 for file handling or V8 for authorization, then map each failure path to its enforcing component. An upload needs generated storage identity and controlled publication, not just an extension check; a webhook needs authenticated raw bytes and duplicate-safe effects; an agent needs a gateway that decides tool calls from the session, not from the model. Record rejected alternatives and their remaining bypass. Finish with a control table stating protected property, enforcement point, required inputs and a test that would falsify the claim.
Build paired cases from the feature contract. Include legitimate completion, altered or oversized input, another user’s object, duplicate delivery and interrupted work where relevant; for an LLM feature, add instructions planted in retrieved documents and tool results. State whether rejection must happen before storage, publication, a payment or a tool effect, then inspect that actual state. Finish when the connected exercise yields the required positive and negative results, with untested integration boundaries explicitly pending.
Create an operating note naming the owner, bounded audit events, resource limits, cleanup and retry behavior and recovery path. Decide what happens when inspection, signature verification or required evidence is unavailable. Record a change trigger such as a new file processor, payment side effect or agent tool. Finish when an operator can tell accepted work from completed work and recover without republishing untrusted bytes or repeating the business effect.
To build the skills behind this job step by step, follow the learning path Browser and API boundaries.
Use the blank work product for your system. Compare its required evidence with a completed synthetic example.
Download blank work product Download completed example