fable-security

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Fable Security

Fable Security

Reason about attacker-controlled paths and trust boundaries until every security finding has a concrete source, sink, prerequisite, and impact.
对攻击者可控路径和信任边界进行分析,直到每项安全发现都具备具体的源(source)、汇(sink)、前提条件(prerequisite)和影响(impact)。

Mission

任务目标

Security review is not a secret scan plus a generic checklist. It asks what an attacker can control, which privilege/data boundary that input can cross, what enforcement must hold, and whether the changed code preserves that property under failure and concurrency.
A clean scanner is evidence about scanner coverage, not a proof that the design is secure.
安全审查不是密钥扫描加上一套通用检查清单。审查需要回答:攻击者能够控制什么、输入可以跨越哪些权限或数据边界、系统必须维持哪些约束,以及变更后的代码在故障和并发情况下是否仍能保持这些属性。
扫描器未发现问题,只能说明扫描覆盖范围内的结果,并不能证明设计本身是安全的。

Activate When

启用条件

  • authentication, authorization, sessions, tokens, permissions, tenancy, or privileged actions change;
  • untrusted input reaches parsers, queries, templates, files, URLs, shells, webhooks, or deserializers;
  • secrets/credentials or cryptographic material are handled;
  • a diff changes trust boundaries, network exposure, storage access, package/install logic, or sandboxing;
  • a reported vulnerability/finding needs validation or severity calibration;
  • repository/package supply-chain behavior needs security review.
  • 身份认证、授权、会话、token、权限、租户隔离或特权操作发生变化;
  • 不可信输入进入解析器、数据库查询、模板、文件、URL、shell、webhook 或反序列化流程;
  • 处理密钥、凭据或加密材料;
  • diff 改变信任边界、网络暴露面、存储访问权限、软件包/安装逻辑或沙箱机制;
  • 需要验证或校准已报告的漏洞/发现;
  • 需要审查代码仓库或软件包的供应链行为。

Do Not Activate When

不启用条件

  • the task is only functional verification with no security question (
    fable-verify
    );
  • a generic maintainability review has no trust-boundary impact (
    fable-review
    );
  • a vulnerability is already validated and the user wants only a bounded fix (
    fable-execute
    , while preserving security acceptance).
  • 任务仅要求功能验证,且没有安全问题(
    fable-verify
    );
  • 任务只是通用可维护性审查,不涉及信任边界影响(
    fable-review
    );
  • 漏洞已经验证,用户只希望进行范围明确的修复(
    fable-execute
    ,同时保留安全验收标准)。

Security Work Classification

安全工作类型

ModePrimary question
Threat modelwhat assets/actors/boundaries/abuse paths exist?
Security diff reviewwhat security property changed in this diff?
Finding validationcan attacker-controlled data actually reach a sensitive sink?
Repository auditwhich exposed surfaces deserve deeper inspection?
Secret hygienecan sensitive values enter source/logs/artifacts?
Supply-chain/packagecan dependency/install/build boundaries be abused?
模式核心问题
威胁建模存在哪些资产、行为者、边界和滥用路径?
安全 diff 审查此 diff 改变了哪项安全属性?
发现验证攻击者可控的数据是否确实能够到达敏感 sink?
仓库审计哪些暴露面需要进一步深入检查?
密钥治理敏感值是否可能进入源代码、日志或构建产物?
供应链/软件包依赖、安装或构建边界是否可能被滥用?

Protocol

协议

Stage 1 — Define assets, actors, and trust boundaries

阶段 1——定义资产、行为者和信任边界

Identify:
  • protected assets/data/operations;
  • authenticated/unauthenticated/privileged actors;
  • tenant/user ownership boundaries;
  • external systems/webhooks/plugins;
  • process/filesystem/network privilege transitions.
Security conclusions without a named boundary are usually too vague.
识别:
  • 受保护的资产、数据和操作;
  • 已认证、未认证和特权行为者;
  • 租户/用户所有权边界;
  • 外部系统、webhook 和 plugin;
  • 进程、文件系统和网络之间的权限转移。
未明确指出具体边界的安全结论通常过于笼统。

Stage 2 — Trace attacker-controlled input to effect

阶段 2——将攻击者可控输入追踪到影响

For each relevant entrypoint follow:
source → parsing/normalization → validation → authorization → transformation → sensitive sink/side effect
Record where each security property is enforced and whether later transformations can invalidate earlier validation.
对于每个相关入口,沿以下链路追踪:
源(source) → 解析/规范化(parsing/normalization) → 验证(validation) → 授权(authorization) → 转换(transformation) → 敏感汇/副作用(sensitive sink/side effect)
记录每项安全属性在何处被强制实施,并判断后续转换是否会使先前的验证失效。

Stage 3 — Check the property appropriate to the boundary

阶段 3——按边界检查相应属性

Consider as relevant:
  • authentication vs authorization separation;
  • object/tenant ownership (IDOR/BOLA);
  • CSRF/state binding and redirect validation;
  • injection/query/template/shell boundaries;
  • path traversal/symlink/archive extraction;
  • SSRF and URL/DNS/redirect handling;
  • file upload content/size/storage/execution boundaries;
  • deserialization/parser resource abuse;
  • session/token expiry, replay, rotation, audience/issuer;
  • secrets in logs/errors/artifacts;
  • fail-open error handling;
  • race/TOCTOU and check-then-act authorization;
  • privilege escalation via configuration/plugins/hooks;
  • dependency/install script/supply-chain assumptions.
根据具体情况考虑:
  • 身份认证与授权是否明确分离;
  • 对象/租户所有权(IDOR/BOLA);
  • CSRF/状态绑定和重定向验证;
  • 注入、查询、模板和 shell 边界;
  • 路径遍历、符号链接和归档文件提取;
  • SSRF 以及 URL、DNS 和重定向处理;
  • 文件上传在内容、大小、存储和执行方面的边界;
  • 反序列化/解析器导致的资源滥用;
  • 会话/token 的过期、重放、轮换以及 audience/issuer;
  • 日志、错误和构建产物中的 secrets;
  • fail-open 错误处理;
  • 竞态/TOCTOU,以及先检查后执行(check-then-act)的授权问题;
  • 通过配置、plugin 或 hook 实现权限提升;
  • 依赖、安装脚本和供应链假设。

Stage 4 — Model failure and alternate paths

阶段 4——建模故障和替代路径

Ask:
  • What happens when validation service fails?
  • Is denial the default or does code continue?
  • Can retries duplicate a privileged action?
  • Can an attacker alter state between check and use?
  • Do background jobs re-check authorization or trust stale caller claims?
  • Does a redirect/proxy/parser transform the value after validation?
询问:
  • 验证服务发生故障时会发生什么?
  • 系统是否默认拒绝,还是会继续执行?
  • 重试是否可能重复执行特权操作?
  • 攻击者能否在检查与使用之间改变状态?
  • 后台任务是否会重新检查授权,还是会信任调用方已经过时的声明?
  • 重定向、代理或解析器是否会在验证后转换该值?

Stage 5 — Validate findings skeptically

阶段 5——审慎验证发现

For each candidate finding establish:
  • attacker prerequisites/control;
  • reachable source;
  • exact sink/privileged effect;
  • missing/bypassed control;
  • realistic exploitation path;
  • impact/scope;
  • existing mitigations that may invalidate or reduce severity.
Do not report a vulnerability merely because a dangerous API exists.
为每个候选发现建立:
  • 攻击者前提条件和控制能力;
  • 可达的源;
  • 精确的汇或特权效果;
  • 缺失或被绕过的控制;
  • 现实可行的利用路径;
  • 影响和范围;
  • 可能使该发现失效或降低严重性的现有缓解措施。
不要仅因为某个 API 存在危险就报告漏洞。

Stage 6 — Calibrate severity

阶段 6——校准严重性

Severity depends on exploitability + privilege gained + data/tenant scope + required conditions, not scanner labels alone.
Use
blocking
for plausible exploitable issues that violate a required security property. Mark uncertain candidates as needing validation instead of inflating them.
严重性取决于可利用性、获得的权限、数据/租户范围和所需条件,而不能仅依据扫描器标签。
对于可能可利用且违反必需安全属性的问题,使用
blocking
。将不确定的候选项标记为需要验证,而不是夸大其严重性。

Stage 7 — Produce bounded remediation evidence

阶段 7——提供范围明确的修复证据

A repair recommendation should name the property to restore and how to prove it, e.g. tenant ownership enforced atomically before mutation, canonical path contained after symlink resolution, redirect allowlist applied to normalized destination.
修复建议应说明要恢复的安全属性以及如何证明修复有效,例如:在执行变更前以原子方式强制执行租户所有权;在解析符号链接后确保规范路径仍位于允许范围内;对规范化后的目标应用重定向 allowlist。

Stage 8 — Keep security and functionality separate

阶段 8——区分安全与功能

Security evidence can block release, but does not substitute for functional test/build/runtime evidence. After repair, both security-specific and functional verification may be required.
安全证据可以阻止发布,但不能替代功能测试、构建或运行时证据。修复后,可能同时需要安全专项验证和功能验证。

Decision Rules

决策规则

  • Authentication proves identity; it does not prove authorization for a resource/action.
  • Validate/authorize as close as practical to the sensitive side effect, especially across async/background boundaries.
  • Normalize/canonicalize before containment/allowlist checks when transformations can change meaning.
  • Prefer allowlists/capability checks over blocklists for constrained destinations/actions.
  • A secret removed from current source may still exist in Git history/logs/artifacts; rotate exposed credentials when exposure is credible.
  • Scanner finding with no reachable attacker-controlled path is not automatically exploitable; validate source-to-sink.
  • Scanner clean result does not close design-level authz/logic threats.
  • Do not execute destructive exploit payloads against real systems; use safe local/fixture proof or code-path reasoning.
  • If remediation changes product behavior, hand to TDD/execute and require functional verification afterward.
  • 身份认证证明身份,但不证明用户有权访问特定资源或执行特定操作。
  • 尽可能在靠近敏感副作用的位置执行验证/授权,尤其是在跨越异步或后台边界时。
  • 如果转换可能改变含义,应先进行标准化/规范化(normalize/canonicalize),再执行范围限制或 allowlist 检查。
  • 对于受限目标或操作,优先使用 allowlist 或能力检查,而不是 blocklist。
  • 从当前源代码中移除的 secret 仍可能存在于 Git 历史、日志或构建产物中;只要暴露情况可信,就应轮换已暴露的凭据。
  • 不存在攻击者可达路径的扫描器发现不自动意味着可利用;应验证从源到汇的路径。
  • 扫描器结果干净并不能排除设计层面的授权或逻辑威胁。
  • 不要对真实系统执行破坏性 exploit payload;应使用安全的本地/fixture 证明或代码路径推理。
  • 如果修复改变产品行为,应移交给 TDD/execute,并在之后进行功能验证。

Invariants

不变量

  • Raw secrets are never reproduced in evidence or logs.
  • Every reported vulnerability has a concrete failure property and reachable path or is clearly labeled unvalidated.
  • Tenant/resource authorization is evaluated independently from login status.
  • Security review remains read-only unless explicitly shifted to remediation.
  • Functional correctness and security correctness remain separate evidence classes.
  • 证据或日志中绝不复现原始 secrets。
  • 每项报告的漏洞都必须具有具体的失败属性和可达路径,否则应明确标记为未验证。
  • 租户/资源授权独立于登录状态进行评估。
  • 除非明确转入修复阶段,否则安全审查保持只读。
  • 功能正确性与安全正确性属于彼此独立的证据类别。

Failure Taxonomy

失败分类

False positive

误报

Dangerous primitive exists but attacker cannot control source/reach sink or mitigation blocks it. Downgrade/drop with evidence.
危险原语确实存在,但攻击者无法控制源、无法到达汇,或缓解措施已阻止利用。应基于证据降级或移除该发现。

Hidden trust transition

隐藏的信任转移

Code crosses queue/plugin/proxy/background/storage boundary and assumes upstream validation. Trace/revalidate required property.
代码跨越队列、plugin、代理、后台或存储边界,并假定上游已完成验证。需要追踪并重新验证所需属性。

Fail-open path

Fail-open 路径

Control error/timeout falls through to privileged behavior. Treat as high-priority boundary failure.
控制服务报错或超时后仍继续执行特权行为。将其视为高优先级的边界失效。

TOCTOU/race

TOCTOU/竞态

Authorization/containment check is separated from side effect and mutable state can change. Seek atomic primitive/revalidation.
授权或范围检查与副作用相分离,且可变状态可能发生变化。应寻找原子操作或重新验证。

Sanitization mismatch

净化不匹配

Validation occurs before decode/normalization/redirect/symlink resolution. Check canonical value at sink boundary.
在解码、规范化、重定向或符号链接解析之前执行验证。检查汇边界处的规范值。

Secret exposure

Secret 暴露

Credential entered source/log/artifact/history. Remove exposure path and require rotation/containment as applicable.
凭据进入源代码、日志、构建产物或历史记录。移除暴露路径,并视情况要求轮换凭据或进行隔离。

Anti-Patterns

反模式

  • "no high CVEs, therefore secure";
  • generic OWASP checklist without tracing changed paths;
  • equating authenticated user with authorized user;
  • regex path checks before canonical resolution;
  • trusting webhook fields solely because request reached a webhook endpoint;
  • reporting theoretical API danger with no attacker path;
  • logging raw tokens to debug auth;
  • testing exploitability against production without authorization;
  • fixing security by disabling validation or broadening permissions to make tests pass.
  • “没有高危 CVE,因此系统安全”;
  • 不追踪变更路径就套用通用 OWASP 检查清单;
  • 把已认证用户等同于已授权用户;
  • 在规范路径解析前仅使用 regex 检查路径;
  • 仅因请求到达 webhook 端点就信任其字段;
  • 没有攻击者路径却报告理论上的 API 风险;
  • 为调试 auth 而记录原始 token;
  • 未经授权就在生产环境测试可利用性;
  • 通过禁用验证或扩大权限让测试通过,来“修复”安全问题。

Security Finding Packet

安全发现报告模板

text
Security property:
Asset/boundary:
Attacker prerequisites:
Source → transformations → control → sink:
Concrete failure scenario:
Existing mitigations:
Severity + rationale:
Evidence/location:
Bounded remediation property:
Security re-test:
Functional verification still required:
text
安全属性:
资产/边界:
攻击者前提条件:
源 → 转换 → 控制 → 汇:
具体失败场景:
现有缓解措施:
严重性 + 理由:
证据/位置:
范围明确的修复属性:
安全复测:
仍需进行功能验证:

Completion Criteria

完成标准

Security work completes when:
  • relevant trust boundaries and attacker-controlled paths were traced;
  • candidate findings were validated/calibrated rather than pattern-matched;
  • secrets were not exposed during analysis;
  • blocking findings have bounded remediation/verification criteria;
  • verdict states exactly what security property was checked and what remains not checked.
安全工作在满足以下条件时完成:
  • 已追踪相关信任边界和攻击者可控路径;
  • 候选发现经过验证和严重性校准,而非仅进行模式匹配;
  • 分析过程中未暴露任何 secrets;
  • blocking 发现具有范围明确的修复和验证标准;
  • 结论明确说明检查了哪些安全属性,以及哪些内容尚未检查。

Progressive Resources

渐进式资源

  • Deep guide:
    references/trust-boundary-and-finding-validation.md
  • Existing threat matrix:
    references/threat-modeling-matrix.md
  • Secret hygiene:
    references/secret-sanitization.md
  • Example:
    examples/security-audit-walkthrough.md
  • 深入指南:
    references/trust-boundary-and-finding-validation.md
  • 现有威胁矩阵:
    references/threat-modeling-matrix.md
  • 密钥治理:
    references/secret-sanitization.md
  • 示例:
    examples/security-audit-walkthrough.md