elixir-security-review
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseElixir Security Review
Elixir代码安全审查
Quick Reference
快速参考
| Issue Type | Reference |
|---|---|
| Code.eval_string, binary_to_term | references/code-injection.md |
| String.to_atom dangers | references/atom-exhaustion.md |
| Config, environment variables | references/secrets.md |
| ETS visibility, process dictionary | references/process-exposure.md |
| 问题类型 | 参考文档 |
|---|---|
| Code.eval_string、binary_to_term | references/code-injection.md |
| String.to_atom 风险 | references/atom-exhaustion.md |
| 配置、环境变量 | references/secrets.md |
| ETS可见性、进程字典 | references/process-exposure.md |
Review Checklist
审查检查清单
Critical (Block Merge)
严重问题(阻止合并)
- No on user input
Code.eval_string/1 - No without
:erlang.binary_to_term/1on untrusted data:safe - No on external input
String.to_atom/1 - No hardcoded secrets in source code
- 不对用户输入使用
Code.eval_string/1 - 不对不可信数据使用不带参数的
:safe:erlang.binary_to_term/1 - 不对外部输入使用
String.to_atom/1 - 源代码中没有硬编码的密钥
Major
主要问题
- ETS tables use appropriate access controls
- No sensitive data in process dictionary
- No dynamic module creation from user input
- Path traversal prevented in file operations
- ETS表使用适当的访问控制
- 进程字典中没有敏感数据
- 不通过用户输入动态创建模块
- 文件操作中防止路径遍历
Configuration
配置项
- Secrets loaded from environment
- No secrets in config/*.exs committed to git
- Runtime config used for deployment secrets
- 从环境变量加载密钥
- 提交到git的config/*.exs中不包含密钥
- 部署密钥使用运行时配置
Valid Patterns (Do NOT Flag)
有效模式(无需标记)
- String.to_atom on compile-time constants - Atoms created at compile time are safe
- Code.eval_string in dev/test - May be needed for tooling
- ETS :public tables - Valid when intentionally shared
- binary_to_term with :safe - Explicitly safe option used
- 编译时常量上的String.to_atom - 编译时创建的原子是安全的
- 开发/测试环境中的Code.eval_string - 工具可能需要使用
- ETS :public表 - 当需要共享时是有效的
- 带:safe参数的binary_to_term - 使用了明确的安全选项
Context-Sensitive Rules
上下文敏感规则
| Issue | Flag ONLY IF |
|---|---|
| String.to_atom | Input comes from external source (user, API, file) |
| binary_to_term | Data comes from untrusted source |
| ETS :public | Contains sensitive data |
| 问题 | 仅在以下情况标记 |
|---|---|
| String.to_atom | 输入来自外部源(用户、API、文件) |
| binary_to_term | 数据来自不可信源 |
| ETS :public | 包含敏感数据 |
Before Submitting Findings
提交发现前的步骤
Use the issue format: for each finding.
[FILE:LINE] ISSUE_TITLELoad and follow review-verification-protocol before reporting any issue.
每个发现使用格式:。
[文件:行号] 问题标题在报告任何问题之前,加载并遵循审查验证协议。