Skip to main content
The Sharp Edges plugin identifies error-prone APIs, dangerous configurations, and footgun designs that enable security mistakes through developer confusion, laziness, or malice.

Overview

Sharp Edges analyzes code and designs through the lens of three adversaries:
  1. The Scoundrel - Can a malicious developer or attacker disable security via configuration?
  2. The Lazy Developer - Will copy-pasting the first example lead to insecure code?
  3. The Confused Developer - Can parameters be swapped without type errors?
Core Principle: The Pit of SuccessSecure usage should be the path of least resistance. If developers must read documentation carefully or remember special rules to avoid vulnerabilities, the API has failed.

Installation

When to Use

Use this plugin when:
  • Reviewing API designs for security-relevant interfaces
  • Auditing configuration schemas that expose security choices
  • Evaluating cryptographic library ergonomics
  • Assessing authentication/authorization APIs
  • Any code review where developers make security-critical decisions

Sharp Edge Categories

The skill identifies six categories of misuse-prone designs:
APIs that let developers choose algorithms invite choosing wrong ones.The JWT Pattern (canonical example):
  • Header specifies algorithm: attacker can set "alg": "none" to bypass signatures
  • Algorithm confusion: RSA public key used as HMAC secret when switching RS256→HS256
  • Root cause: Letting untrusted input control security-critical decisions
Example - PHP password_hash:
Defaults that are insecure, or zero/empty values that disable security.Detection patterns:
  • Timeouts/lifetimes that accept 0 (infinite? immediate expiry?)
  • Empty strings that bypass checks
  • Null values that skip validation
  • Boolean defaults that disable security features
Questions to ask:
  • What happens with timeout=0? max_attempts=0? key=""?
  • Is the default the most secure option?
  • Can any default value disable security entirely?
APIs that expose raw bytes instead of meaningful types invite type confusion.The Libsodium vs. Halite Pattern:
One wrong setting creates catastrophic failure, with no warning.Examples:
Errors that don’t surface, or success that masks failure.Detection patterns:
  • Functions returning booleans instead of throwing on security failures
  • Empty catch blocks around security operations
  • Default values substituted on parse errors
  • Verification functions that “succeed” on malformed input
Example:
Security-critical values as plain strings enable injection and confusion.Detection patterns:
  • SQL/commands built from string concatenation
  • Permissions as comma-separated strings
  • Roles/scopes as arbitrary strings instead of enums
  • URLs constructed by joining strings
The permission accumulation footgun:

Analysis Workflow

Phase 1: Surface Identification

  1. Map security-relevant APIs: authentication, authorization, cryptography, session management, input validation
  2. Identify developer choice points: Where can developers select algorithms, configure timeouts, choose modes?
  3. Find configuration schemas: Environment variables, config files, constructor parameters

Phase 2: Edge Case Probing

For each choice point, ask:

Zero/Empty/Null

What happens with 0, "", null, []?

Negative Values

What does -1 mean? Infinite? Error?

Type Confusion

Can different security concepts be swapped?

Default Values

Is the default secure? Is it documented?

Phase 3: Threat Modeling

Consider three adversaries:

Phase 4: Validate Findings

For each identified sharp edge:
  1. Reproduce the misuse: Write minimal code demonstrating the footgun
  2. Verify exploitability: Does the misuse create a real vulnerability?
  3. Check documentation: Is the danger documented?
  4. Test mitigations: Can the API be used safely with reasonable effort?

Severity Classification

Rationalizations to Reject

These shortcuts lead to missed findings. Do not accept them:

Language-Specific Guides

The plugin includes detailed language-specific footgun catalogs:

C/C++

Memory safety, integer overflow, format strings

Go

Error handling, crypto API misuse

Rust

Unsafe blocks, FFI boundaries

Java/Kotlin

Serialization, crypto defaults

C#

XML parsing, crypto modes

PHP

Type juggling, hash algorithms

JavaScript/TypeScript

eval(), prototype pollution

Python

pickle, YAML deserialize

Ruby

Marshal.load, symbol DoS

Constant-Time Analysis

Detect timing side-channels in cryptographic code

Differential Review

Security-focused code change review

Quality Checklist

Before concluding analysis:
  • Probed all zero/empty/null edge cases
  • Verified defaults are secure
  • Checked for algorithm/mode selection footguns
  • Tested type confusion between security concepts
  • Considered all three adversary types
  • Verified error paths don’t bypass security
  • Checked configuration validation
  • Constructor params validated (not just defaulted)