Elixir Security Review
Quick Reference
references/atom-exhaustion.md |
| Config, environment variables |
references/secrets.md |
| ETS visibility, process dictionary |
references/process-exposure.md |
Review Checklist
Critical (Block Merge)
- - [ ] No
Code.eval_string/1 on user input - [ ] No
:erlang.binary_to_term/1 without :safe on untrusted data - [ ] No
String.to_atom/1 on external input - [ ] No hardcoded secrets in source code
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
Configuration
- - [ ] Secrets loaded from environment
- [ ] No secrets in config/*.exs committed to git
- [ ] Runtime config used for deployment secrets
Valid Patterns (Do NOT Flag)
- - String.toatom on compile-time constants - Atoms created at compile time are safe
- Code.evalstring in dev/test - May be needed for tooling
- ETS :public tables - Valid when intentionally shared
- binarytoterm with :safe - Explicitly safe option used
Context-Sensitive Rules
| Issue | Flag ONLY IF |
|---|
| String.toatom | Input comes from external source (user, API, file) |
| binaryto_term |
Data comes from untrusted source |
| ETS :public | Contains sensitive data |
Before Submitting Findings
Use the issue format: [FILE:LINE] ISSUE_TITLE for each finding.
Load and follow review-verification-protocol before reporting any issue.
Elixir 安全审查
快速参考
references/atom-exhaustion.md |
| 配置、环境变量 |
references/secrets.md |
| ETS 可见性、进程字典 |
references/process-exposure.md |
审查清单
严重问题(阻止合并)
- - [ ] 未对用户输入使用 Code.evalstring/1
- [ ] 未对不可信数据使用不带 :safe 选项的 :erlang.binarytoterm/1
- [ ] 未对外部输入使用 String.toatom/1
- [ ] 源代码中无硬编码的机密信息
主要问题
- - [ ] ETS 表使用了适当的访问控制
- [ ] 进程字典中无敏感数据
- [ ] 未根据用户输入动态创建模块
- [ ] 文件操作中已防止路径遍历
配置
- - [ ] 机密信息从环境变量加载
- [ ] config/*.exs 中无提交到 git 的机密信息
- [ ] 运行时配置用于部署机密信息
有效模式(请勿标记)
- - 对编译时常量使用 String.toatom - 编译时创建的原子是安全的
- 在开发/测试环境中使用 Code.evalstring - 工具可能需要
- ETS :public 表 - 有意共享时是有效的
- 带 :safe 选项的 binarytoterm - 使用了明确的安全选项
上下文相关规则
| 问题 | 仅在以下情况标记 |
|---|
| String.toatom | 输入来自外部来源(用户、API、文件) |
| binaryto_term |
数据来自不可信来源 |
| ETS :public | 包含敏感数据 |
提交发现结果前
对每个发现结果使用以下格式:[文件:行号] 问题标题。
在报告任何问题前,请加载并遵循 审查验证协议。