elixir-security-review

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Elixir Security Review

Elixir代码安全审查

Quick Reference

快速参考

Issue TypeReference
Code.eval_string, binary_to_termreferences/code-injection.md
String.to_atom dangersreferences/atom-exhaustion.md
Config, environment variablesreferences/secrets.md
ETS visibility, process dictionaryreferences/process-exposure.md
问题类型参考文档
Code.eval_string、binary_to_termreferences/code-injection.md
String.to_atom 风险references/atom-exhaustion.md
配置、环境变量references/secrets.md
ETS可见性、进程字典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
  • 不对用户输入使用
    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

上下文敏感规则

IssueFlag ONLY IF
String.to_atomInput comes from external source (user, API, file)
binary_to_termData comes from untrusted source
ETS :publicContains sensitive data
问题仅在以下情况标记
String.to_atom输入来自外部源(用户、API、文件)
binary_to_term数据来自不可信源
ETS :public包含敏感数据

Before Submitting Findings

提交发现前的步骤

Use the issue format:
[FILE:LINE] ISSUE_TITLE
for each finding.
Load and follow review-verification-protocol before reporting any issue.
每个发现使用格式:
[文件:行号] 问题标题
在报告任何问题之前,加载并遵循审查验证协议