sharp-edges
💡 摘要
Sharp Edges 识别易出错的 API 和配置,以防止安全错误。
🎯 适合人群
🤖 AI 吐槽: “该技能分析代码中的安全漏洞,错误配置可能会暴露敏感信息。为了降低风险,确保适当的访问控制并定期审查配置。”
该技能分析代码中的安全漏洞,错误配置可能会暴露敏感信息。为了降低风险,确保适当的访问控制并定期审查配置。
Sharp Edges
Identifies error-prone APIs, dangerous configurations, and footgun designs that enable security mistakes through developer confusion, laziness, or malice.
When to Use
- 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
What It Does
Analyzes code and designs through the lens of three adversaries:
- The Scoundrel: Can a malicious developer or attacker disable security via configuration?
- The Lazy Developer: Will copy-pasting the first example lead to insecure code?
- The Confused Developer: Can parameters be swapped without type errors?
Core Principle
The pit of success: Secure 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
/plugin install trailofbits/skills/plugins/sharp-edges
Sharp Edge Categories
The skill identifies six categories of misuse-prone designs:
| Category | Example |
|----------|---------|
| Algorithm Selection | JWT alg: none attack; PHP hash("crc32", $password) |
| Dangerous Defaults | session_timeout: 0 meaning infinite; empty password accepted |
| Primitive vs. Semantic APIs | encrypt(msg, bytes, bytes) where key/nonce can be swapped |
| Configuration Cliffs | verify_ssl: false disables all certificate validation |
| Silent Failures | Verification returns False instead of throwing; ignored return values |
| Stringly-Typed Security | Permissions as comma-separated strings; SQL from concatenation |
Related Skills
- constant-time-analysis - Detect timing side-channels in cryptographic code
- differential-review - Security-focused code change review
- audit-context-building - Deep architectural analysis before auditing
优点
- 帮助及早识别安全漏洞。
- 提高代码质量和开发人员意识。
- 支持多种安全问题类别。
缺点
- 可能需要对安全概念有深入理解。
- 在某些情况下可能产生误报。
相关技能
免责声明:本内容来源于 GitHub 开源项目,仅供展示和评分分析使用。
版权归原作者所有 trailofbits.
