Skip to content

28 eval-informed mental models and critical-thinking skills for Claude Code, GitHub Copilot, Codex, Cursor, and other Agent Skills-compatible tools

12.1 KB
Raw Blame
{"id":"crw-rt-01","mode":"binary-decision","prompt":"A Node.js file-download endpoint serves product manuals from a fixed directory. The handler reads a `doc` query parameter, sanitizes it, then streams the result:\n\n```js\napp.get('/manual', (req, res) => {\n  let name = req.query.doc || '';\n  name = name.replace(/\\.\\.\\//g, ''); // strip ../ sequences\n  const full = path.join('/srv/manuals', name);\n  res.sendFile(full);\n});\n```\n\nThere is no allowlist, no post-normalization containment check, and no `root` option on `sendFile`. A senior reviewer approves the change, reasoning: \"The regex has the global flag, so every `../` occurrence in the input is removed before we build the path. There is simply no way for a traversal sequence to survive the sanitizer, which means `path.join` can only ever resolve to something inside `/srv/manuals`. Adding a normalization check afterward would be redundant defense-in-depth. This is safe to merge.\" The team is about to merge on exactly that basis.\n\nEvaluate whether an attacker can still read files outside `/srv/manuals` (for example `/etc/passwd`) through the `doc` parameter, given precisely this sanitizer and no other control. Reason carefully about how a single global-replace pass actually processes a crafted input — in particular what happens to a payload constructed so that removing the inner `../` splices the surrounding characters into a brand-new `../` that the one-pass replace never re-examines — rather than assuming that one round of stripping is equivalent to fully neutralizing traversal.","label":true,"decision_instruction":"Answer YES if there is a concrete exploitable security vulnerability. Answer NO if the described controls prevent the plausible attack path. Do not report generic concerns without a reproducible path.","skill_fit":["red-team"],"domain":"path-traversal","cluster_id":"challenging-real-world-v1-path-traversal-single-pass-strip-dotdot","source_family":"challenging-real-world-v1","split":"replication","cluster_basis":"domain:path-traversal,label:yes"}
{"id":"crw-rt-02","mode":"binary-decision","prompt":"A reporting API lets clients sort results. A security scanner flags the following as a SQL injection because it string-interpolates request input directly into the query text:\n\n```js\nconst ALLOWED = { created: 'created_at', name: 'display_name', total: 'amount_total' };\nfunction listOrders(db, orgId, sortKey, dir) {\n  const col = ALLOWED[sortKey];\n  if (!col) throw new Error('bad sort');\n  const order = dir === 'desc' ? 'DESC' : 'ASC';\n  const sql = `SELECT id, display_name, amount_total\n               FROM orders WHERE org_id = $1\n               ORDER BY ${col} ${order}`;\n  return db.query(sql, [orgId]);\n}\n```\n\nA junior engineer escalates it: \"The scanner is right — `${col}` and `${order}` are interpolated straight into the SQL string. Concatenating request-derived values into a query is textbook injection. We should block the release until this is parameterized.\"\n\nAny `sortKey` not present as a key in `ALLOWED` throws before the query is built, so `col` is always one of the three hardcoded, developer-controlled column strings; `order` is coerced to the literal `'DESC'` or `'ASC'` and can never hold attacker text. `sortKey` and `dir` come straight from the query string. `orgId` is bound as a parameter. Note that column and sort-direction identifiers cannot be supplied as bound parameters in PostgreSQL. Decide whether this specific code, as written, exposes a concrete, reproducible SQL injection through `sortKey` or `dir` — trace what value actually reaches the SQL string for any attacker-supplied input, not merely whether interpolation appears in the source.","label":false,"decision_instruction":"Answer YES if there is a concrete exploitable security vulnerability. Answer NO if the described controls prevent the plausible attack path. Do not report generic concerns without a reproducible path.","skill_fit":["red-team"],"domain":"sql-injection","cluster_id":"challenging-real-world-v1-sql-injection-orderby-identifier-allowlist","source_family":"challenging-real-world-v1","split":"replication","cluster_basis":"domain:sql-injection,label:no"}
{"id":"crw-rt-03","mode":"binary-decision","prompt":"A password-reset flow is under review. Reset tokens are generated like this and emailed to the user:\n\n```js\nfunction makeResetToken() {\n  let t = '';\n  for (let i = 0; i < 32; i++) t += Math.floor(Math.random() * 16).toString(16);\n  return t; // 32 hex chars\n}\n```\n\nThe token is stored server-side as a SHA-256 hash (never in plaintext), is single-use, and expires 15 minutes after issue. The reset endpoint is rate-limited to 5 attempts per IP per hour.\n\nThe reviewer signs off: \"The token is 128 bits of entropy, stored only as a hash, single-use, and expires in 15 minutes. Even at millions of guesses per second an attacker cannot brute-force a 128-bit space inside the window, and rate limiting makes online guessing hopeless. This is secure.\"\n\nThe application is a long-running Node.js server that also exposes several endpoints returning values derived from `Math.random()` (e.g. a public `/preview?jitter=` cache-buster and randomized sample IDs in API responses). Assess whether an attacker who can request a victim's password reset and observe the service's other `Math.random()` outputs has a concrete path to forge or predict that victim's reset token — reason about the actual source of the randomness and what guarantees it does and does not provide, not just the token's nominal length or its storage and expiry.","label":true,"decision_instruction":"Answer YES if there is a concrete exploitable security vulnerability. Answer NO if the described controls prevent the plausible attack path. Do not report generic concerns without a reproducible path.","skill_fit":["red-team"],"domain":"crypto-token","cluster_id":"challenging-real-world-v1-crypto-token-math-random-reset-token","source_family":"challenging-real-world-v1","split":"replication","cluster_basis":"domain:crypto-token,label:yes"}
{"id":"crw-rt-04","mode":"binary-decision","prompt":"An avatar-import feature fetches an image from a user-supplied URL. A penetration tester files it as a high-severity SSRF: \"The server fetches arbitrary user-controlled URLs. That is classic SSRF — an attacker points it at `http://169.254.169.254/` or an internal service and exfiltrates cloud metadata or hits internal admin ports.\" The relevant server code:\n\n```js\nasync function importAvatar(rawUrl) {\n  const u = new URL(rawUrl);\n  if (u.protocol !== 'https:') throw new Error('https only');\n  const { address } = await dns.promises.lookup(u.hostname); // resolve once\n  if (isPrivate(address)) throw new Error('blocked');       // rejects RFC1918, loopback, link-local, ULA\n  const res = await fetch(`https://${address}`, {\n    headers: { Host: u.hostname },\n    redirect: 'error',            // any 3xx is a hard failure\n    signal: AbortSignal.timeout(3000),\n  });\n  return res.body;\n}\n```\n\n`isPrivate` is a correct, well-tested check covering 10/8, 172.16/12, 192.168/16, 127/8, 169.254/16, ::1, fc00::/7, and IPv4-mapped IPv6. The fetch connects to the already-resolved IP literal (not the hostname), sends the original Host header for TLS/vhost routing, and treats redirects as errors. Decide whether this specific implementation leaves a concrete, reproducible SSRF path to internal or metadata endpoints — reason about the two classic bypasses of naive private-IP filters (DNS rebinding via re-resolution, and redirect-to-internal) and whether this code actually closes both, rather than reacting to the presence of a user-supplied URL.","label":false,"decision_instruction":"Answer YES if there is a concrete exploitable security vulnerability. Answer NO if the described controls prevent the plausible attack path. Do not report generic concerns without a reproducible path.","skill_fit":["red-team"],"domain":"ssrf","cluster_id":"challenging-real-world-v1-ssrf-avatar-fetch-ip-pinned","source_family":"challenging-real-world-v1","split":"replication","cluster_basis":"domain:ssrf,label:no"}
{"id":"crw-rt-05","mode":"binary-decision","prompt":"A backup microservice lets an operator tag each archive with a short label. The label is validated and then used to name the output file in a shell command:\n\n```python\nimport subprocess\n\ndef make_archive(src_dir, label):\n    if len(label) > 64:\n        raise ValueError('label too long')\n    label = label.strip()          # trim surrounding whitespace\n    if not label:\n        raise ValueError('label required')\n    cmd = f\"tar czf /backups/{label}.tgz {src_dir}\"\n    subprocess.run(cmd, shell=True, check=True)\n```\n\nThe label field is exposed in an authenticated internal admin UI. A reviewer argues it is safe: \"We cap the label at 64 characters and reject empty labels after stripping whitespace. It is an internal, authenticated tool — operators are trusted, and 64 characters is not enough room to do anything dangerous. No need to change it.\"\n\nThere is no character allowlist and no shell-escaping/quoting of `label`; the only gates are the 64-character cap and the whitespace strip, and neither removes shell metacharacters. `src_dir` is server-controlled and fixed. Only `label` is attacker-influenced (any authenticated operator, or anyone who can reach the endpoint via CSRF/compromised session). Determine whether this code has a concrete, reproducible command-injection vulnerability through `label`, given only the length check and whitespace strip. Reason about what shell metacharacters remain permitted inside a 64-character string and what `shell=True` does with them, rather than assuming a short, length-limited, authenticated field is inherently safe.","label":true,"decision_instruction":"Answer YES if there is a concrete exploitable security vulnerability. Answer NO if the described controls prevent the plausible attack path. Do not report generic concerns without a reproducible path.","skill_fit":["red-team"],"domain":"command-injection","cluster_id":"challenging-real-world-v1-command-injection-archive-label-length-checked","source_family":"challenging-real-world-v1","split":"replication","cluster_basis":"domain:command-injection,label:yes"}
{"id":"crw-rt-06","mode":"binary-decision","prompt":"A login endpoint is reviewed for username enumeration and brute force. The code:\n\n```python\nDUMMY_HASH = bcrypt.hashpw(b'placeholder', bcrypt.gensalt())  # computed once at boot\n\ndef login(email, password):\n    user = db.find_user(email)\n    if user is None:\n        bcrypt.checkpw(password.encode(), DUMMY_HASH)   # burn equivalent time\n        return fail('Invalid email or password')\n    if not bcrypt.checkpw(password.encode(), user.pw_hash):\n        return fail('Invalid email or password')\n    return success(user)\n```\n\nAdditional controls: identical error text and HTTP 401 for both unknown-email and wrong-password cases; per-account and per-IP rate limits with exponential backoff and temporary lockout after repeated failures; the account-existence path and the wrong-password path both perform exactly one bcrypt comparison with the same cost factor.\n\nA reviewer flags it as vulnerable: \"Attackers can still enumerate accounts. When the email is unknown you skip the real hash, so the response comes back faster — a timing side channel reveals which emails are registered. This is an enumeration vulnerability.\" Evaluate whether, as written, this endpoint exposes a concrete, reproducible account-enumeration or brute-force vulnerability. Trace precisely what happens on the unknown-email branch versus the wrong-password branch — including the dummy bcrypt call — and whether the response content and timing actually differ in a way an attacker can exploit, rather than assuming any `if user is None` shortcut leaks timing.","label":false,"decision_instruction":"Answer YES if there is a concrete exploitable security vulnerability. Answer NO if the described controls prevent the plausible attack path. Do not report generic concerns without a reproducible path.","skill_fit":["red-team"],"domain":"auth","cluster_id":"challenging-real-world-v1-auth-login-enum-timing-equalized","source_family":"challenging-real-world-v1","split":"replication","cluster_basis":"domain:auth,label:no"}