[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-trail-of-bits-sharp-edges":3,"mdc--86j9un-key":38,"related-org-trail-of-bits-sharp-edges":2116,"related-repo-trail-of-bits-sharp-edges":2267},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":12,"stars":26,"repoUrl":27,"updatedAt":28,"license":29,"forks":30,"topics":31,"repo":33,"sourceUrl":36,"mdContent":37},"sharp-edges","identify security risks in API designs","Identifies error-prone APIs, dangerous configurations, and footgun designs that enable security mistakes. Use when reviewing API designs, configuration schemas, cryptographic library ergonomics, or evaluating whether code follows 'secure by default' and 'pit of success' principles. Triggers: footgun, misuse-resistant, secure defaults, API usability, dangerous configuration.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},"trail-of-bits","Trail of Bits","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Ftrail-of-bits.png","trailofbits",[13,17,20,23],{"name":14,"slug":15,"type":16},"Security","security","tag",{"name":18,"slug":19,"type":16},"Architecture","architecture",{"name":21,"slug":22,"type":16},"Cryptography","cryptography",{"name":24,"slug":25,"type":16},"Code Analysis","code-analysis",6139,"https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Fskills","2026-07-17T06:05:26.672891",null,541,[32],"agent-skills",{"repoUrl":27,"stars":26,"forks":30,"topics":34,"description":35},[32],"Trail of Bits Claude Code skills for security research, vulnerability detection, and audit workflows","https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Fskills\u002Ftree\u002FHEAD\u002Fplugins\u002Fsharp-edges\u002Fskills\u002Fsharp-edges","---\nname: sharp-edges\ndescription: \"Identifies error-prone APIs, dangerous configurations, and footgun designs that enable security mistakes. Use when reviewing API designs, configuration schemas, cryptographic library ergonomics, or evaluating whether code follows 'secure by default' and 'pit of success' principles. Triggers: footgun, misuse-resistant, secure defaults, API usability, dangerous configuration.\"\nallowed-tools: Read Grep Glob\n---\n\n# Sharp Edges Analysis\n\nEvaluates whether APIs, configurations, and interfaces are resistant to developer misuse. Identifies designs where the \"easy path\" leads to insecurity.\n\n## When to Use\n\n- Reviewing API or library design decisions\n- Auditing configuration schemas for dangerous options\n- Evaluating cryptographic API ergonomics\n- Assessing authentication\u002Fauthorization interfaces\n- Reviewing any code that exposes security-relevant choices to developers\n\n## When NOT to Use\n\n- Implementation bugs (use standard code review)\n- Business logic flaws (use domain-specific analysis)\n- Performance optimization (different concern)\n\n## Agent\n\nThe `sharp-edges-analyzer` agent runs the full sharp edges analysis workflow autonomously. Use it when you want a dedicated analysis of APIs, configurations, or interfaces for misuse resistance and footgun potential. The agent follows the four-phase workflow (Surface Identification, Edge Case Probing, Threat Modeling, Validate Findings) and reads language-specific references on demand.\n\n## Core Principle\n\n**The pit of success**: Secure usage should be the path of least resistance. If developers must understand cryptography, read documentation carefully, or remember special rules to avoid vulnerabilities, the API has failed.\n\n## Rationalizations to Reject\n\n| Rationalization | Why It's Wrong | Required Action |\n|-----------------|----------------|-----------------|\n| \"It's documented\" | Developers don't read docs under deadline pressure | Make the secure choice the default or only option |\n| \"Advanced users need flexibility\" | Flexibility creates footguns; most \"advanced\" usage is copy-paste | Provide safe high-level APIs; hide primitives |\n| \"It's the developer's responsibility\" | Blame-shifting; you designed the footgun | Remove the footgun or make it impossible to misuse |\n| \"Nobody would actually do that\" | Developers do everything imaginable under pressure | Assume maximum developer confusion |\n| \"It's just a configuration option\" | Config is code; wrong configs ship to production | Validate configs; reject dangerous combinations |\n| \"We need backwards compatibility\" | Insecure defaults can't be grandfather-claused | Deprecate loudly; force migration |\n\n## Sharp Edge Categories\n\n### 1. Algorithm\u002FMode Selection Footguns\n\nAPIs that let developers choose algorithms invite choosing wrong ones.\n\n**The JWT Pattern** (canonical example):\n- Header specifies algorithm: attacker can set `\"alg\": \"none\"` to bypass signatures\n- Algorithm confusion: RSA public key used as HMAC secret when switching RS256→HS256\n- Root cause: Letting untrusted input control security-critical decisions\n\n**Detection patterns:**\n- Function parameters like `algorithm`, `mode`, `cipher`, `hash_type`\n- Enums\u002Fstrings selecting cryptographic primitives\n- Configuration options for security mechanisms\n\n**Example - PHP password_hash allowing weak algorithms:**\n```php\n\u002F\u002F DANGEROUS: allows crc32, md5, sha1\npassword_hash($password, PASSWORD_DEFAULT); \u002F\u002F Good - no choice\nhash($algorithm, $password); \u002F\u002F BAD: accepts \"crc32\"\n```\n\n### 2. Dangerous Defaults\n\nDefaults that are insecure, or zero\u002Fempty values that disable security.\n\n**The OTP Lifetime Pattern:**\n```python\n# What happens when lifetime=0?\ndef verify_otp(code, lifetime=300):  # 300 seconds default\n    if lifetime == 0:\n        return True  # OOPS: 0 means \"accept all\"?\n        # Or does it mean \"expired immediately\"?\n```\n\n**Detection patterns:**\n- Timeouts\u002Flifetimes that accept 0 (infinite? immediate expiry?)\n- Empty strings that bypass checks\n- Null values that skip validation\n- Boolean defaults that disable security features\n- Negative values with undefined semantics\n\n**Questions to ask:**\n- What happens with `timeout=0`? `max_attempts=0`? `key=\"\"`?\n- Is the default the most secure option?\n- Can any default value disable security entirely?\n\n### 3. Primitive vs. Semantic APIs\n\nAPIs that expose raw bytes instead of meaningful types invite type confusion.\n\n**The Libsodium vs. Halite Pattern:**\n\n```php\n\u002F\u002F Libsodium (primitives): bytes are bytes\nsodium_crypto_box($message, $nonce, $keypair);\n\u002F\u002F Easy to: swap nonce\u002Fkeypair, reuse nonces, use wrong key type\n\n\u002F\u002F Halite (semantic): types enforce correct usage\nCrypto::seal($message, new EncryptionPublicKey($key));\n\u002F\u002F Wrong key type = type error, not silent failure\n```\n\n**Detection patterns:**\n- Functions taking `bytes`, `string`, `[]byte` for distinct security concepts\n- Parameters that could be swapped without type errors\n- Same type used for keys, nonces, ciphertexts, signatures\n\n**The comparison footgun:**\n```go\n\u002F\u002F Timing-safe comparison looks identical to unsafe\nif hmac == expected { }           \u002F\u002F BAD: timing attack\nif hmac.Equal(mac, expected) { }  \u002F\u002F Good: constant-time\n\u002F\u002F Same types, different security properties\n```\n\n### 4. Configuration Cliffs\n\nOne wrong setting creates catastrophic failure, with no warning.\n\n**Detection patterns:**\n- Boolean flags that disable security entirely\n- String configs that aren't validated\n- Combinations of settings that interact dangerously\n- Environment variables that override security settings\n- Constructor parameters with sensible defaults but no validation (callers can override with insecure values)\n\n**Examples:**\n```yaml\n# One typo = disaster\nverify_ssl: fasle  # Typo silently accepted as truthy?\n\n# Magic values\nsession_timeout: -1  # Does this mean \"never expire\"?\n\n# Dangerous combinations accepted silently\nauth_required: true\nbypass_auth_for_health_checks: true\nhealth_check_path: \"\u002F\"  # Oops\n```\n\n```php\n\u002F\u002F Sensible default doesn't protect against bad callers\npublic function __construct(\n    public string $hashAlgo = 'sha256',  \u002F\u002F Good default...\n    public int $otpLifetime = 120,       \u002F\u002F ...but accepts md5, 0, etc.\n) {}\n```\n\nSee [config-patterns.md](references\u002Fconfig-patterns.md#unvalidated-constructor-parameters) for detailed patterns.\n\n### 5. Silent Failures\n\nErrors that don't surface, or success that masks failure.\n\n**Detection patterns:**\n- Functions returning booleans instead of throwing on security failures\n- Empty catch blocks around security operations\n- Default values substituted on parse errors\n- Verification functions that \"succeed\" on malformed input\n\n**Examples:**\n```python\n# Silent bypass\ndef verify_signature(sig, data, key):\n    if not key:\n        return True  # No key = skip verification?!\n\n# Return value ignored\nsignature.verify(data, sig)  # Throws on failure\ncrypto.verify(data, sig)     # Returns False on failure\n# Developer forgets to check return value\n```\n\n### 6. Stringly-Typed Security\n\nSecurity-critical values as plain strings enable injection and confusion.\n\n**Detection patterns:**\n- SQL\u002Fcommands built from string concatenation\n- Permissions as comma-separated strings\n- Roles\u002Fscopes as arbitrary strings instead of enums\n- URLs constructed by joining strings\n\n**The permission accumulation footgun:**\n```python\npermissions = \"read,write\"\npermissions += \",admin\"  # Too easy to escalate\n\n# vs. type-safe\npermissions = {Permission.READ, Permission.WRITE}\npermissions.add(Permission.ADMIN)  # At least it's explicit\n```\n\n## Analysis Workflow\n\n### Phase 1: Surface Identification\n\n1. **Map security-relevant APIs**: authentication, authorization, cryptography, session management, input validation\n2. **Identify developer choice points**: Where can developers select algorithms, configure timeouts, choose modes?\n3. **Find configuration schemas**: Environment variables, config files, constructor parameters\n\n### Phase 2: Edge Case Probing\n\nFor each choice point, ask:\n- **Zero\u002Fempty\u002Fnull**: What happens with `0`, `\"\"`, `null`, `[]`?\n- **Negative values**: What does `-1` mean? Infinite? Error?\n- **Type confusion**: Can different security concepts be swapped?\n- **Default values**: Is the default secure? Is it documented?\n- **Error paths**: What happens on invalid input? Silent acceptance?\n\n### Phase 3: Threat Modeling\n\nConsider three adversaries:\n\n1. **The Scoundrel**: Actively malicious developer or attacker controlling config\n   - Can they disable security via configuration?\n   - Can they downgrade algorithms?\n   - Can they inject malicious values?\n\n2. **The Lazy Developer**: Copy-pastes examples, skips documentation\n   - Will the first example they find be secure?\n   - Is the path of least resistance secure?\n   - Do error messages guide toward secure usage?\n\n3. **The Confused Developer**: Misunderstands the API\n   - Can they swap parameters without type errors?\n   - Can they use the wrong key\u002Falgorithm\u002Fmode by accident?\n   - Are failure modes obvious or silent?\n\n### Phase 4: Validate Findings\n\nFor each identified sharp edge:\n\n1. **Reproduce the misuse**: Write minimal code demonstrating the footgun\n2. **Verify exploitability**: Does the misuse create a real vulnerability?\n3. **Check documentation**: Is the danger documented? (Documentation doesn't excuse bad design, but affects severity)\n4. **Test mitigations**: Can the API be used safely with reasonable effort?\n\nIf a finding seems questionable, return to Phase 2 and probe more edge cases.\n\n## Severity Classification\n\n| Severity | Criteria | Examples |\n|----------|----------|----------|\n| Critical | Default or obvious usage is insecure | `verify: false` default; empty password allowed |\n| High | Easy misconfiguration breaks security | Algorithm parameter accepts \"none\" |\n| Medium | Unusual but possible misconfiguration | Negative timeout has unexpected meaning |\n| Low | Requires deliberate misuse | Obscure parameter combination |\n\n## References\n\n**By category:**\n\n- **Cryptographic APIs**: See [references\u002Fcrypto-apis.md](references\u002Fcrypto-apis.md)\n- **Configuration Patterns**: See [references\u002Fconfig-patterns.md](references\u002Fconfig-patterns.md)\n- **Authentication\u002FSession**: See [references\u002Fauth-patterns.md](references\u002Fauth-patterns.md)\n- **Real-World Case Studies**: See [references\u002Fcase-studies.md](references\u002Fcase-studies.md) (OpenSSL, GMP, etc.)\n\n**By language** (general footguns, not crypto-specific):\n\n| Language | Guide |\n|----------|-------|\n| C\u002FC++ | [references\u002Flang-c.md](references\u002Flang-c.md) |\n| Go | [references\u002Flang-go.md](references\u002Flang-go.md) |\n| Rust | [references\u002Flang-rust.md](references\u002Flang-rust.md) |\n| Swift | [references\u002Flang-swift.md](references\u002Flang-swift.md) |\n| Java | [references\u002Flang-java.md](references\u002Flang-java.md) |\n| Kotlin | [references\u002Flang-kotlin.md](references\u002Flang-kotlin.md) |\n| C# | [references\u002Flang-csharp.md](references\u002Flang-csharp.md) |\n| PHP | [references\u002Flang-php.md](references\u002Flang-php.md) |\n| JavaScript\u002FTypeScript | [references\u002Flang-javascript.md](references\u002Flang-javascript.md) |\n| Python | [references\u002Flang-python.md](references\u002Flang-python.md) |\n| Ruby | [references\u002Flang-ruby.md](references\u002Flang-ruby.md) |\n\nSee also [references\u002Flanguage-specific.md](references\u002Flanguage-specific.md) for a combined quick reference.\n\n## Quality Checklist\n\nBefore concluding analysis:\n\n- [ ] Probed all zero\u002Fempty\u002Fnull edge cases\n- [ ] Verified defaults are secure\n- [ ] Checked for algorithm\u002Fmode selection footguns\n- [ ] Tested type confusion between security concepts\n- [ ] Considered all three adversary types\n- [ ] Verified error paths don't bypass security\n- [ ] Checked configuration validation\n- [ ] Constructor params validated (not just defaulted) - see [config-patterns.md](references\u002Fconfig-patterns.md#unvalidated-constructor-parameters)\n",{"data":39,"body":41},{"name":4,"description":6,"allowed-tools":40},"Read Grep Glob",{"type":42,"children":43},"root",[44,53,59,66,96,102,120,126,140,146,157,163,304,310,317,322,332,358,366,412,420,460,466,471,479,530,537,565,573,614,620,625,633,699,706,746,754,795,801,806,813,841,849,1015,1062,1076,1082,1087,1094,1117,1124,1202,1208,1213,1220,1243,1251,1305,1311,1317,1351,1357,1362,1451,1457,1462,1549,1555,1560,1603,1608,1614,1719,1725,1733,1795,1805,2003,2015,2021,2026,2110],{"type":45,"tag":46,"props":47,"children":49},"element","h1",{"id":48},"sharp-edges-analysis",[50],{"type":51,"value":52},"text","Sharp Edges Analysis",{"type":45,"tag":54,"props":55,"children":56},"p",{},[57],{"type":51,"value":58},"Evaluates whether APIs, configurations, and interfaces are resistant to developer misuse. Identifies designs where the \"easy path\" leads to insecurity.",{"type":45,"tag":60,"props":61,"children":63},"h2",{"id":62},"when-to-use",[64],{"type":51,"value":65},"When to Use",{"type":45,"tag":67,"props":68,"children":69},"ul",{},[70,76,81,86,91],{"type":45,"tag":71,"props":72,"children":73},"li",{},[74],{"type":51,"value":75},"Reviewing API or library design decisions",{"type":45,"tag":71,"props":77,"children":78},{},[79],{"type":51,"value":80},"Auditing configuration schemas for dangerous options",{"type":45,"tag":71,"props":82,"children":83},{},[84],{"type":51,"value":85},"Evaluating cryptographic API ergonomics",{"type":45,"tag":71,"props":87,"children":88},{},[89],{"type":51,"value":90},"Assessing authentication\u002Fauthorization interfaces",{"type":45,"tag":71,"props":92,"children":93},{},[94],{"type":51,"value":95},"Reviewing any code that exposes security-relevant choices to developers",{"type":45,"tag":60,"props":97,"children":99},{"id":98},"when-not-to-use",[100],{"type":51,"value":101},"When NOT to Use",{"type":45,"tag":67,"props":103,"children":104},{},[105,110,115],{"type":45,"tag":71,"props":106,"children":107},{},[108],{"type":51,"value":109},"Implementation bugs (use standard code review)",{"type":45,"tag":71,"props":111,"children":112},{},[113],{"type":51,"value":114},"Business logic flaws (use domain-specific analysis)",{"type":45,"tag":71,"props":116,"children":117},{},[118],{"type":51,"value":119},"Performance optimization (different concern)",{"type":45,"tag":60,"props":121,"children":123},{"id":122},"agent",[124],{"type":51,"value":125},"Agent",{"type":45,"tag":54,"props":127,"children":128},{},[129,131,138],{"type":51,"value":130},"The ",{"type":45,"tag":132,"props":133,"children":135},"code",{"className":134},[],[136],{"type":51,"value":137},"sharp-edges-analyzer",{"type":51,"value":139}," agent runs the full sharp edges analysis workflow autonomously. Use it when you want a dedicated analysis of APIs, configurations, or interfaces for misuse resistance and footgun potential. The agent follows the four-phase workflow (Surface Identification, Edge Case Probing, Threat Modeling, Validate Findings) and reads language-specific references on demand.",{"type":45,"tag":60,"props":141,"children":143},{"id":142},"core-principle",[144],{"type":51,"value":145},"Core Principle",{"type":45,"tag":54,"props":147,"children":148},{},[149,155],{"type":45,"tag":150,"props":151,"children":152},"strong",{},[153],{"type":51,"value":154},"The pit of success",{"type":51,"value":156},": Secure usage should be the path of least resistance. If developers must understand cryptography, read documentation carefully, or remember special rules to avoid vulnerabilities, the API has failed.",{"type":45,"tag":60,"props":158,"children":160},{"id":159},"rationalizations-to-reject",[161],{"type":51,"value":162},"Rationalizations to Reject",{"type":45,"tag":164,"props":165,"children":166},"table",{},[167,191],{"type":45,"tag":168,"props":169,"children":170},"thead",{},[171],{"type":45,"tag":172,"props":173,"children":174},"tr",{},[175,181,186],{"type":45,"tag":176,"props":177,"children":178},"th",{},[179],{"type":51,"value":180},"Rationalization",{"type":45,"tag":176,"props":182,"children":183},{},[184],{"type":51,"value":185},"Why It's Wrong",{"type":45,"tag":176,"props":187,"children":188},{},[189],{"type":51,"value":190},"Required Action",{"type":45,"tag":192,"props":193,"children":194},"tbody",{},[195,214,232,250,268,286],{"type":45,"tag":172,"props":196,"children":197},{},[198,204,209],{"type":45,"tag":199,"props":200,"children":201},"td",{},[202],{"type":51,"value":203},"\"It's documented\"",{"type":45,"tag":199,"props":205,"children":206},{},[207],{"type":51,"value":208},"Developers don't read docs under deadline pressure",{"type":45,"tag":199,"props":210,"children":211},{},[212],{"type":51,"value":213},"Make the secure choice the default or only option",{"type":45,"tag":172,"props":215,"children":216},{},[217,222,227],{"type":45,"tag":199,"props":218,"children":219},{},[220],{"type":51,"value":221},"\"Advanced users need flexibility\"",{"type":45,"tag":199,"props":223,"children":224},{},[225],{"type":51,"value":226},"Flexibility creates footguns; most \"advanced\" usage is copy-paste",{"type":45,"tag":199,"props":228,"children":229},{},[230],{"type":51,"value":231},"Provide safe high-level APIs; hide primitives",{"type":45,"tag":172,"props":233,"children":234},{},[235,240,245],{"type":45,"tag":199,"props":236,"children":237},{},[238],{"type":51,"value":239},"\"It's the developer's responsibility\"",{"type":45,"tag":199,"props":241,"children":242},{},[243],{"type":51,"value":244},"Blame-shifting; you designed the footgun",{"type":45,"tag":199,"props":246,"children":247},{},[248],{"type":51,"value":249},"Remove the footgun or make it impossible to misuse",{"type":45,"tag":172,"props":251,"children":252},{},[253,258,263],{"type":45,"tag":199,"props":254,"children":255},{},[256],{"type":51,"value":257},"\"Nobody would actually do that\"",{"type":45,"tag":199,"props":259,"children":260},{},[261],{"type":51,"value":262},"Developers do everything imaginable under pressure",{"type":45,"tag":199,"props":264,"children":265},{},[266],{"type":51,"value":267},"Assume maximum developer confusion",{"type":45,"tag":172,"props":269,"children":270},{},[271,276,281],{"type":45,"tag":199,"props":272,"children":273},{},[274],{"type":51,"value":275},"\"It's just a configuration option\"",{"type":45,"tag":199,"props":277,"children":278},{},[279],{"type":51,"value":280},"Config is code; wrong configs ship to production",{"type":45,"tag":199,"props":282,"children":283},{},[284],{"type":51,"value":285},"Validate configs; reject dangerous combinations",{"type":45,"tag":172,"props":287,"children":288},{},[289,294,299],{"type":45,"tag":199,"props":290,"children":291},{},[292],{"type":51,"value":293},"\"We need backwards compatibility\"",{"type":45,"tag":199,"props":295,"children":296},{},[297],{"type":51,"value":298},"Insecure defaults can't be grandfather-claused",{"type":45,"tag":199,"props":300,"children":301},{},[302],{"type":51,"value":303},"Deprecate loudly; force migration",{"type":45,"tag":60,"props":305,"children":307},{"id":306},"sharp-edge-categories",[308],{"type":51,"value":309},"Sharp Edge Categories",{"type":45,"tag":311,"props":312,"children":314},"h3",{"id":313},"_1-algorithmmode-selection-footguns",[315],{"type":51,"value":316},"1. Algorithm\u002FMode Selection Footguns",{"type":45,"tag":54,"props":318,"children":319},{},[320],{"type":51,"value":321},"APIs that let developers choose algorithms invite choosing wrong ones.",{"type":45,"tag":54,"props":323,"children":324},{},[325,330],{"type":45,"tag":150,"props":326,"children":327},{},[328],{"type":51,"value":329},"The JWT Pattern",{"type":51,"value":331}," (canonical example):",{"type":45,"tag":67,"props":333,"children":334},{},[335,348,353],{"type":45,"tag":71,"props":336,"children":337},{},[338,340,346],{"type":51,"value":339},"Header specifies algorithm: attacker can set ",{"type":45,"tag":132,"props":341,"children":343},{"className":342},[],[344],{"type":51,"value":345},"\"alg\": \"none\"",{"type":51,"value":347}," to bypass signatures",{"type":45,"tag":71,"props":349,"children":350},{},[351],{"type":51,"value":352},"Algorithm confusion: RSA public key used as HMAC secret when switching RS256→HS256",{"type":45,"tag":71,"props":354,"children":355},{},[356],{"type":51,"value":357},"Root cause: Letting untrusted input control security-critical decisions",{"type":45,"tag":54,"props":359,"children":360},{},[361],{"type":45,"tag":150,"props":362,"children":363},{},[364],{"type":51,"value":365},"Detection patterns:",{"type":45,"tag":67,"props":367,"children":368},{},[369,402,407],{"type":45,"tag":71,"props":370,"children":371},{},[372,374,380,382,388,389,395,396],{"type":51,"value":373},"Function parameters like ",{"type":45,"tag":132,"props":375,"children":377},{"className":376},[],[378],{"type":51,"value":379},"algorithm",{"type":51,"value":381},", ",{"type":45,"tag":132,"props":383,"children":385},{"className":384},[],[386],{"type":51,"value":387},"mode",{"type":51,"value":381},{"type":45,"tag":132,"props":390,"children":392},{"className":391},[],[393],{"type":51,"value":394},"cipher",{"type":51,"value":381},{"type":45,"tag":132,"props":397,"children":399},{"className":398},[],[400],{"type":51,"value":401},"hash_type",{"type":45,"tag":71,"props":403,"children":404},{},[405],{"type":51,"value":406},"Enums\u002Fstrings selecting cryptographic primitives",{"type":45,"tag":71,"props":408,"children":409},{},[410],{"type":51,"value":411},"Configuration options for security mechanisms",{"type":45,"tag":54,"props":413,"children":414},{},[415],{"type":45,"tag":150,"props":416,"children":417},{},[418],{"type":51,"value":419},"Example - PHP password_hash allowing weak algorithms:",{"type":45,"tag":421,"props":422,"children":427},"pre",{"className":423,"code":424,"language":425,"meta":426,"style":426},"language-php shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F DANGEROUS: allows crc32, md5, sha1\npassword_hash($password, PASSWORD_DEFAULT); \u002F\u002F Good - no choice\nhash($algorithm, $password); \u002F\u002F BAD: accepts \"crc32\"\n","php","",[428],{"type":45,"tag":132,"props":429,"children":430},{"__ignoreMap":426},[431,442,451],{"type":45,"tag":432,"props":433,"children":436},"span",{"class":434,"line":435},"line",1,[437],{"type":45,"tag":432,"props":438,"children":439},{},[440],{"type":51,"value":441},"\u002F\u002F DANGEROUS: allows crc32, md5, sha1\n",{"type":45,"tag":432,"props":443,"children":445},{"class":434,"line":444},2,[446],{"type":45,"tag":432,"props":447,"children":448},{},[449],{"type":51,"value":450},"password_hash($password, PASSWORD_DEFAULT); \u002F\u002F Good - no choice\n",{"type":45,"tag":432,"props":452,"children":454},{"class":434,"line":453},3,[455],{"type":45,"tag":432,"props":456,"children":457},{},[458],{"type":51,"value":459},"hash($algorithm, $password); \u002F\u002F BAD: accepts \"crc32\"\n",{"type":45,"tag":311,"props":461,"children":463},{"id":462},"_2-dangerous-defaults",[464],{"type":51,"value":465},"2. Dangerous Defaults",{"type":45,"tag":54,"props":467,"children":468},{},[469],{"type":51,"value":470},"Defaults that are insecure, or zero\u002Fempty values that disable security.",{"type":45,"tag":54,"props":472,"children":473},{},[474],{"type":45,"tag":150,"props":475,"children":476},{},[477],{"type":51,"value":478},"The OTP Lifetime Pattern:",{"type":45,"tag":421,"props":480,"children":484},{"className":481,"code":482,"language":483,"meta":426,"style":426},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# What happens when lifetime=0?\ndef verify_otp(code, lifetime=300):  # 300 seconds default\n    if lifetime == 0:\n        return True  # OOPS: 0 means \"accept all\"?\n        # Or does it mean \"expired immediately\"?\n","python",[485],{"type":45,"tag":132,"props":486,"children":487},{"__ignoreMap":426},[488,496,504,512,521],{"type":45,"tag":432,"props":489,"children":490},{"class":434,"line":435},[491],{"type":45,"tag":432,"props":492,"children":493},{},[494],{"type":51,"value":495},"# What happens when lifetime=0?\n",{"type":45,"tag":432,"props":497,"children":498},{"class":434,"line":444},[499],{"type":45,"tag":432,"props":500,"children":501},{},[502],{"type":51,"value":503},"def verify_otp(code, lifetime=300):  # 300 seconds default\n",{"type":45,"tag":432,"props":505,"children":506},{"class":434,"line":453},[507],{"type":45,"tag":432,"props":508,"children":509},{},[510],{"type":51,"value":511},"    if lifetime == 0:\n",{"type":45,"tag":432,"props":513,"children":515},{"class":434,"line":514},4,[516],{"type":45,"tag":432,"props":517,"children":518},{},[519],{"type":51,"value":520},"        return True  # OOPS: 0 means \"accept all\"?\n",{"type":45,"tag":432,"props":522,"children":524},{"class":434,"line":523},5,[525],{"type":45,"tag":432,"props":526,"children":527},{},[528],{"type":51,"value":529},"        # Or does it mean \"expired immediately\"?\n",{"type":45,"tag":54,"props":531,"children":532},{},[533],{"type":45,"tag":150,"props":534,"children":535},{},[536],{"type":51,"value":365},{"type":45,"tag":67,"props":538,"children":539},{},[540,545,550,555,560],{"type":45,"tag":71,"props":541,"children":542},{},[543],{"type":51,"value":544},"Timeouts\u002Flifetimes that accept 0 (infinite? immediate expiry?)",{"type":45,"tag":71,"props":546,"children":547},{},[548],{"type":51,"value":549},"Empty strings that bypass checks",{"type":45,"tag":71,"props":551,"children":552},{},[553],{"type":51,"value":554},"Null values that skip validation",{"type":45,"tag":71,"props":556,"children":557},{},[558],{"type":51,"value":559},"Boolean defaults that disable security features",{"type":45,"tag":71,"props":561,"children":562},{},[563],{"type":51,"value":564},"Negative values with undefined semantics",{"type":45,"tag":54,"props":566,"children":567},{},[568],{"type":45,"tag":150,"props":569,"children":570},{},[571],{"type":51,"value":572},"Questions to ask:",{"type":45,"tag":67,"props":574,"children":575},{},[576,604,609],{"type":45,"tag":71,"props":577,"children":578},{},[579,581,587,589,595,596,602],{"type":51,"value":580},"What happens with ",{"type":45,"tag":132,"props":582,"children":584},{"className":583},[],[585],{"type":51,"value":586},"timeout=0",{"type":51,"value":588},"? ",{"type":45,"tag":132,"props":590,"children":592},{"className":591},[],[593],{"type":51,"value":594},"max_attempts=0",{"type":51,"value":588},{"type":45,"tag":132,"props":597,"children":599},{"className":598},[],[600],{"type":51,"value":601},"key=\"\"",{"type":51,"value":603},"?",{"type":45,"tag":71,"props":605,"children":606},{},[607],{"type":51,"value":608},"Is the default the most secure option?",{"type":45,"tag":71,"props":610,"children":611},{},[612],{"type":51,"value":613},"Can any default value disable security entirely?",{"type":45,"tag":311,"props":615,"children":617},{"id":616},"_3-primitive-vs-semantic-apis",[618],{"type":51,"value":619},"3. Primitive vs. Semantic APIs",{"type":45,"tag":54,"props":621,"children":622},{},[623],{"type":51,"value":624},"APIs that expose raw bytes instead of meaningful types invite type confusion.",{"type":45,"tag":54,"props":626,"children":627},{},[628],{"type":45,"tag":150,"props":629,"children":630},{},[631],{"type":51,"value":632},"The Libsodium vs. Halite Pattern:",{"type":45,"tag":421,"props":634,"children":636},{"className":423,"code":635,"language":425,"meta":426,"style":426},"\u002F\u002F Libsodium (primitives): bytes are bytes\nsodium_crypto_box($message, $nonce, $keypair);\n\u002F\u002F Easy to: swap nonce\u002Fkeypair, reuse nonces, use wrong key type\n\n\u002F\u002F Halite (semantic): types enforce correct usage\nCrypto::seal($message, new EncryptionPublicKey($key));\n\u002F\u002F Wrong key type = type error, not silent failure\n",[637],{"type":45,"tag":132,"props":638,"children":639},{"__ignoreMap":426},[640,648,656,664,673,681,690],{"type":45,"tag":432,"props":641,"children":642},{"class":434,"line":435},[643],{"type":45,"tag":432,"props":644,"children":645},{},[646],{"type":51,"value":647},"\u002F\u002F Libsodium (primitives): bytes are bytes\n",{"type":45,"tag":432,"props":649,"children":650},{"class":434,"line":444},[651],{"type":45,"tag":432,"props":652,"children":653},{},[654],{"type":51,"value":655},"sodium_crypto_box($message, $nonce, $keypair);\n",{"type":45,"tag":432,"props":657,"children":658},{"class":434,"line":453},[659],{"type":45,"tag":432,"props":660,"children":661},{},[662],{"type":51,"value":663},"\u002F\u002F Easy to: swap nonce\u002Fkeypair, reuse nonces, use wrong key type\n",{"type":45,"tag":432,"props":665,"children":666},{"class":434,"line":514},[667],{"type":45,"tag":432,"props":668,"children":670},{"emptyLinePlaceholder":669},true,[671],{"type":51,"value":672},"\n",{"type":45,"tag":432,"props":674,"children":675},{"class":434,"line":523},[676],{"type":45,"tag":432,"props":677,"children":678},{},[679],{"type":51,"value":680},"\u002F\u002F Halite (semantic): types enforce correct usage\n",{"type":45,"tag":432,"props":682,"children":684},{"class":434,"line":683},6,[685],{"type":45,"tag":432,"props":686,"children":687},{},[688],{"type":51,"value":689},"Crypto::seal($message, new EncryptionPublicKey($key));\n",{"type":45,"tag":432,"props":691,"children":693},{"class":434,"line":692},7,[694],{"type":45,"tag":432,"props":695,"children":696},{},[697],{"type":51,"value":698},"\u002F\u002F Wrong key type = type error, not silent failure\n",{"type":45,"tag":54,"props":700,"children":701},{},[702],{"type":45,"tag":150,"props":703,"children":704},{},[705],{"type":51,"value":365},{"type":45,"tag":67,"props":707,"children":708},{},[709,736,741],{"type":45,"tag":71,"props":710,"children":711},{},[712,714,720,721,727,728,734],{"type":51,"value":713},"Functions taking ",{"type":45,"tag":132,"props":715,"children":717},{"className":716},[],[718],{"type":51,"value":719},"bytes",{"type":51,"value":381},{"type":45,"tag":132,"props":722,"children":724},{"className":723},[],[725],{"type":51,"value":726},"string",{"type":51,"value":381},{"type":45,"tag":132,"props":729,"children":731},{"className":730},[],[732],{"type":51,"value":733},"[]byte",{"type":51,"value":735}," for distinct security concepts",{"type":45,"tag":71,"props":737,"children":738},{},[739],{"type":51,"value":740},"Parameters that could be swapped without type errors",{"type":45,"tag":71,"props":742,"children":743},{},[744],{"type":51,"value":745},"Same type used for keys, nonces, ciphertexts, signatures",{"type":45,"tag":54,"props":747,"children":748},{},[749],{"type":45,"tag":150,"props":750,"children":751},{},[752],{"type":51,"value":753},"The comparison footgun:",{"type":45,"tag":421,"props":755,"children":759},{"className":756,"code":757,"language":758,"meta":426,"style":426},"language-go shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F Timing-safe comparison looks identical to unsafe\nif hmac == expected { }           \u002F\u002F BAD: timing attack\nif hmac.Equal(mac, expected) { }  \u002F\u002F Good: constant-time\n\u002F\u002F Same types, different security properties\n","go",[760],{"type":45,"tag":132,"props":761,"children":762},{"__ignoreMap":426},[763,771,779,787],{"type":45,"tag":432,"props":764,"children":765},{"class":434,"line":435},[766],{"type":45,"tag":432,"props":767,"children":768},{},[769],{"type":51,"value":770},"\u002F\u002F Timing-safe comparison looks identical to unsafe\n",{"type":45,"tag":432,"props":772,"children":773},{"class":434,"line":444},[774],{"type":45,"tag":432,"props":775,"children":776},{},[777],{"type":51,"value":778},"if hmac == expected { }           \u002F\u002F BAD: timing attack\n",{"type":45,"tag":432,"props":780,"children":781},{"class":434,"line":453},[782],{"type":45,"tag":432,"props":783,"children":784},{},[785],{"type":51,"value":786},"if hmac.Equal(mac, expected) { }  \u002F\u002F Good: constant-time\n",{"type":45,"tag":432,"props":788,"children":789},{"class":434,"line":514},[790],{"type":45,"tag":432,"props":791,"children":792},{},[793],{"type":51,"value":794},"\u002F\u002F Same types, different security properties\n",{"type":45,"tag":311,"props":796,"children":798},{"id":797},"_4-configuration-cliffs",[799],{"type":51,"value":800},"4. Configuration Cliffs",{"type":45,"tag":54,"props":802,"children":803},{},[804],{"type":51,"value":805},"One wrong setting creates catastrophic failure, with no warning.",{"type":45,"tag":54,"props":807,"children":808},{},[809],{"type":45,"tag":150,"props":810,"children":811},{},[812],{"type":51,"value":365},{"type":45,"tag":67,"props":814,"children":815},{},[816,821,826,831,836],{"type":45,"tag":71,"props":817,"children":818},{},[819],{"type":51,"value":820},"Boolean flags that disable security entirely",{"type":45,"tag":71,"props":822,"children":823},{},[824],{"type":51,"value":825},"String configs that aren't validated",{"type":45,"tag":71,"props":827,"children":828},{},[829],{"type":51,"value":830},"Combinations of settings that interact dangerously",{"type":45,"tag":71,"props":832,"children":833},{},[834],{"type":51,"value":835},"Environment variables that override security settings",{"type":45,"tag":71,"props":837,"children":838},{},[839],{"type":51,"value":840},"Constructor parameters with sensible defaults but no validation (callers can override with insecure values)",{"type":45,"tag":54,"props":842,"children":843},{},[844],{"type":45,"tag":150,"props":845,"children":846},{},[847],{"type":51,"value":848},"Examples:",{"type":45,"tag":421,"props":850,"children":854},{"className":851,"code":852,"language":853,"meta":426,"style":426},"language-yaml shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# One typo = disaster\nverify_ssl: fasle  # Typo silently accepted as truthy?\n\n# Magic values\nsession_timeout: -1  # Does this mean \"never expire\"?\n\n# Dangerous combinations accepted silently\nauth_required: true\nbypass_auth_for_health_checks: true\nhealth_check_path: \"\u002F\"  # Oops\n","yaml",[855],{"type":45,"tag":132,"props":856,"children":857},{"__ignoreMap":426},[858,867,893,900,908,931,938,946,965,982],{"type":45,"tag":432,"props":859,"children":860},{"class":434,"line":435},[861],{"type":45,"tag":432,"props":862,"children":864},{"style":863},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[865],{"type":51,"value":866},"# One typo = disaster\n",{"type":45,"tag":432,"props":868,"children":869},{"class":434,"line":444},[870,876,882,888],{"type":45,"tag":432,"props":871,"children":873},{"style":872},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[874],{"type":51,"value":875},"verify_ssl",{"type":45,"tag":432,"props":877,"children":879},{"style":878},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[880],{"type":51,"value":881},":",{"type":45,"tag":432,"props":883,"children":885},{"style":884},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[886],{"type":51,"value":887}," fasle",{"type":45,"tag":432,"props":889,"children":890},{"style":863},[891],{"type":51,"value":892},"  # Typo silently accepted as truthy?\n",{"type":45,"tag":432,"props":894,"children":895},{"class":434,"line":453},[896],{"type":45,"tag":432,"props":897,"children":898},{"emptyLinePlaceholder":669},[899],{"type":51,"value":672},{"type":45,"tag":432,"props":901,"children":902},{"class":434,"line":514},[903],{"type":45,"tag":432,"props":904,"children":905},{"style":863},[906],{"type":51,"value":907},"# Magic values\n",{"type":45,"tag":432,"props":909,"children":910},{"class":434,"line":523},[911,916,920,926],{"type":45,"tag":432,"props":912,"children":913},{"style":872},[914],{"type":51,"value":915},"session_timeout",{"type":45,"tag":432,"props":917,"children":918},{"style":878},[919],{"type":51,"value":881},{"type":45,"tag":432,"props":921,"children":923},{"style":922},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[924],{"type":51,"value":925}," -1",{"type":45,"tag":432,"props":927,"children":928},{"style":863},[929],{"type":51,"value":930},"  # Does this mean \"never expire\"?\n",{"type":45,"tag":432,"props":932,"children":933},{"class":434,"line":683},[934],{"type":45,"tag":432,"props":935,"children":936},{"emptyLinePlaceholder":669},[937],{"type":51,"value":672},{"type":45,"tag":432,"props":939,"children":940},{"class":434,"line":692},[941],{"type":45,"tag":432,"props":942,"children":943},{"style":863},[944],{"type":51,"value":945},"# Dangerous combinations accepted silently\n",{"type":45,"tag":432,"props":947,"children":949},{"class":434,"line":948},8,[950,955,959],{"type":45,"tag":432,"props":951,"children":952},{"style":872},[953],{"type":51,"value":954},"auth_required",{"type":45,"tag":432,"props":956,"children":957},{"style":878},[958],{"type":51,"value":881},{"type":45,"tag":432,"props":960,"children":962},{"style":961},"--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC",[963],{"type":51,"value":964}," true\n",{"type":45,"tag":432,"props":966,"children":968},{"class":434,"line":967},9,[969,974,978],{"type":45,"tag":432,"props":970,"children":971},{"style":872},[972],{"type":51,"value":973},"bypass_auth_for_health_checks",{"type":45,"tag":432,"props":975,"children":976},{"style":878},[977],{"type":51,"value":881},{"type":45,"tag":432,"props":979,"children":980},{"style":961},[981],{"type":51,"value":964},{"type":45,"tag":432,"props":983,"children":985},{"class":434,"line":984},10,[986,991,995,1000,1005,1010],{"type":45,"tag":432,"props":987,"children":988},{"style":872},[989],{"type":51,"value":990},"health_check_path",{"type":45,"tag":432,"props":992,"children":993},{"style":878},[994],{"type":51,"value":881},{"type":45,"tag":432,"props":996,"children":997},{"style":878},[998],{"type":51,"value":999}," \"",{"type":45,"tag":432,"props":1001,"children":1002},{"style":884},[1003],{"type":51,"value":1004},"\u002F",{"type":45,"tag":432,"props":1006,"children":1007},{"style":878},[1008],{"type":51,"value":1009},"\"",{"type":45,"tag":432,"props":1011,"children":1012},{"style":863},[1013],{"type":51,"value":1014},"  # Oops\n",{"type":45,"tag":421,"props":1016,"children":1018},{"className":423,"code":1017,"language":425,"meta":426,"style":426},"\u002F\u002F Sensible default doesn't protect against bad callers\npublic function __construct(\n    public string $hashAlgo = 'sha256',  \u002F\u002F Good default...\n    public int $otpLifetime = 120,       \u002F\u002F ...but accepts md5, 0, etc.\n) {}\n",[1019],{"type":45,"tag":132,"props":1020,"children":1021},{"__ignoreMap":426},[1022,1030,1038,1046,1054],{"type":45,"tag":432,"props":1023,"children":1024},{"class":434,"line":435},[1025],{"type":45,"tag":432,"props":1026,"children":1027},{},[1028],{"type":51,"value":1029},"\u002F\u002F Sensible default doesn't protect against bad callers\n",{"type":45,"tag":432,"props":1031,"children":1032},{"class":434,"line":444},[1033],{"type":45,"tag":432,"props":1034,"children":1035},{},[1036],{"type":51,"value":1037},"public function __construct(\n",{"type":45,"tag":432,"props":1039,"children":1040},{"class":434,"line":453},[1041],{"type":45,"tag":432,"props":1042,"children":1043},{},[1044],{"type":51,"value":1045},"    public string $hashAlgo = 'sha256',  \u002F\u002F Good default...\n",{"type":45,"tag":432,"props":1047,"children":1048},{"class":434,"line":514},[1049],{"type":45,"tag":432,"props":1050,"children":1051},{},[1052],{"type":51,"value":1053},"    public int $otpLifetime = 120,       \u002F\u002F ...but accepts md5, 0, etc.\n",{"type":45,"tag":432,"props":1055,"children":1056},{"class":434,"line":523},[1057],{"type":45,"tag":432,"props":1058,"children":1059},{},[1060],{"type":51,"value":1061},") {}\n",{"type":45,"tag":54,"props":1063,"children":1064},{},[1065,1067,1074],{"type":51,"value":1066},"See ",{"type":45,"tag":1068,"props":1069,"children":1071},"a",{"href":1070},"references\u002Fconfig-patterns.md#unvalidated-constructor-parameters",[1072],{"type":51,"value":1073},"config-patterns.md",{"type":51,"value":1075}," for detailed patterns.",{"type":45,"tag":311,"props":1077,"children":1079},{"id":1078},"_5-silent-failures",[1080],{"type":51,"value":1081},"5. Silent Failures",{"type":45,"tag":54,"props":1083,"children":1084},{},[1085],{"type":51,"value":1086},"Errors that don't surface, or success that masks failure.",{"type":45,"tag":54,"props":1088,"children":1089},{},[1090],{"type":45,"tag":150,"props":1091,"children":1092},{},[1093],{"type":51,"value":365},{"type":45,"tag":67,"props":1095,"children":1096},{},[1097,1102,1107,1112],{"type":45,"tag":71,"props":1098,"children":1099},{},[1100],{"type":51,"value":1101},"Functions returning booleans instead of throwing on security failures",{"type":45,"tag":71,"props":1103,"children":1104},{},[1105],{"type":51,"value":1106},"Empty catch blocks around security operations",{"type":45,"tag":71,"props":1108,"children":1109},{},[1110],{"type":51,"value":1111},"Default values substituted on parse errors",{"type":45,"tag":71,"props":1113,"children":1114},{},[1115],{"type":51,"value":1116},"Verification functions that \"succeed\" on malformed input",{"type":45,"tag":54,"props":1118,"children":1119},{},[1120],{"type":45,"tag":150,"props":1121,"children":1122},{},[1123],{"type":51,"value":848},{"type":45,"tag":421,"props":1125,"children":1127},{"className":481,"code":1126,"language":483,"meta":426,"style":426},"# Silent bypass\ndef verify_signature(sig, data, key):\n    if not key:\n        return True  # No key = skip verification?!\n\n# Return value ignored\nsignature.verify(data, sig)  # Throws on failure\ncrypto.verify(data, sig)     # Returns False on failure\n# Developer forgets to check return value\n",[1128],{"type":45,"tag":132,"props":1129,"children":1130},{"__ignoreMap":426},[1131,1139,1147,1155,1163,1170,1178,1186,1194],{"type":45,"tag":432,"props":1132,"children":1133},{"class":434,"line":435},[1134],{"type":45,"tag":432,"props":1135,"children":1136},{},[1137],{"type":51,"value":1138},"# Silent bypass\n",{"type":45,"tag":432,"props":1140,"children":1141},{"class":434,"line":444},[1142],{"type":45,"tag":432,"props":1143,"children":1144},{},[1145],{"type":51,"value":1146},"def verify_signature(sig, data, key):\n",{"type":45,"tag":432,"props":1148,"children":1149},{"class":434,"line":453},[1150],{"type":45,"tag":432,"props":1151,"children":1152},{},[1153],{"type":51,"value":1154},"    if not key:\n",{"type":45,"tag":432,"props":1156,"children":1157},{"class":434,"line":514},[1158],{"type":45,"tag":432,"props":1159,"children":1160},{},[1161],{"type":51,"value":1162},"        return True  # No key = skip verification?!\n",{"type":45,"tag":432,"props":1164,"children":1165},{"class":434,"line":523},[1166],{"type":45,"tag":432,"props":1167,"children":1168},{"emptyLinePlaceholder":669},[1169],{"type":51,"value":672},{"type":45,"tag":432,"props":1171,"children":1172},{"class":434,"line":683},[1173],{"type":45,"tag":432,"props":1174,"children":1175},{},[1176],{"type":51,"value":1177},"# Return value ignored\n",{"type":45,"tag":432,"props":1179,"children":1180},{"class":434,"line":692},[1181],{"type":45,"tag":432,"props":1182,"children":1183},{},[1184],{"type":51,"value":1185},"signature.verify(data, sig)  # Throws on failure\n",{"type":45,"tag":432,"props":1187,"children":1188},{"class":434,"line":948},[1189],{"type":45,"tag":432,"props":1190,"children":1191},{},[1192],{"type":51,"value":1193},"crypto.verify(data, sig)     # Returns False on failure\n",{"type":45,"tag":432,"props":1195,"children":1196},{"class":434,"line":967},[1197],{"type":45,"tag":432,"props":1198,"children":1199},{},[1200],{"type":51,"value":1201},"# Developer forgets to check return value\n",{"type":45,"tag":311,"props":1203,"children":1205},{"id":1204},"_6-stringly-typed-security",[1206],{"type":51,"value":1207},"6. Stringly-Typed Security",{"type":45,"tag":54,"props":1209,"children":1210},{},[1211],{"type":51,"value":1212},"Security-critical values as plain strings enable injection and confusion.",{"type":45,"tag":54,"props":1214,"children":1215},{},[1216],{"type":45,"tag":150,"props":1217,"children":1218},{},[1219],{"type":51,"value":365},{"type":45,"tag":67,"props":1221,"children":1222},{},[1223,1228,1233,1238],{"type":45,"tag":71,"props":1224,"children":1225},{},[1226],{"type":51,"value":1227},"SQL\u002Fcommands built from string concatenation",{"type":45,"tag":71,"props":1229,"children":1230},{},[1231],{"type":51,"value":1232},"Permissions as comma-separated strings",{"type":45,"tag":71,"props":1234,"children":1235},{},[1236],{"type":51,"value":1237},"Roles\u002Fscopes as arbitrary strings instead of enums",{"type":45,"tag":71,"props":1239,"children":1240},{},[1241],{"type":51,"value":1242},"URLs constructed by joining strings",{"type":45,"tag":54,"props":1244,"children":1245},{},[1246],{"type":45,"tag":150,"props":1247,"children":1248},{},[1249],{"type":51,"value":1250},"The permission accumulation footgun:",{"type":45,"tag":421,"props":1252,"children":1254},{"className":481,"code":1253,"language":483,"meta":426,"style":426},"permissions = \"read,write\"\npermissions += \",admin\"  # Too easy to escalate\n\n# vs. type-safe\npermissions = {Permission.READ, Permission.WRITE}\npermissions.add(Permission.ADMIN)  # At least it's explicit\n",[1255],{"type":45,"tag":132,"props":1256,"children":1257},{"__ignoreMap":426},[1258,1266,1274,1281,1289,1297],{"type":45,"tag":432,"props":1259,"children":1260},{"class":434,"line":435},[1261],{"type":45,"tag":432,"props":1262,"children":1263},{},[1264],{"type":51,"value":1265},"permissions = \"read,write\"\n",{"type":45,"tag":432,"props":1267,"children":1268},{"class":434,"line":444},[1269],{"type":45,"tag":432,"props":1270,"children":1271},{},[1272],{"type":51,"value":1273},"permissions += \",admin\"  # Too easy to escalate\n",{"type":45,"tag":432,"props":1275,"children":1276},{"class":434,"line":453},[1277],{"type":45,"tag":432,"props":1278,"children":1279},{"emptyLinePlaceholder":669},[1280],{"type":51,"value":672},{"type":45,"tag":432,"props":1282,"children":1283},{"class":434,"line":514},[1284],{"type":45,"tag":432,"props":1285,"children":1286},{},[1287],{"type":51,"value":1288},"# vs. type-safe\n",{"type":45,"tag":432,"props":1290,"children":1291},{"class":434,"line":523},[1292],{"type":45,"tag":432,"props":1293,"children":1294},{},[1295],{"type":51,"value":1296},"permissions = {Permission.READ, Permission.WRITE}\n",{"type":45,"tag":432,"props":1298,"children":1299},{"class":434,"line":683},[1300],{"type":45,"tag":432,"props":1301,"children":1302},{},[1303],{"type":51,"value":1304},"permissions.add(Permission.ADMIN)  # At least it's explicit\n",{"type":45,"tag":60,"props":1306,"children":1308},{"id":1307},"analysis-workflow",[1309],{"type":51,"value":1310},"Analysis Workflow",{"type":45,"tag":311,"props":1312,"children":1314},{"id":1313},"phase-1-surface-identification",[1315],{"type":51,"value":1316},"Phase 1: Surface Identification",{"type":45,"tag":1318,"props":1319,"children":1320},"ol",{},[1321,1331,1341],{"type":45,"tag":71,"props":1322,"children":1323},{},[1324,1329],{"type":45,"tag":150,"props":1325,"children":1326},{},[1327],{"type":51,"value":1328},"Map security-relevant APIs",{"type":51,"value":1330},": authentication, authorization, cryptography, session management, input validation",{"type":45,"tag":71,"props":1332,"children":1333},{},[1334,1339],{"type":45,"tag":150,"props":1335,"children":1336},{},[1337],{"type":51,"value":1338},"Identify developer choice points",{"type":51,"value":1340},": Where can developers select algorithms, configure timeouts, choose modes?",{"type":45,"tag":71,"props":1342,"children":1343},{},[1344,1349],{"type":45,"tag":150,"props":1345,"children":1346},{},[1347],{"type":51,"value":1348},"Find configuration schemas",{"type":51,"value":1350},": Environment variables, config files, constructor parameters",{"type":45,"tag":311,"props":1352,"children":1354},{"id":1353},"phase-2-edge-case-probing",[1355],{"type":51,"value":1356},"Phase 2: Edge Case Probing",{"type":45,"tag":54,"props":1358,"children":1359},{},[1360],{"type":51,"value":1361},"For each choice point, ask:",{"type":45,"tag":67,"props":1363,"children":1364},{},[1365,1403,1421,1431,1441],{"type":45,"tag":71,"props":1366,"children":1367},{},[1368,1373,1375,1381,1382,1388,1389,1395,1396,1402],{"type":45,"tag":150,"props":1369,"children":1370},{},[1371],{"type":51,"value":1372},"Zero\u002Fempty\u002Fnull",{"type":51,"value":1374},": What happens with ",{"type":45,"tag":132,"props":1376,"children":1378},{"className":1377},[],[1379],{"type":51,"value":1380},"0",{"type":51,"value":381},{"type":45,"tag":132,"props":1383,"children":1385},{"className":1384},[],[1386],{"type":51,"value":1387},"\"\"",{"type":51,"value":381},{"type":45,"tag":132,"props":1390,"children":1392},{"className":1391},[],[1393],{"type":51,"value":1394},"null",{"type":51,"value":381},{"type":45,"tag":132,"props":1397,"children":1399},{"className":1398},[],[1400],{"type":51,"value":1401},"[]",{"type":51,"value":603},{"type":45,"tag":71,"props":1404,"children":1405},{},[1406,1411,1413,1419],{"type":45,"tag":150,"props":1407,"children":1408},{},[1409],{"type":51,"value":1410},"Negative values",{"type":51,"value":1412},": What does ",{"type":45,"tag":132,"props":1414,"children":1416},{"className":1415},[],[1417],{"type":51,"value":1418},"-1",{"type":51,"value":1420}," mean? Infinite? Error?",{"type":45,"tag":71,"props":1422,"children":1423},{},[1424,1429],{"type":45,"tag":150,"props":1425,"children":1426},{},[1427],{"type":51,"value":1428},"Type confusion",{"type":51,"value":1430},": Can different security concepts be swapped?",{"type":45,"tag":71,"props":1432,"children":1433},{},[1434,1439],{"type":45,"tag":150,"props":1435,"children":1436},{},[1437],{"type":51,"value":1438},"Default values",{"type":51,"value":1440},": Is the default secure? Is it documented?",{"type":45,"tag":71,"props":1442,"children":1443},{},[1444,1449],{"type":45,"tag":150,"props":1445,"children":1446},{},[1447],{"type":51,"value":1448},"Error paths",{"type":51,"value":1450},": What happens on invalid input? Silent acceptance?",{"type":45,"tag":311,"props":1452,"children":1454},{"id":1453},"phase-3-threat-modeling",[1455],{"type":51,"value":1456},"Phase 3: Threat Modeling",{"type":45,"tag":54,"props":1458,"children":1459},{},[1460],{"type":51,"value":1461},"Consider three adversaries:",{"type":45,"tag":1318,"props":1463,"children":1464},{},[1465,1493,1521],{"type":45,"tag":71,"props":1466,"children":1467},{},[1468,1473,1475],{"type":45,"tag":150,"props":1469,"children":1470},{},[1471],{"type":51,"value":1472},"The Scoundrel",{"type":51,"value":1474},": Actively malicious developer or attacker controlling config",{"type":45,"tag":67,"props":1476,"children":1477},{},[1478,1483,1488],{"type":45,"tag":71,"props":1479,"children":1480},{},[1481],{"type":51,"value":1482},"Can they disable security via configuration?",{"type":45,"tag":71,"props":1484,"children":1485},{},[1486],{"type":51,"value":1487},"Can they downgrade algorithms?",{"type":45,"tag":71,"props":1489,"children":1490},{},[1491],{"type":51,"value":1492},"Can they inject malicious values?",{"type":45,"tag":71,"props":1494,"children":1495},{},[1496,1501,1503],{"type":45,"tag":150,"props":1497,"children":1498},{},[1499],{"type":51,"value":1500},"The Lazy Developer",{"type":51,"value":1502},": Copy-pastes examples, skips documentation",{"type":45,"tag":67,"props":1504,"children":1505},{},[1506,1511,1516],{"type":45,"tag":71,"props":1507,"children":1508},{},[1509],{"type":51,"value":1510},"Will the first example they find be secure?",{"type":45,"tag":71,"props":1512,"children":1513},{},[1514],{"type":51,"value":1515},"Is the path of least resistance secure?",{"type":45,"tag":71,"props":1517,"children":1518},{},[1519],{"type":51,"value":1520},"Do error messages guide toward secure usage?",{"type":45,"tag":71,"props":1522,"children":1523},{},[1524,1529,1531],{"type":45,"tag":150,"props":1525,"children":1526},{},[1527],{"type":51,"value":1528},"The Confused Developer",{"type":51,"value":1530},": Misunderstands the API",{"type":45,"tag":67,"props":1532,"children":1533},{},[1534,1539,1544],{"type":45,"tag":71,"props":1535,"children":1536},{},[1537],{"type":51,"value":1538},"Can they swap parameters without type errors?",{"type":45,"tag":71,"props":1540,"children":1541},{},[1542],{"type":51,"value":1543},"Can they use the wrong key\u002Falgorithm\u002Fmode by accident?",{"type":45,"tag":71,"props":1545,"children":1546},{},[1547],{"type":51,"value":1548},"Are failure modes obvious or silent?",{"type":45,"tag":311,"props":1550,"children":1552},{"id":1551},"phase-4-validate-findings",[1553],{"type":51,"value":1554},"Phase 4: Validate Findings",{"type":45,"tag":54,"props":1556,"children":1557},{},[1558],{"type":51,"value":1559},"For each identified sharp edge:",{"type":45,"tag":1318,"props":1561,"children":1562},{},[1563,1573,1583,1593],{"type":45,"tag":71,"props":1564,"children":1565},{},[1566,1571],{"type":45,"tag":150,"props":1567,"children":1568},{},[1569],{"type":51,"value":1570},"Reproduce the misuse",{"type":51,"value":1572},": Write minimal code demonstrating the footgun",{"type":45,"tag":71,"props":1574,"children":1575},{},[1576,1581],{"type":45,"tag":150,"props":1577,"children":1578},{},[1579],{"type":51,"value":1580},"Verify exploitability",{"type":51,"value":1582},": Does the misuse create a real vulnerability?",{"type":45,"tag":71,"props":1584,"children":1585},{},[1586,1591],{"type":45,"tag":150,"props":1587,"children":1588},{},[1589],{"type":51,"value":1590},"Check documentation",{"type":51,"value":1592},": Is the danger documented? (Documentation doesn't excuse bad design, but affects severity)",{"type":45,"tag":71,"props":1594,"children":1595},{},[1596,1601],{"type":45,"tag":150,"props":1597,"children":1598},{},[1599],{"type":51,"value":1600},"Test mitigations",{"type":51,"value":1602},": Can the API be used safely with reasonable effort?",{"type":45,"tag":54,"props":1604,"children":1605},{},[1606],{"type":51,"value":1607},"If a finding seems questionable, return to Phase 2 and probe more edge cases.",{"type":45,"tag":60,"props":1609,"children":1611},{"id":1610},"severity-classification",[1612],{"type":51,"value":1613},"Severity Classification",{"type":45,"tag":164,"props":1615,"children":1616},{},[1617,1638],{"type":45,"tag":168,"props":1618,"children":1619},{},[1620],{"type":45,"tag":172,"props":1621,"children":1622},{},[1623,1628,1633],{"type":45,"tag":176,"props":1624,"children":1625},{},[1626],{"type":51,"value":1627},"Severity",{"type":45,"tag":176,"props":1629,"children":1630},{},[1631],{"type":51,"value":1632},"Criteria",{"type":45,"tag":176,"props":1634,"children":1635},{},[1636],{"type":51,"value":1637},"Examples",{"type":45,"tag":192,"props":1639,"children":1640},{},[1641,1665,1683,1701],{"type":45,"tag":172,"props":1642,"children":1643},{},[1644,1649,1654],{"type":45,"tag":199,"props":1645,"children":1646},{},[1647],{"type":51,"value":1648},"Critical",{"type":45,"tag":199,"props":1650,"children":1651},{},[1652],{"type":51,"value":1653},"Default or obvious usage is insecure",{"type":45,"tag":199,"props":1655,"children":1656},{},[1657,1663],{"type":45,"tag":132,"props":1658,"children":1660},{"className":1659},[],[1661],{"type":51,"value":1662},"verify: false",{"type":51,"value":1664}," default; empty password allowed",{"type":45,"tag":172,"props":1666,"children":1667},{},[1668,1673,1678],{"type":45,"tag":199,"props":1669,"children":1670},{},[1671],{"type":51,"value":1672},"High",{"type":45,"tag":199,"props":1674,"children":1675},{},[1676],{"type":51,"value":1677},"Easy misconfiguration breaks security",{"type":45,"tag":199,"props":1679,"children":1680},{},[1681],{"type":51,"value":1682},"Algorithm parameter accepts \"none\"",{"type":45,"tag":172,"props":1684,"children":1685},{},[1686,1691,1696],{"type":45,"tag":199,"props":1687,"children":1688},{},[1689],{"type":51,"value":1690},"Medium",{"type":45,"tag":199,"props":1692,"children":1693},{},[1694],{"type":51,"value":1695},"Unusual but possible misconfiguration",{"type":45,"tag":199,"props":1697,"children":1698},{},[1699],{"type":51,"value":1700},"Negative timeout has unexpected meaning",{"type":45,"tag":172,"props":1702,"children":1703},{},[1704,1709,1714],{"type":45,"tag":199,"props":1705,"children":1706},{},[1707],{"type":51,"value":1708},"Low",{"type":45,"tag":199,"props":1710,"children":1711},{},[1712],{"type":51,"value":1713},"Requires deliberate misuse",{"type":45,"tag":199,"props":1715,"children":1716},{},[1717],{"type":51,"value":1718},"Obscure parameter combination",{"type":45,"tag":60,"props":1720,"children":1722},{"id":1721},"references",[1723],{"type":51,"value":1724},"References",{"type":45,"tag":54,"props":1726,"children":1727},{},[1728],{"type":45,"tag":150,"props":1729,"children":1730},{},[1731],{"type":51,"value":1732},"By category:",{"type":45,"tag":67,"props":1734,"children":1735},{},[1736,1751,1765,1779],{"type":45,"tag":71,"props":1737,"children":1738},{},[1739,1744,1746],{"type":45,"tag":150,"props":1740,"children":1741},{},[1742],{"type":51,"value":1743},"Cryptographic APIs",{"type":51,"value":1745},": See ",{"type":45,"tag":1068,"props":1747,"children":1749},{"href":1748},"references\u002Fcrypto-apis.md",[1750],{"type":51,"value":1748},{"type":45,"tag":71,"props":1752,"children":1753},{},[1754,1759,1760],{"type":45,"tag":150,"props":1755,"children":1756},{},[1757],{"type":51,"value":1758},"Configuration Patterns",{"type":51,"value":1745},{"type":45,"tag":1068,"props":1761,"children":1763},{"href":1762},"references\u002Fconfig-patterns.md",[1764],{"type":51,"value":1762},{"type":45,"tag":71,"props":1766,"children":1767},{},[1768,1773,1774],{"type":45,"tag":150,"props":1769,"children":1770},{},[1771],{"type":51,"value":1772},"Authentication\u002FSession",{"type":51,"value":1745},{"type":45,"tag":1068,"props":1775,"children":1777},{"href":1776},"references\u002Fauth-patterns.md",[1778],{"type":51,"value":1776},{"type":45,"tag":71,"props":1780,"children":1781},{},[1782,1787,1788,1793],{"type":45,"tag":150,"props":1783,"children":1784},{},[1785],{"type":51,"value":1786},"Real-World Case Studies",{"type":51,"value":1745},{"type":45,"tag":1068,"props":1789,"children":1791},{"href":1790},"references\u002Fcase-studies.md",[1792],{"type":51,"value":1790},{"type":51,"value":1794}," (OpenSSL, GMP, etc.)",{"type":45,"tag":54,"props":1796,"children":1797},{},[1798,1803],{"type":45,"tag":150,"props":1799,"children":1800},{},[1801],{"type":51,"value":1802},"By language",{"type":51,"value":1804}," (general footguns, not crypto-specific):",{"type":45,"tag":164,"props":1806,"children":1807},{},[1808,1824],{"type":45,"tag":168,"props":1809,"children":1810},{},[1811],{"type":45,"tag":172,"props":1812,"children":1813},{},[1814,1819],{"type":45,"tag":176,"props":1815,"children":1816},{},[1817],{"type":51,"value":1818},"Language",{"type":45,"tag":176,"props":1820,"children":1821},{},[1822],{"type":51,"value":1823},"Guide",{"type":45,"tag":192,"props":1825,"children":1826},{},[1827,1843,1859,1875,1891,1907,1923,1939,1955,1971,1987],{"type":45,"tag":172,"props":1828,"children":1829},{},[1830,1835],{"type":45,"tag":199,"props":1831,"children":1832},{},[1833],{"type":51,"value":1834},"C\u002FC++",{"type":45,"tag":199,"props":1836,"children":1837},{},[1838],{"type":45,"tag":1068,"props":1839,"children":1841},{"href":1840},"references\u002Flang-c.md",[1842],{"type":51,"value":1840},{"type":45,"tag":172,"props":1844,"children":1845},{},[1846,1851],{"type":45,"tag":199,"props":1847,"children":1848},{},[1849],{"type":51,"value":1850},"Go",{"type":45,"tag":199,"props":1852,"children":1853},{},[1854],{"type":45,"tag":1068,"props":1855,"children":1857},{"href":1856},"references\u002Flang-go.md",[1858],{"type":51,"value":1856},{"type":45,"tag":172,"props":1860,"children":1861},{},[1862,1867],{"type":45,"tag":199,"props":1863,"children":1864},{},[1865],{"type":51,"value":1866},"Rust",{"type":45,"tag":199,"props":1868,"children":1869},{},[1870],{"type":45,"tag":1068,"props":1871,"children":1873},{"href":1872},"references\u002Flang-rust.md",[1874],{"type":51,"value":1872},{"type":45,"tag":172,"props":1876,"children":1877},{},[1878,1883],{"type":45,"tag":199,"props":1879,"children":1880},{},[1881],{"type":51,"value":1882},"Swift",{"type":45,"tag":199,"props":1884,"children":1885},{},[1886],{"type":45,"tag":1068,"props":1887,"children":1889},{"href":1888},"references\u002Flang-swift.md",[1890],{"type":51,"value":1888},{"type":45,"tag":172,"props":1892,"children":1893},{},[1894,1899],{"type":45,"tag":199,"props":1895,"children":1896},{},[1897],{"type":51,"value":1898},"Java",{"type":45,"tag":199,"props":1900,"children":1901},{},[1902],{"type":45,"tag":1068,"props":1903,"children":1905},{"href":1904},"references\u002Flang-java.md",[1906],{"type":51,"value":1904},{"type":45,"tag":172,"props":1908,"children":1909},{},[1910,1915],{"type":45,"tag":199,"props":1911,"children":1912},{},[1913],{"type":51,"value":1914},"Kotlin",{"type":45,"tag":199,"props":1916,"children":1917},{},[1918],{"type":45,"tag":1068,"props":1919,"children":1921},{"href":1920},"references\u002Flang-kotlin.md",[1922],{"type":51,"value":1920},{"type":45,"tag":172,"props":1924,"children":1925},{},[1926,1931],{"type":45,"tag":199,"props":1927,"children":1928},{},[1929],{"type":51,"value":1930},"C#",{"type":45,"tag":199,"props":1932,"children":1933},{},[1934],{"type":45,"tag":1068,"props":1935,"children":1937},{"href":1936},"references\u002Flang-csharp.md",[1938],{"type":51,"value":1936},{"type":45,"tag":172,"props":1940,"children":1941},{},[1942,1947],{"type":45,"tag":199,"props":1943,"children":1944},{},[1945],{"type":51,"value":1946},"PHP",{"type":45,"tag":199,"props":1948,"children":1949},{},[1950],{"type":45,"tag":1068,"props":1951,"children":1953},{"href":1952},"references\u002Flang-php.md",[1954],{"type":51,"value":1952},{"type":45,"tag":172,"props":1956,"children":1957},{},[1958,1963],{"type":45,"tag":199,"props":1959,"children":1960},{},[1961],{"type":51,"value":1962},"JavaScript\u002FTypeScript",{"type":45,"tag":199,"props":1964,"children":1965},{},[1966],{"type":45,"tag":1068,"props":1967,"children":1969},{"href":1968},"references\u002Flang-javascript.md",[1970],{"type":51,"value":1968},{"type":45,"tag":172,"props":1972,"children":1973},{},[1974,1979],{"type":45,"tag":199,"props":1975,"children":1976},{},[1977],{"type":51,"value":1978},"Python",{"type":45,"tag":199,"props":1980,"children":1981},{},[1982],{"type":45,"tag":1068,"props":1983,"children":1985},{"href":1984},"references\u002Flang-python.md",[1986],{"type":51,"value":1984},{"type":45,"tag":172,"props":1988,"children":1989},{},[1990,1995],{"type":45,"tag":199,"props":1991,"children":1992},{},[1993],{"type":51,"value":1994},"Ruby",{"type":45,"tag":199,"props":1996,"children":1997},{},[1998],{"type":45,"tag":1068,"props":1999,"children":2001},{"href":2000},"references\u002Flang-ruby.md",[2002],{"type":51,"value":2000},{"type":45,"tag":54,"props":2004,"children":2005},{},[2006,2008,2013],{"type":51,"value":2007},"See also ",{"type":45,"tag":1068,"props":2009,"children":2011},{"href":2010},"references\u002Flanguage-specific.md",[2012],{"type":51,"value":2010},{"type":51,"value":2014}," for a combined quick reference.",{"type":45,"tag":60,"props":2016,"children":2018},{"id":2017},"quality-checklist",[2019],{"type":51,"value":2020},"Quality Checklist",{"type":45,"tag":54,"props":2022,"children":2023},{},[2024],{"type":51,"value":2025},"Before concluding analysis:",{"type":45,"tag":67,"props":2027,"children":2030},{"className":2028},[2029],"contains-task-list",[2031,2043,2052,2061,2070,2079,2088,2097],{"type":45,"tag":71,"props":2032,"children":2035},{"className":2033},[2034],"task-list-item",[2036,2041],{"type":45,"tag":2037,"props":2038,"children":2040},"input",{"disabled":669,"type":2039},"checkbox",[],{"type":51,"value":2042}," Probed all zero\u002Fempty\u002Fnull edge cases",{"type":45,"tag":71,"props":2044,"children":2046},{"className":2045},[2034],[2047,2050],{"type":45,"tag":2037,"props":2048,"children":2049},{"disabled":669,"type":2039},[],{"type":51,"value":2051}," Verified defaults are secure",{"type":45,"tag":71,"props":2053,"children":2055},{"className":2054},[2034],[2056,2059],{"type":45,"tag":2037,"props":2057,"children":2058},{"disabled":669,"type":2039},[],{"type":51,"value":2060}," Checked for algorithm\u002Fmode selection footguns",{"type":45,"tag":71,"props":2062,"children":2064},{"className":2063},[2034],[2065,2068],{"type":45,"tag":2037,"props":2066,"children":2067},{"disabled":669,"type":2039},[],{"type":51,"value":2069}," Tested type confusion between security concepts",{"type":45,"tag":71,"props":2071,"children":2073},{"className":2072},[2034],[2074,2077],{"type":45,"tag":2037,"props":2075,"children":2076},{"disabled":669,"type":2039},[],{"type":51,"value":2078}," Considered all three adversary types",{"type":45,"tag":71,"props":2080,"children":2082},{"className":2081},[2034],[2083,2086],{"type":45,"tag":2037,"props":2084,"children":2085},{"disabled":669,"type":2039},[],{"type":51,"value":2087}," Verified error paths don't bypass security",{"type":45,"tag":71,"props":2089,"children":2091},{"className":2090},[2034],[2092,2095],{"type":45,"tag":2037,"props":2093,"children":2094},{"disabled":669,"type":2039},[],{"type":51,"value":2096}," Checked configuration validation",{"type":45,"tag":71,"props":2098,"children":2100},{"className":2099},[2034],[2101,2104,2106],{"type":45,"tag":2037,"props":2102,"children":2103},{"disabled":669,"type":2039},[],{"type":51,"value":2105}," Constructor params validated (not just defaulted) - see ",{"type":45,"tag":1068,"props":2107,"children":2108},{"href":1070},[2109],{"type":51,"value":1073},{"type":45,"tag":2111,"props":2112,"children":2113},"style",{},[2114],{"type":51,"value":2115},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":2117,"total":2266},[2118,2134,2144,2162,2177,2190,2200,2210,2221,2232,2244,2255],{"slug":2119,"name":2119,"fn":2120,"description":2121,"org":2122,"tags":2123,"stars":26,"repoUrl":27,"updatedAt":2133},"address-sanitizer","detect memory errors during fuzzing","AddressSanitizer detects memory errors during fuzzing. Use when fuzzing C\u002FC++ code to find buffer overflows and use-after-free bugs.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2124,2126,2129,2130],{"name":1930,"slug":2125,"type":16},"c",{"name":2127,"slug":2128,"type":16},"Debugging","debugging",{"name":14,"slug":15,"type":16},{"name":2131,"slug":2132,"type":16},"Testing","testing","2026-07-17T06:05:14.925095",{"slug":2135,"name":2135,"fn":2136,"description":2137,"org":2138,"tags":2139,"stars":26,"repoUrl":27,"updatedAt":2143},"aflpp","perform multi-core fuzzing of C\u002FC++ projects","AFL++ is a fork of AFL with better fuzzing performance and advanced features. Use for multi-core fuzzing of C\u002FC++ projects.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2140,2141,2142],{"name":1930,"slug":2125,"type":16},{"name":14,"slug":15,"type":16},{"name":2131,"slug":2132,"type":16},"2026-07-17T06:05:12.433192",{"slug":2145,"name":2145,"fn":2146,"description":2147,"org":2148,"tags":2149,"stars":26,"repoUrl":27,"updatedAt":2161},"agentic-actions-auditor","audit GitHub Actions for security vulnerabilities","Audits GitHub Actions workflows for security vulnerabilities in AI agent integrations including Claude Code Action, Gemini CLI, OpenAI Codex, and GitHub AI Inference. Detects attack vectors where attacker-controlled input reaches AI agents running in CI\u002FCD pipelines, including env var intermediary patterns, direct expression injection, dangerous sandbox configurations, and wildcard user allowlists. Use when reviewing workflow files that invoke AI coding agents, auditing CI\u002FCD pipeline security for prompt injection risks, or evaluating agentic action configurations.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2150,2153,2156,2157,2160],{"name":2151,"slug":2152,"type":16},"Agents","agents",{"name":2154,"slug":2155,"type":16},"CI\u002FCD","ci-cd",{"name":24,"slug":25,"type":16},{"name":2158,"slug":2159,"type":16},"GitHub Actions","github-actions",{"name":14,"slug":15,"type":16},"2026-07-18T05:47:48.564744",{"slug":2163,"name":2163,"fn":2164,"description":2165,"org":2166,"tags":2167,"stars":26,"repoUrl":27,"updatedAt":2176},"algorand-vulnerability-scanner","scan Algorand smart contracts for vulnerabilities","Scans Algorand smart contracts for 11 common vulnerabilities including rekeying attacks, unchecked transaction fees, missing field validations, and access control issues. Use when auditing Algorand projects (TEAL\u002FPyTeal).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2168,2171,2172,2173],{"name":2169,"slug":2170,"type":16},"Audit","audit",{"name":24,"slug":25,"type":16},{"name":14,"slug":15,"type":16},{"name":2174,"slug":2175,"type":16},"Smart Contracts","smart-contracts","2026-07-18T05:47:43.989063",{"slug":2178,"name":2178,"fn":2179,"description":2180,"org":2181,"tags":2182,"stars":26,"repoUrl":27,"updatedAt":2189},"ask-questions-if-underspecified","clarify requirements before implementation","Clarify requirements before implementing. Use when serious doubts arise.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2183,2186],{"name":2184,"slug":2185,"type":16},"Engineering","engineering",{"name":2187,"slug":2188,"type":16},"Productivity","productivity","2026-07-17T06:05:33.543262",{"slug":2191,"name":2191,"fn":2192,"description":2193,"org":2194,"tags":2195,"stars":26,"repoUrl":27,"updatedAt":2199},"atheris","fuzz Python code with Atheris","Atheris is a coverage-guided Python fuzzer based on libFuzzer. Use for fuzzing pure Python code and Python C extensions.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2196,2197,2198],{"name":1978,"slug":483,"type":16},{"name":14,"slug":15,"type":16},{"name":2131,"slug":2132,"type":16},"2026-07-17T06:05:14.575191",{"slug":2201,"name":2201,"fn":2202,"description":2203,"org":2204,"tags":2205,"stars":26,"repoUrl":27,"updatedAt":2209},"audit-augmentation","augment code graphs with audit findings","Augments Trailmark code graphs with external audit findings from SARIF static analysis results, weAudit annotation files, and version-gated Trailmark 0.4.x binary-analysis graph exports. Maps findings to graph nodes by file and line overlap, creates severity-based subgraphs, and enables cross-referencing findings with pre-analysis data (blast radius, taint, etc.). Use when projecting SARIF results onto a code graph, overlaying weAudit annotations, importing binary graph findings, cross-referencing Semgrep, CodeQL, or binary-analysis findings with call graph data, or visualizing audit findings in the context of code structure.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2206,2207,2208],{"name":2169,"slug":2170,"type":16},{"name":24,"slug":25,"type":16},{"name":14,"slug":15,"type":16},"2026-08-01T05:44:54.920542",{"slug":2211,"name":2211,"fn":2212,"description":2213,"org":2214,"tags":2215,"stars":26,"repoUrl":27,"updatedAt":2220},"audit-context-building","build architectural context for code analysis","Enables ultra-granular, line-by-line code analysis to build deep architectural context before vulnerability or bug finding.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2216,2217,2218,2219],{"name":18,"slug":19,"type":16},{"name":2169,"slug":2170,"type":16},{"name":24,"slug":25,"type":16},{"name":2184,"slug":2185,"type":16},"2026-07-18T05:47:40.122449",{"slug":2222,"name":2222,"fn":2223,"description":2224,"org":2225,"tags":2226,"stars":26,"repoUrl":27,"updatedAt":2231},"audit-prep-assistant","prepare codebases for security audits","Prepares codebases for security review using Trail of Bits' checklist. Helps set review goals, runs static analysis tools, increases test coverage, removes dead code, ensures accessibility, and generates documentation (flowcharts, user stories, inline comments).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2227,2228,2229,2230],{"name":2169,"slug":2170,"type":16},{"name":24,"slug":25,"type":16},{"name":2184,"slug":2185,"type":16},{"name":14,"slug":15,"type":16},"2026-07-18T05:47:39.210985",{"slug":2233,"name":2233,"fn":2234,"description":2235,"org":2236,"tags":2237,"stars":26,"repoUrl":27,"updatedAt":2243},"burpsuite-project-parser","parse Burp Suite project files","Searches and explores Burp Suite project files (.burp) from the command line. Use when searching response headers or bodies with regex patterns, extracting security audit findings, dumping proxy history or site map data, or analyzing HTTP traffic captured in a Burp project.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2238,2239,2242],{"name":2169,"slug":2170,"type":16},{"name":2240,"slug":2241,"type":16},"CLI","cli",{"name":14,"slug":15,"type":16},"2026-07-17T06:05:33.198077",{"slug":2245,"name":2245,"fn":2246,"description":2247,"org":2248,"tags":2249,"stars":26,"repoUrl":27,"updatedAt":2254},"c-review","audit C and C++ code","Performs comprehensive C\u002FC++ security review for memory corruption, integer overflows, race conditions, and platform-specific vulnerabilities. Use when auditing native C\u002FC++ applications, reviewing daemons or services for memory safety, or hunting integer overflow \u002F use-after-free \u002F race conditions in userspace code.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2250,2251,2252,2253],{"name":2169,"slug":2170,"type":16},{"name":1930,"slug":2125,"type":16},{"name":24,"slug":25,"type":16},{"name":14,"slug":15,"type":16},"2026-07-17T06:05:11.333374",{"slug":2256,"name":2256,"fn":2257,"description":2258,"org":2259,"tags":2260,"stars":26,"repoUrl":27,"updatedAt":2265},"cairo-vulnerability-scanner","scan Cairo and StarkNet contracts for vulnerabilities","Scans Cairo\u002FStarkNet smart contracts for 6 critical vulnerabilities including felt252 arithmetic overflow, L1-L2 messaging issues, address conversion problems, and signature replay. Use when auditing StarkNet projects.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2261,2262,2263,2264],{"name":2169,"slug":2170,"type":16},{"name":24,"slug":25,"type":16},{"name":14,"slug":15,"type":16},{"name":2174,"slug":2175,"type":16},"2026-07-18T05:47:42.84568",111,{"items":2268,"total":2314},[2269,2276,2282,2290,2297,2302,2308],{"slug":2119,"name":2119,"fn":2120,"description":2121,"org":2270,"tags":2271,"stars":26,"repoUrl":27,"updatedAt":2133},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2272,2273,2274,2275],{"name":1930,"slug":2125,"type":16},{"name":2127,"slug":2128,"type":16},{"name":14,"slug":15,"type":16},{"name":2131,"slug":2132,"type":16},{"slug":2135,"name":2135,"fn":2136,"description":2137,"org":2277,"tags":2278,"stars":26,"repoUrl":27,"updatedAt":2143},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2279,2280,2281],{"name":1930,"slug":2125,"type":16},{"name":14,"slug":15,"type":16},{"name":2131,"slug":2132,"type":16},{"slug":2145,"name":2145,"fn":2146,"description":2147,"org":2283,"tags":2284,"stars":26,"repoUrl":27,"updatedAt":2161},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2285,2286,2287,2288,2289],{"name":2151,"slug":2152,"type":16},{"name":2154,"slug":2155,"type":16},{"name":24,"slug":25,"type":16},{"name":2158,"slug":2159,"type":16},{"name":14,"slug":15,"type":16},{"slug":2163,"name":2163,"fn":2164,"description":2165,"org":2291,"tags":2292,"stars":26,"repoUrl":27,"updatedAt":2176},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2293,2294,2295,2296],{"name":2169,"slug":2170,"type":16},{"name":24,"slug":25,"type":16},{"name":14,"slug":15,"type":16},{"name":2174,"slug":2175,"type":16},{"slug":2178,"name":2178,"fn":2179,"description":2180,"org":2298,"tags":2299,"stars":26,"repoUrl":27,"updatedAt":2189},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2300,2301],{"name":2184,"slug":2185,"type":16},{"name":2187,"slug":2188,"type":16},{"slug":2191,"name":2191,"fn":2192,"description":2193,"org":2303,"tags":2304,"stars":26,"repoUrl":27,"updatedAt":2199},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2305,2306,2307],{"name":1978,"slug":483,"type":16},{"name":14,"slug":15,"type":16},{"name":2131,"slug":2132,"type":16},{"slug":2201,"name":2201,"fn":2202,"description":2203,"org":2309,"tags":2310,"stars":26,"repoUrl":27,"updatedAt":2209},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2311,2312,2313],{"name":2169,"slug":2170,"type":16},{"name":24,"slug":25,"type":16},{"name":14,"slug":15,"type":16},77]