insecure-defaults by trailofbits/skills
npx skills add https://github.com/trailofbits/skills --skill insecure-defaults发现应用程序在缺少配置时以不安全方式运行的故障开放漏洞。区分可利用的默认配置与安全崩溃的故障安全模式。
SECRET = env.get('KEY') or 'default' → 应用程序使用弱密钥运行SECRET = env['KEY'] → 如果缺失,应用程序会崩溃请勿将此技能用于:
test/、spec/、__tests__/ 目录中的文件)广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
.example、.template、.sample 的文件)如有疑问:追踪代码路径以确定应用程序是使用默认配置运行还是崩溃。
对每个潜在发现项遵循此工作流程:
确定语言、框架和项目约定。使用此信息进一步发现密钥存储位置、密钥使用模式、带凭据的第三方集成、加密以及任何其他相关配置。进一步利用信息分析不安全的默认配置。
示例 在 **/config/、**/auth/、**/database/ 和环境文件中搜索模式:
getenv.*\) or ['"], process\.env\.[A-Z_]+ \|\| ['"], ENV\.fetch.*default:password.*=.*['"][^'"]{8,}['"], api[_-]?key.*=.*['"][^'"]+['"]DEBUG.*=.*true, AUTH.*=.*false, CORS.*=.*\*MD5|SHA1|DES|RC4|ECB根据发现结果调整搜索方法。
关注可到达生产环境的代码,而非测试固件或示例文件。
对每个匹配项,追踪代码路径以理解运行时行为。
需要回答的问题:
确定此问题是否影响生产环境:
如果生产配置提供了变量 → 较低严重性(但仍是代码级漏洞)
如果生产配置缺失或使用默认值 → 严重
示例报告:
发现项:硬编码的 JWT 密钥回退
位置:src/auth/jwt.ts:15
模式:const secret = process.env.JWT_SECRET || 'default';
验证:应用程序在没有 JWT_SECRET 的情况下启动;密钥在第 42 行的 jwt.sign() 中使用
生产影响:Dockerfile 缺少 JWT_SECRET
利用方式:攻击者使用 'default' 伪造 JWT,获得未授权访问
回退密钥: SECRET = env.get(X) or Y → 验证:应用程序在没有环境变量的情况下启动?密钥在加密/认证中使用? → 跳过:测试固件、示例文件
默认凭据: 硬编码的 username/password 对 → 验证:在部署的配置中是否激活?没有运行时覆盖? → 跳过:已禁用的账户、文档示例
故障开放安全: AUTH_REQUIRED = env.get(X, 'false') → 验证:默认值是否不安全(false/禁用/宽松)? → 安全:应用程序崩溃或默认值是安全的(true/启用/限制)
弱加密: 安全上下文中的 MD5/SHA1/DES/RC4/ECB → 验证:用于密码、加密或令牌? → 跳过:校验和、非安全哈希
宽松访问: CORS *、权限 0777、默认公开 → 验证:默认是否允许未授权访问? → 跳过:有合理理由明确配置的宽松设置
调试功能: 堆栈跟踪、内省、详细错误 → 验证:默认启用?在响应中暴露? → 跳过:仅限日志记录、不面向用户
有关详细示例和反例,请参阅 examples.md。
每周安装量
1.1K
代码仓库
GitHub 星标数
3.9K
首次出现
2026年1月28日
安全审计
安装于
claude-code965
opencode904
codex884
cursor878
gemini-cli877
github-copilot864
Finds fail-open vulnerabilities where apps run insecurely with missing configuration. Distinguishes exploitable defaults from fail-secure patterns that crash safely.
SECRET = env.get('KEY') or 'default' → App runs with weak secretSECRET = env['KEY'] → App crashes if missingDo not use this skill for:
test/, spec/, __tests__/).example, .template, .sample suffixes)When in doubt: trace the code path to determine if the app runs with the default or crashes.
Follow this workflow for every potential finding:
Determine language, framework, and project conventions. Use this information to further discover things like secret storage locations, secret usage patterns, credentialed third-party integrations, cryptography, and any other relevant configuration. Further use information to analyze insecure default configurations.
Example Search for patterns in **/config/, **/auth/, **/database/, and env files:
getenv.*\) or ['"], process\.env\.[A-Z_]+ \|\| ['"], ENV\.fetch.*default:password.*=.*['"][^'"]{8,}['"], api[_-]?key.*=.*['"][^'"]+['"]DEBUG.*=.*true, AUTH.*=.*false, CORS.*=.*\*MD5|SHA1|DES|RC4|ECB in security contextsTailor search approach based on discovery results.
Focus on production-reachable code, not test fixtures or example files.
For each match, trace the code path to understand runtime behavior.
Questions to answer:
Determine if this issue reaches production:
If production config provides the variable → Lower severity (but still a code-level vulnerability) If production config missing or uses default → CRITICAL
Example report:
Finding: Hardcoded JWT Secret Fallback
Location: src/auth/jwt.ts:15
Pattern: const secret = process.env.JWT_SECRET || 'default';
Verification: App starts without JWT_SECRET; secret used in jwt.sign() at line 42
Production Impact: Dockerfile missing JWT_SECRET
Exploitation: Attacker forges JWTs using 'default', gains unauthorized access
Fallback Secrets: SECRET = env.get(X) or Y → Verify: App starts without env var? Secret used in crypto/auth? → Skip: Test fixtures, example files
Default Credentials: Hardcoded username/password pairs → Verify: Active in deployed config? No runtime override? → Skip: Disabled accounts, documentation examples
Fail-Open Security: AUTH_REQUIRED = env.get(X, 'false') → Verify: Default is insecure (false/disabled/permissive)? → Safe: App crashes or default is secure (true/enabled/restricted)
Weak Crypto: MD5/SHA1/DES/RC4/ECB in security contexts → Verify: Used for passwords, encryption, or tokens? → Skip: Checksums, non-security hashing
Permissive Access: CORS *, permissions 0777, public-by-default → Verify: Default allows unauthorized access? → Skip: Explicitly configured permissiveness with justification
Debug Features: Stack traces, introspection, verbose errors → Verify: Enabled by default? Exposed in responses? → Skip: Logging-only, not user-facing
For detailed examples and counter-examples, see examples.md.
Weekly Installs
1.1K
Repository
GitHub Stars
3.9K
First Seen
Jan 28, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykFail
Installed on
claude-code965
opencode904
codex884
cursor878
gemini-cli877
github-copilot864
Azure 升级评估与自动化工具 - 轻松迁移 Functions 计划、托管层级和 SKU
59,200 周安装
NestJS专家服务 | 企业级TypeScript后端开发与架构设计
1,000 周安装
安全代码卫士:AI驱动的安全编码指南与最佳实践,防止SQL注入、XSS攻击
1,000 周安装
ESLint迁移到Oxlint完整指南:JavaScript/TypeScript项目性能优化工具
1,000 周安装
Chrome CDP 命令行工具:轻量级浏览器自动化,支持截图、执行JS、无障碍快照
1,000 周安装
Sanity内容建模最佳实践:结构化内容设计原则与无头CMS指南
1,000 周安装
AI Sprint规划器 - 敏捷团队Scrum迭代计划工具,自动估算故事点与容量管理
1,000 周安装