Threat Model for a System or Change
Produces an evidence-based threat model for one system or change: attacker scenarios, affected objectives, control gaps.
$5
Works with the AI tools you already use
Threat Model for a System or Change
Example session with this skill installed
Conduct a threat model for our new Guest Checkout One-Click Payment feature.
- Subject: checkout-service v3.5.0 guest payment flow (run-id: pay-checkout-sec-001), introducing stored tokenized card checkout for unregistered guest users via signed SMS/email OTP links.
- Decider: Application Security Board (Lead: Sarah Chen) and Product Engineering Lead (Alex Mercer).
- Assets & Data: Stored Stripe customer payment method tokens (vault IDs), customer email/phone numbers, order history.
- Surfaces: Public REST endpoint POST /v1/checkout/guest/pay, Twilio SMS delivery channel, SendGrid email delivery channel, Redis token cache.
- Tension: Product team wants OTP expiration extended to 24 hours to maximize guest conversion; SecOps warns that 24-hour OTPs combined with SMS brute-forcing or SIM-swapping risk account takeover and unauthorized card charging, requiring 10-minute expiry, rate-limiting (max 3 attempts), and cryptographic session binding.
- Scope: STRIDE evaluation of guest payment authorization path; out of scope: Stripe vault backend infrastructure and PCI hardware terminal devices.
Write the threat model report under docs/.
- Read your context and instructions
- Compiled the threat model
- Generated the UI component
Wrote docs/architecture/tasks/pay-checkout-sec-001/threat-modeling-task/threat-model-report.md. Complete threat model evaluating the Guest Checkout payment flow under STRIDE, establishing OTP rate-limiting, token scoping, and 10-minute expiration mitigations.
---
skill: threat-modeling-task
---
# Threat Model Report: Guest Checkout One-Click Payment [TM-PAY-001]
## Summary
This threat model evaluates the security posture of the Guest Checkout One-Click Payment feature in `checkout-service v3.5.0` under run ID `pay-checkout-sec-001`. The feature introduces frictionless payment processing for unauthenticated users via SMS and email OTP tokens. The analysis evaluates threat vectors across the public API gateway, SMS/email delivery channels, and Redis cache. It decisively rejects the product proposal for a 24-hour OTP window due to high risk of SIM-swap exploitation and brute-force token harvesting. It specifies mandatory mitigations: 10-minute OTP expiration, 3-attempt brute-force lockouts, cryptographic device-session binding, and downstream payment token masking.
## Detailed Description
Guest checkout paths represent high-risk attack surfaces because transactions execute without pre-existing authenticated user sessions. Stored Stripe payment method tokens must never be disclosed or charged without verifiable proof of possession of the guest identifier.
### Criteria and weights
| Criterion | Why it matters here | Weight | Source of the weight |
|---|---|---|---|
| Financial Abuse & Fraud Prevention | Stolen OTP tokens allow attackers to charge victims' cards for guest orders. | 0.40 | Sarah Chen (AppSec Lead) |
| Credential Harvesting Defense | SMS and email channels are vulnerable to interception, SIM-swapping, and phishing. | 0.30 | SecOps Threat Intelligence |
| Friction & Conversion Impact | Security controls must not prevent legitimate guest customers from completing purchases. | 0.15 | Alex Mercer (Product Lead) |
| Regulatory & PCI Compliance | Exposing raw payment identifiers violates PCI-DSS requirements. | 0.15 | Corporate Compliance Policy |
### Comparison
| Design Option | OTP Lifetime | Brute-Force Safeguard | Session Binding | Residual Risk Level |
|---|---|---|---|---|
| Option A: 24h Permissive OTP (Product) | 1,440 minutes (24 hours) | None | None (link alone authorizes charge) | Critical: Vulnerable to link theft, forward interception, and SIM-swap fraud. |
| Option B: 30-min Standard OTP | 30 minutes | IP-based rate limiting | User-Agent match | Medium: IP rotation easily bypasses rate limiter; User-Agent is easily spoofed. |
| Option C: 10-min Hardened OTP (Chosen) | 10 minutes (600 s) | Max 3 attempts per phone/email hash | Cryptographic Cookie / Device Fingerprint | Low: Strict attempt caps eliminate brute force; short window bounds SIM-swap exposure. |
### Result
Option C is selected. The guest checkout token lifecycle is restricted to 10 minutes with strict per-identifier rate limiting.
---
### Required Mechanisms
#### 1. System Boundary and Assets at Risk [MC-AS-01]
- **Assets**:
- `Stripe Vault Token`: Token authorizing payment against stored cardholder data.
- `Customer PII`: Guest email address, mobile phone number, delivery address.
- `Financial Balance`: Customer monetary funds exposed to fraudulent charges.
- **Trust Boundaries**:
- External Internet -> API Gateway (`POST /v1/checkout/guest/pay`).
- API Gateway -> Internal Redis Token Cache.
- Checkout Service -> External Third-Party Telephony (Twilio SMS / SendGrid Email).
#### 2. STRIDE Threat Hypotheses & Abuse Scenarios [MC-TH-01]
##### THR-01: Spoofing / Account Takeover via OTP Brute-Force (STRIDE: Spoofing)
- **Vulnerability**: 6-digit numeric OTP space contains 1,000,000 combinations. Without rate limits, automated bots can brute-force codes within 24 hours.
- **Mitigation**: Redis counter tracks failed validation attempts for `(phone_hash, checkout_id)`. After 3 failed attempts, the OTP token is immediately destroyed, and the checkout session is locked.
##### THR-02: Tampering / Man-in-the-Middle on SMS Delivery (STRIDE: Tampering)
- **Vulnerability**: Plain SMS delivery is susceptible to SS7 interception and carrier SIM-swapping.
- **Mitigation**: SMS messages contain only an alphanumeric verification code, never a direct one-click charge link. The checkout UI requires concurrent entry of both the SMS code and a confirmation of the billing zip code.
##### THR-03: Information Disclosure of Stored Payment Method (STRIDE: Information Disclosure)
- **Vulnerability**: Successful OTP validation returning raw card details or unmasked cardholder names.
- **Mitigation**: API responses return strictly masked card representations (`brand: VISA, last4: 4242`). The Stripe vault token remains internal to backend service-to-service calls.
##### THR-04: Denial of Service via Telephony Pumping (STRIDE: Denial of Service)
- **Vulnerability**: Attackers trigger millions of guest OTP requests to generate fraudulent SMS toll fees (SMS pumping attack).
- **Mitigation**: Ingress Cloudflare Turnstile CAPTCHA enforced on `POST /v1/checkout/guest/request-otp`. Global IP rate limit capped at 5 OTP requests per hour per IP.
##### THR-05: Elevation of Privilege via Parameter Tampering (STRIDE: Elevation of Privilege)
- **Vulnerability**: Attacker validates OTP for $15 item, then tampers checkout payload to purchase $2,000 electronics item.
- **Mitigation**: The OTP token is cryptographically bound to the specific `order_id` and `total_amount_cents` in Redis. Any change in cart contents invalidates the OTP.
---
### Invariants and Contracts
Strict OTP Lifetime Invariant [INV-TM-01]
Guest payment OTPs must expire within 600 seconds (10 minutes). Redis keys must have TTL <= 600.
Requests evaluated after expiration are unconditionally rejected with HTTP 401.
Attempt Limiting Invariant [INV-TM-02]
A maximum of 3 failed code verification attempts is permitted per checkout token.
Upon the 3rd failed attempt, the token must be permanently invalidated in Redis.
Cart Value Binding Invariant [INV-TM-03]
The authorization lease generated by OTP validation is immutably bound to the specific cart amount.
If order total changes prior to authorization, the session requires fresh verification.
## Explicit Unknowns
- Third-party Twilio SMS delivery latency across international carrier aggregators (G-1).
- Effectiveness of Turnstile CAPTCHA against residential proxy bot farms in targeted fraud campaigns (G-2).
## Traceability
| Claim | Classification | Source | Freshness |
|---|---|---|---|
| Stored Stripe vault tokens | provided | Intake specification | Current |
| 24-hour OTP proposal rejection | decided | Sarah Chen & AppSec Review | 2026-09-15 |
| 10-minute OTP TTL, 3 attempts limit | decided | Architectural decision INV-TM-01 | 2026-09-15 |
| Ingress endpoints & delivery channels | provided | Intake specification | Current |
| STRIDE taxonomy application | derived | AppSec Threat Modeling Methodology | 2026-09-15 |
## Verification
No validator was supplied, so no command was run.
Reviewer self-check against threat model contracts:
- **STRIDE Coverage**: PASS. Threat scenarios evaluate Spoofing, Tampering, Info Disclosure, DoS, Elevation.
- **Mitigation Specificity**: PASS. Explicit 10-minute TTL, 3-attempt lockout, Turnstile CAPTCHA, cart binding.
- **Boundary Clarity**: PASS. Trust boundaries across external gateway, Redis, and Twilio/SendGrid mapped.
## Open Decisions
- `DEC-TM-01`: Sarah Chen to determine whether email OTP should be disabled entirely for guest orders exceeding $500 (Owner: Sarah Chen).
## Next steps
1. Alex Mercer and checkout team implement 10-minute Redis TTL and 3-attempt lockout in `guest_checkout_service`.
2. AppSec conducts penetration testing against the Turnstile CAPTCHA and rate-limiting endpoints.
3. Configure Datadog alerting for anomalous spikes in SMS OTP dispatch volume to detect toll fraud.
threat-model-for-a-system-or-change.tsx
TSX · React component
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
What you get
About this skill
What it does
This skill turns a frozen system/change model into traceable attacker-goal scenarios, affected security objectives, control gaps and test/treatment handoffs. It models a bounded version and states uncertainty rather than filling a generic checklist.
Use it when
Use when a specific system, service, workflow, feature or change needs threat elicitation against known architecture and objectives.
For example: “We're adding a customer file upload to the claims portal. Security wants a threat model and the last one we did was a spreadsheet of every STRIDE category against the word 'system'.”
What you get
- STRIDE Threat Model Report
- DFD Diagram
- Threat-to-Control Mapping Matrix
Written as Markdown to <your output folder>/architecture/tasks/<run-id>/threat-modeling-task/.
What it will not do
Do not use for enterprise security architecture, generic risk assessment, code/security review, vulnerability scanning, penetration testing, compliance mapping, incident response, one DFD, implementation or automatic STRIDE reporting.
How it works
- Check there is a concrete design to model.
- Draw the data flow and mark the trust boundaries.
- Work STRIDE per element, not per system.
- Keep only the threats that survive the existing controls.
- Rate what remains by impact on the asset, and assign an owner.
- Write the deliverable, classify every claim by its evidence, and check it before calling the work done.
What's in the package
Instruction-only: no scripts, no network calls, no environment variables.
- LICENSE.txt
- SKILL.md
- agents/openai.yaml
- assets/output-template-task.md
- references/domain-rules.md
- references/operating-rules.md
- references/output-contract.md
How to install
Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.
- 1
Download the ZIP
Free skills download straight away. Paid skills unlock right after purchase.
- 2
Unzip into your skills folder
Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.
- 3
Ask your agent to use it
Restart the agent if it was already running. It picks the skill up automatically - no config needed.
Skills folder by agent
Click the path to copy it. Create the folder if it does not exist yet.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
30-day refund
Not a fit? Get your money back
Trust & safety
Security scanned
Verified clean 13 days ago
- Passed all security checks, Safe to install