prd-securability-enhancement

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

PRD Securability Enhancement (FIASSE/SSEM + ASVS)

PRD安全性增强(FIASSE/SSEM + ASVS)

Enhance PRD content so each feature has explicit, testable securability requirements aligned to OWASP ASVS and shaped by FIASSE v1.0.4 / SSEM. The goal is to upgrade the requirements artifact before implementation, so delivery teams build securable capabilities by design rather than retrofitting controls later.
This skill is requirements-centric. It does not review or write code. If the user wants code review, redirect to
securability-engineering-review
. If they want code generation, redirect to
securability-engineering
.
增强PRD内容,使每个功能都具备符合OWASP ASVS标准、且遵循FIASSE v1.0.4/SSEM框架的明确、可测试的安全性需求。目标是在实施前升级需求文档,让交付团队从设计阶段就构建具备安全性的功能,而非事后补加控制措施。
本技能以需求为核心,不涉及代码评审或代码编写。如果用户需要代码评审,请引导至
securability-engineering-review
;如果需要代码生成,请引导至
securability-engineering

When to Invoke

触发场景

Trigger this skill when the user asks to:
  • Strengthen or harden a PRD, spec, user-story set, or product brief with security requirements
  • Choose an ASVS assurance level (Level 1, 2, or 3) for a product or feature
  • Map features to ASVS controls or check ASVS coverage of a requirements doc
  • Find missing security requirements before development starts
  • Annotate features with SSEM attributes or FIASSE tenets
  • Add testable security acceptance criteria to existing functional requirements
Adjacent phrasings: "security-review this spec", "what's missing security-wise from this feature list", "add NFRs for security to my PRD", "make these requirements securable".
当用户提出以下需求时,触发本技能:
  • 为PRD、规格文档、用户故事集或产品简报添加安全需求以强化其安全性
  • 为产品或功能选择ASVS保障级别(Level 1、2或3)
  • 将功能映射到ASVS控制项,或检查需求文档的ASVS覆盖情况
  • 在开发开始前查找缺失的安全需求
  • 为功能标注SSEM属性或FIASSE原则
  • 为现有功能需求添加可测试的安全验收标准
类似表述包括:“对这份规格文档进行安全评审”“这份功能清单在安全方面缺少什么”“为我的PRD添加安全相关NFR”“使这些需求具备可安全性”。

Inputs

输入要求

Ask the user for whatever is missing before starting:
  • The PRD, spec, or feature list (markdown, prose, ticket export, etc.)
  • System context: user types, deployment model, data sensitivity, integration surfaces
  • Compliance or risk context, if any (HIPAA, PCI, SOC 2, regulated industry)
  • Whether they have an ASVS level preference, or want this skill to recommend one
If the artifact is large, parse the features inline; do not require the user to pre-extract them.
开始前请向用户确认以下缺失信息:
  • PRD、规格文档或功能清单(支持markdown、散文、工单导出等格式)
  • 系统上下文:用户类型、部署模式、数据敏感度、集成接口
  • 合规或风险上下文(如适用):HIPAA、PCI、SOC 2、受监管行业
  • 用户是否有ASVS级别偏好,或是否需要本技能推荐合适级别
如果文档内容较大,请直接解析其中的功能,无需用户提前提取。

Procedure

操作流程

Step 1 — Parse features

步骤1 — 解析功能

Extract each feature into a normalized record. Capture for each:
  • Feature ID and title (assign IDs like
    F-01
    if absent)
  • Actor (user role, system, external service)
  • Data touched and sensitivity class
  • Trust boundaries crossed (browser↔server, service↔service, server↔storage, internal↔external)
  • Existing acceptance criteria (verbatim, even if weak)
If the source PRD lumps several capabilities into one bullet, split them so each feature is independently testable.
将每个功能提取为标准化记录,每条记录需包含:
  • 功能ID和标题(如无则分配类似
    F-01
    的ID)
  • 参与者(用户角色、系统、外部服务)
  • 涉及的数据及其敏感度分类
  • 跨越的信任边界(浏览器↔服务器、服务↔服务、服务器↔存储、内部↔外部)
  • 现有验收标准(原文保留,即使标准较弱)
如果源PRD将多个功能合并为一个项目符号,请拆分它们,确保每个功能可独立测试。

Step 2 — Choose the ASVS level first

步骤2 — 先选择ASVS级别

Selecting the level before mapping requirements prevents both under-scoping and over-scoping. Use this rubric:
LevelUse when
1Internal tooling, prototypes, low-sensitivity data, no regulatory pressure, limited blast radius if compromised
2Typical production web/API systems with authenticated users, business-critical behavior, customer data, or moderate regulatory exposure (most products land here)
3High-assurance contexts: payments, health records, government, identity providers, anything where compromise causes severe material impact or where attackers are well-resourced
Default to Level 2 unless evidence pushes lower or higher. Document:
  • Chosen level
  • Why lower levels are insufficient (when level > 1)
  • Any specific features that should escalate above the baseline (e.g., a payments endpoint inside a Level-2 product gets Level-3 treatment)
在映射需求前选择级别,可避免范围过窄或过宽。请遵循以下准则:
级别适用场景
1内部工具、原型、低敏感度数据、无监管压力、被攻破后影响范围有限
2典型生产级Web/API系统,包含已认证用户、业务核心功能、客户数据,或存在中等监管要求(大多数产品适用此级别)
3高保障场景:支付系统、健康记录、政府系统、身份提供商,任何被攻破会造成严重实质性影响或面临高资源攻击者的系统
默认选择Level 2,除非有证据支持更低或更高级别。需记录:
  • 选定级别
  • 为何更低级别不足以满足需求(当级别>1时)
  • 任何需要高于基线级别的特定功能(例如,Level-2产品中的支付端点需采用Level-3标准)

Step 3 — Map each feature to ASVS

步骤3 — 将每个功能映射到ASVS

For every feature, use
data/asvs/README.md
(chapter index) and the
when_to_use
frontmatter in
data/asvs/V*.md
to identify applicable chapters. Common mappings:
  • Auth flows → V2 (Authentication), V3 (Session Management)
  • Authorization, ownership, multi-tenant scoping → V4 (Access Control)
  • File upload/download → V5 (File Handling)
  • Crypto, password storage, tokens → V6 (Cryptography)
  • Logging, error handling, observability → V7 (Error/Logging)
  • PII, data at rest/in transit → V8 (Data Protection), V14 (Secure Communication)
  • Public APIs → V9 (API/Web Services)
  • Config, secrets, deployment → V10 (Configuration)
  • Workflow rules, anti-automation → V11 (Business Logic)
  • Any user/external input → V12 (Input Validation)
  • Anything rendered or returned to a client → V13 (Output Encoding)
  • Sensitive data lifecycle → V16 (Sensitive Data)
Filter requirements by the chosen ASVS level. For each requirement, classify coverage:
  • Covered — the PRD already satisfies the intent
  • Partial — partly covered; clarify or strengthen acceptance criteria
  • Missing — requirement absent and must be added
  • N/A — justified with a one-line rationale
Use the ASVS Coverage Gap Pattern Table below to spot the gaps that PRDs reliably miss.
针对每个功能,使用
data/asvs/README.md
(章节索引)和
data/asvs/V*.md
中的
when_to_use
前置信息确定适用章节。常见映射如下:
  • 认证流程 → V2(Authentication)、V3(Session Management)
  • 授权、所有权、多租户范围 → V4(Access Control)
  • 文件上传/下载 → V5(File Handling)
  • 加密、密码存储、令牌 → V6(Cryptography)
  • 日志、错误处理、可观测性 → V7(Error/Logging)
  • PII、静态/传输数据 → V8(Data Protection)、V14(Secure Communication)
  • 公共API → V9(API/Web Services)
  • 配置、密钥、部署 → V10(Configuration)
  • 工作流规则、反自动化 → V11(Business Logic)
  • 任何用户/外部输入 → V12(Input Validation)
  • 任何返回给客户端的内容 → V13(Output Encoding)
  • 敏感数据生命周期 → V16(Sensitive Data)
根据选定的ASVS级别筛选需求,并为每个需求分类覆盖情况:
  • 已覆盖 — PRD已满足需求意图
  • 部分覆盖 — 部分满足,需明确或强化验收标准
  • 缺失 — 需求未提及,必须添加
  • 不适用 — 需提供一行理由说明
使用下方的ASVS覆盖缺口模式表识别PRD中普遍存在的缺口。

Step 4 — Add Securability Notes per feature

步骤4 — 为每个功能添加安全性说明

Write a short paragraph per feature surfacing only the SSEM and FIASSE points that materially shape implementation. Do not enumerate all ten SSEM attributes or all FIASSE tenets — that produces noise.
Useful lenses (mention only when relevant):
  • Trust-boundary handling and input canonicalization (FIASSE v1.0.4 S4.3, S4.4.1)
  • Derived Integrity — never trust client-supplied values for server-owned state (FIASSE v1.0.4 S4.4.1.2)
  • Request Surface Minimization — process only the named values you expect (FIASSE v1.0.4 S4.4.1.1)
  • Observability: what must be logged or auditable (FIASSE v1.0.4 S3.2.1.4 + Accountability; Transparency S2.5)
  • Least Astonishment — predictable behavior at trust boundaries and error paths (FIASSE v1.0.4 S2.6)
  • Resilience or availability drivers (rate limits, timeouts, graceful and secure failure)
  • Testability or modifiability mandates (e.g., centralizing crypto/auth in a dedicated module)
  • Dependency stewardship — ongoing relationship with third-party code (FIASSE v1.0.4 S4.6)
为每个功能编写一段简短的说明,仅列出对实现有实质影响的SSEM和FIASSE要点。无需枚举所有10个SSEM属性或所有FIASSE原则,避免产生冗余信息。
可参考以下视角(仅在相关时提及):
  • 信任边界处理和输入规范化(FIASSE v1.0.4 S4.3、S4.4.1)
  • 派生完整性——绝不信任客户端提供的服务器自有状态值(FIASSE v1.0.4 S4.4.1.2)
  • 请求范围最小化——仅处理预期的指定值(FIASSE v1.0.4 S4.4.1.1)
  • 可观测性:必须记录或可审计的内容(FIASSE v1.0.4 S3.2.1.4 + 问责制;透明度S2.5)
  • 最小意外原则——信任边界和错误路径的行为可预测(FIASSE v1.0.4 S2.6)
  • 弹性或可用性驱动因素(速率限制、超时、优雅且安全的故障处理)
  • 可测试性或可修改性要求(例如,将加密/认证集中在专用模块中)
  • 依赖管理——与第三方代码的持续维护关系(FIASSE v1.0.4 S4.6)

Step 5 — Convert into testable acceptance criteria

步骤5 — 转换为可测试的验收标准

For each added or strengthened requirement, write at least one acceptance criterion that is:
  • Behaviorally observable (a test or audit can confirm pass/fail)
  • Specific about boundary conditions (failure modes, unauthorized actors, malformed input)
  • Tied to a verifiable artifact (log line, response code, denied action)
Ambiguous "secure" or "robust" language is not acceptable here.
对于每个新增或强化的需求,至少编写一条符合以下要求的验收标准:
  • 可通过行为观测验证(测试或审计可确认通过/失败)
  • 明确边界条件(故障模式、未授权参与者、格式错误的输入)
  • 关联可验证的产物(日志行、响应码、被拒绝的操作)
模糊的“安全”或“健壮”表述不符合要求。

Step 6 — Emit the enhanced PRD artifact

步骤6 — 输出增强后的PRD文档

Produce these sections in order, using the exact templates below.
按以下顺序生成各部分内容,严格使用下方模板。

ASVS Coverage Gap Pattern Table

ASVS覆盖缺口模式表

These are the gaps PRDs reliably miss. When you see one of the trigger phrasings on the left, add the named requirements on the right — they are almost always missing in the source artifact.
PRD trigger phrasing (what the feature says)Almost-always-missing requirementsASVS sectionTag
"User logs in with email and password"Account-enumeration parity (same response/timing for valid vs invalid email); password-screen against breached-password list; auth-event audit log; per-account brute-force rate limitV6.3.8, V2.1, V2.4, V16.3"Auth surface gaps"
"User resets/forgets password"Account-enumeration parity on the request endpoint; single-use token; short expiry (≤15 min); token-hash-at-rest; rate-limit per email and per IP; audit log of issuance/redemptionV6.3.8, V6.2, V2.4, V16.3"Reset flow gaps"
"User uploads a file"Type allow-list (not deny-list); content-sniffing vs declared type; max size; antivirus/safe-storage path; filename canonicalization; storage outside web root; URL non-guessabilityV5.1, V5.2, V12.1"Upload gaps"
"User can edit their profile" / "update settings"Allow-listed mutable fields (no
email
/
role
/
is_admin
from request body); ownership check on the resource; audit log of changes; old-vs-new value capture
V4.1, V4.2, V16.2, V16.3"Mass-assignment gaps"
"Admin can do X" / "role-based access"Authorization decision logged with grant/deny; centralized authz module (not scattered checks); deny-by-default at boundary; ownership scoping on every record fetchV4.1, V4.2, V16.2, V16.3"Authz gap"
"Public API endpoint" / "third-party integration"Per-key/per-client rate limits; auth for every call (not first-call only); request-id propagation; response field allow-list (no leaking internal fields); contract validationV2.4, V9.1, V13.1, V16.2"API gaps"
"Send email/SMS to user"Templated payload with no user-controlled subject/body injection; rate-limit per recipient and per actor; bounce/abuse-loop handling; opt-out and audit logV2.4, V12.1, V13.1, V16.3"Outbound-message gaps"
"Search / filter / list with user-supplied parameters"Parameter allow-list; ordering/pagination caps; query timeout; result count cap; tenant/owner scoping enforced server-sideV4.1, V12.1, V13.1"Query-surface gaps"
"Webhook receiver" / "callback URL"Source verification (signature, mTLS, IP allow-list); replay protection (timestamp + nonce); idempotency key; rate-limit; audit log of received eventsV2.4, V2.5, V9.1, V16.3"Webhook gaps"
"Save user file/document/note"Owner identifier never client-supplied; size and content caps; rich-text/HTML sanitization on read or write; audit log of writesV4.1, V5.1, V12.1, V16.3"Server-owned state gaps (Derived Integrity)"
"Export data" / "download report"Authorization re-checked on export (not just on UI route); rate-limit; audit log including row count; PII-scrub policy if applicableV4.1, V7.1.1, V8.1"Export gaps"
"Background job processes user-submitted data"Same boundary discipline as the synchronous path (validation, surface minimization, owner scoping); job-level audit log; poison-message handling and DLQV11.1, V12.1, V7.1.1"Async-path boundary gaps"
"Configuration / feature flag / admin setting"Change requires authenticated actor and audit record; cannot be set via product API without admin role; secret values never echoed back; defaults are safeV7.1.1, V10.1, V14.2"Config-surface gaps"
"PII/PHI/financial data" mentioned anywhereField-level classification; encryption at rest and in transit; retention/disposal policy; access-log requirement; export/erasure (right-to-be-forgotten) flowsV8.1, V14.1"Sensitive-data lifecycle gaps"
"Real-time" / "websocket" / "streaming" featurePer-connection auth (not just first message); per-connection resource caps; back-pressure / max-queue; idle timeout; audit of connection lifecycleV3.1, V9.1, V11.1.4"Streaming gaps"
"AI/LLM-backed feature"Prompt-injection handling at trust boundary; output validation before downstream side effects; per-actor rate limit and cost cap; audit log of prompts and tool calls; PII redaction policyV11.1, V12.1, V8.1"LLM boundary gaps"
When a feature triggers one of these patterns, prefill the corresponding requirements as Missing in the coverage matrix unless the PRD explicitly addresses them — most of the time it doesn't.
这些是PRD中普遍存在的缺口。当左侧的触发表述出现在功能描述中时,请添加右侧列出的需求——这些需求几乎总是在源文档中缺失。
PRD触发表述(功能描述内容)几乎总是缺失的需求ASVS章节标签
"用户使用邮箱和密码登录"账户枚举一致性(有效/无效邮箱返回相同响应/时序);密码需检查是否在泄露密码列表中;认证事件审计日志;每个账户的暴力破解速率限制V6.3.8、V2.1、V2.4、V16.3"Auth surface gaps"
"用户重置/忘记密码"请求端点的账户枚举一致性;一次性令牌;短有效期(≤15分钟);令牌静态存储为哈希值;按邮箱和IP限制速率;令牌发放/兑换审计日志V6.3.8、V6.2、V2.4、V16.3"Reset flow gaps"
"用户上传文件"类型白名单(而非黑名单);内容嗅探与声明类型对比;最大尺寸限制;防病毒/安全存储路径;文件名规范化;存储在Web根目录外;URL不可猜测V5.1、V5.2、V12.1"Upload gaps"
"用户可编辑个人资料" / "更新设置"可修改字段白名单(请求体中不包含
email
/
role
/
is_admin
);资源所有权检查;更改审计日志;新旧值记录
V4.1、V4.2、V16.2、V16.3"Mass-assignment gaps"
"管理员可执行X操作" / "基于角色的访问"授权决策需记录允许/拒绝情况;集中式授权模块(而非分散检查);边界默认拒绝;每条记录获取时的所有权范围限制V4.1、V4.2、V16.2、V16.3"Authz gap"
"公共API端点" / "第三方集成"按密钥/客户端限制速率;每次调用都需认证(而非仅首次调用);请求ID传递;响应字段白名单(不泄露内部字段);契约验证V2.4、V9.1、V13.1、V16.2"API gaps"
"向用户发送邮件/SMS"模板化负载,无用户可控主题/内容注入;按接收者和参与者限制速率;退信/滥用循环处理;退订和审计日志V2.4、V12.1、V13.1、V16.3"Outbound-message gaps"
"使用用户提供的参数进行搜索/筛选/列表展示"参数白名单;排序/分页限制;查询超时;结果数量限制;服务器端强制租户/所有者范围限制V4.1、V12.1、V13.1"Query-surface gaps"
"Webhook接收器" / "回调URL"源验证(签名、mTLS、IP白名单);重放保护(时间戳+随机数);幂等键;速率限制;接收事件审计日志V2.4、V2.5、V9.1、V16.3"Webhook gaps"
"保存用户文件/文档/笔记"所有者标识符绝不由客户端提供;尺寸和内容限制;读取或写入时的富文本/HTML清理;写入审计日志V4.1、V5.1、V12.1、V16.3"Server-owned state gaps (Derived Integrity)"
"导出数据" / "下载报告"导出时重新检查授权(而非仅在UI路由检查);速率限制;包含行数的审计日志;适用时的PII清理策略V4.1、V7.1.1、V8.1"Export gaps"
"后台任务处理用户提交的数据"遵循与同步路径相同的边界规则(验证、范围最小化、所有者范围限制);任务级审计日志;毒消息处理和死信队列(DLQ)V11.1、V12.1、V7.1.1"Async-path boundary gaps"
"配置/功能开关/管理员设置"更改需经过认证参与者操作并记录审计信息;无法通过产品API在无管理员角色的情况下修改;密钥值绝不回显;默认值安全V7.1.1、V10.1、V14.2"Config-surface gaps"
任何提及"PII/PHI/财务数据"的内容字段级分类;静态和传输加密;保留/处置策略;访问日志要求;导出/删除(被遗忘权)流程V8.1、V14.1"Sensitive-data lifecycle gaps"
"实时" / "websocket" / "流式"功能每个连接都需认证(而非仅首次消息);每个连接的资源限制;背压/最大队列;空闲超时;连接生命周期审计V3.1、V9.1、V11.1.4"Streaming gaps"
"AI/LLM支持的功能"信任边界处的提示注入处理;下游副作用前的输出验证;按参与者限制速率和成本上限;提示和工具调用的审计日志;PII脱敏策略V11.1、V12.1、V8.1"LLM boundary gaps"
当某个功能触发这些模式时,在覆盖矩阵中将对应的需求标记为缺失,除非PRD明确提及这些需求——大多数情况下PRD不会包含这些内容。

Output Templates

输出模板

A. ASVS Level Decision

A. ASVS级别决策

markdown
undefined
markdown
undefined

ASVS Level Decision

ASVS级别决策

Chosen Level: [1 | 2 | 3]
Rationale: [2–4 sentences. Cover data sensitivity, user population, regulatory context, and material-impact reasoning. Note why lower levels are insufficient if Level > 1.]
Feature-Level Escalations: [List any features that need a higher level than baseline, with one-line justification, or "None".]
undefined
选定级别: [1 | 2 | 3]
理由: [2-4句话。涵盖数据敏感度、用户群体、监管背景和实质性影响推理。如果级别>1,说明为何更低级别不足以满足需求。]
功能级别升级: [列出任何需要高于基线级别的功能及一行理由,或填写“无”。]
undefined

B. Coverage Matrix

B. 覆盖矩阵

markdown
undefined
markdown
undefined

Feature ↔ ASVS Coverage Matrix

功能 ↔ ASVS覆盖矩阵

FeatureASVS SectionRequirement IDLevelCoveragePRD Change Needed
F-01V2.22.2.12MissingAdd MFA requirement for high-risk actions
F-01V7.17.1.12PartialSpecify which auth events are logged
F-02V12.112.1.12Covered

Aim for completeness over brevity here — every feature × every applicable requirement gets a row. Where the gap pattern table applies, include the named requirements it surfaces.
功能ASVS章节需求ID级别覆盖情况PRD需修改内容
F-01V2.22.2.12缺失添加高风险操作的MFA需求
F-01V7.17.1.12部分覆盖指定需记录的认证事件
F-02V12.112.1.12已覆盖

此处需完整而非简略——每个功能×每个适用需求都需占一行。如果适用缺口模式表,需包含表中列出的对应需求。

C. Enhanced Feature Specifications

C. 增强后的功能规格

For each feature, emit exactly this shape:
markdown
undefined
每个功能需严格按照以下格式输出:
markdown
undefined

Feature F-01: [Title]

功能F-01: [标题]

Actor: [user role / system] Data: [data classes touched] Trust Boundaries: [boundaries crossed]
ASVS Mapping: V2.2.1, V7.1.1, ...
Updated Requirements:
  • [Original requirement, kept or rewritten]
  • [Newly added requirement from ASVS mapping]
  • [Newly added requirement from ASVS mapping]
Acceptance Criteria:
  • [Testable criterion tied to a requirement above]
  • [Testable criterion tied to a requirement above]
Securability Notes: [Short paragraph — only material SSEM/FIASSE points for this feature. Do not enumerate all attributes.]
undefined
参与者: [用户角色/系统] 数据: [涉及的数据分类] 信任边界: [跨越的边界]
ASVS映射: V2.2.1, V7.1.1, ...
更新后的需求:
  • [保留或改写后的原始需求]
  • [从ASVS映射新增的需求]
  • [从ASVS映射新增的需求]
验收标准:
  • [与上述需求关联的可测试标准]
  • [与上述需求关联的可测试标准]
安全性说明: [简短段落——仅包含对该功能有实质影响的SSEM/FIASSE要点,无需枚举所有属性。]
undefined

D. Cross-Cutting Securability Requirements

D. 跨领域安全性需求

Controls that span multiple features (centralized logging, secrets management, dependency policy, baseline TLS, error-handling standards). One bullet each, with the ASVS reference.
适用于多个功能的控制措施(集中式日志、密钥管理、依赖策略、基线TLS、错误处理标准)。每个措施用一个项目符号列出,并标注ASVS参考。

E. Open Gaps and Assumptions

E. 未解决缺口与假设

Anything you could not resolve from the input: missing system context, unclear data sensitivity, unstated user populations, deferred decisions. Be explicit so the team can close these before implementation.
任何无法通过输入信息解决的问题:缺失的系统上下文、不明确的数据敏感度、未说明的用户群体、待决策事项。需明确列出,以便团队在实施前解决这些问题。

Worked Example (Mini)

示例(简化版)

Input feature (from a PRD):
F-03: Users can reset their password by clicking "Forgot Password" and entering their email. The system emails a reset link.
This trips the "Reset flow gaps" pattern in the gap table — so the missing requirements are predictable.
Enhanced output:
markdown
undefined
输入功能(来自PRD):
F-03: 用户点击“忘记密码”并输入邮箱即可重置密码。系统将发送重置链接至邮箱。
此功能触发了缺口表中的“Reset flow gaps”模式——因此缺失的需求可预测。
增强后的输出:
markdown
undefined

Feature F-03: Password Reset via Email

功能F-03: 邮箱重置密码

Actor: Unauthenticated user (claiming an account) Data: Email address (PII), password (credential), reset token Trust Boundaries: browser → public API; API → email provider; API → credential store
ASVS Mapping: V2.2.2, V6.2.1, V6.2.2, V7.1.1, V11.1.4, V12.1.1
Updated Requirements:
  • User can request a password reset by entering an account email at
    /reset
    .
  • The system always returns the same success response whether or not the email matches an account (prevents account enumeration, V2.2.2).
  • Reset tokens are single-use, expire within 15 minutes, and are stored only as a salted hash (V6.2).
  • New passwords are validated against a minimum policy and screened against a known-breached-password list (V6.2.1).
  • All reset requests, token issuances, token redemptions, and password changes are logged with user ID, source IP, user agent, and outcome (V7.1.1).
  • Reset requests are rate-limited per email and per source IP (V11.1.4).
  • The email input is canonicalized and validated against a strict format (V12.1.1).
Acceptance Criteria:
  • Submitting a non-existent email returns the same response body, status code, and timing characteristics as a valid email (within tolerance).
  • A reset token cannot be redeemed after 15 minutes or after first successful use; both cases produce a generic failure response and a logged
    reset_token_invalid
    event.
  • More than 5 reset requests for the same email within 10 minutes are rejected with HTTP 429 and logged.
  • Audit log lines for reset events are queryable by user ID and contain the fields above.
Securability Notes: This feature crosses an unauthenticated trust boundary (FIASSE v1.0.4 S4.3), so input handling and rate limiting are the load-bearing concerns. The reset token is server-owned state; never accept client-supplied token attributes beyond the opaque token itself (Derived Integrity, FIASSE v1.0.4 S4.4.1.2). Centralize token generation, hashing, and verification in a single module so the policy can evolve without touching call sites (Modifiability). All reset events must be observable in the audit pipeline so abuse patterns can be detected (Accountability + Observability, FIASSE v1.0.4 S3.2.1.4; Transparency S2.5).

This is the level of specificity the output should hit — concrete, testable, and traceable back to ASVS.
参与者: 未认证用户(声称拥有账户) 数据: 邮箱地址(PII)、密码(凭证)、重置令牌 信任边界: 浏览器 → 公共API; API → 邮件提供商; API → 凭证存储
ASVS映射: V2.2.2, V6.2.1, V6.2.2, V7.1.1, V11.1.4, V12.1.1
更新后的需求:
  • 用户可通过在
    /reset
    页面输入账户邮箱请求重置密码。
  • 无论邮箱是否匹配账户,系统始终返回相同的成功响应(防止账户枚举,V2.2.2)。
  • 重置令牌为一次性使用,15分钟内过期,且仅以加盐哈希形式存储(V6.2)。
  • 新密码需符合最低策略要求,并检查是否在已知泄露密码列表中(V6.2.1)。
  • 所有重置请求、令牌发放、令牌兑换和密码更改操作都需记录用户ID、源IP、用户代理和结果(V7.1.1)。
  • 按邮箱和源IP限制重置请求速率(V11.1.4)。
  • 邮箱输入需规范化并验证为严格格式(V12.1.1)。
验收标准:
  • 提交不存在的邮箱时,返回的响应体、状态码和时序特征与有效邮箱一致(在误差范围内)。
  • 重置令牌超过15分钟或首次成功使用后无法兑换;两种情况均返回通用失败响应并记录
    reset_token_invalid
    事件。
  • 10分钟内同一邮箱的重置请求超过5次时,返回HTTP 429并记录日志。
  • 重置事件的审计日志可按用户ID查询,并包含上述字段。
安全性说明: 本功能跨越未认证信任边界(FIASSE v1.0.4 S4.3),因此输入处理和速率限制是核心关注点。重置令牌属于服务器自有状态;绝不要接受客户端提供的令牌属性,仅处理不透明令牌本身(派生完整性,FIASSE v1.0.4 S4.4.1.2)。将令牌生成、哈希和验证集中在单个模块中,以便无需修改调用点即可更新策略(可修改性)。所有重置事件必须在审计管道中可观测,以便检测滥用模式(问责制+可观测性,FIASSE v1.0.4 S3.2.1.4;透明度S2.5)。

输出需达到此详细程度——具体、可测试且可追溯至ASVS标准。

Quality Checklist (run before emitting)

质量检查清单(输出前执行)

Coverage
  • Every feature has an ID, actor, data classification, and trust-boundary list
  • ASVS level is chosen and justified before per-feature mapping
  • Every feature mapped against all applicable ASVS chapters at the chosen level
  • Gap patterns from the table above were applied to every relevant feature
  • Every Missing/Partial item produced a concrete PRD change
Output discipline
  • Coverage matrix is present and includes change-needed column
  • Each feature follows the exact output shape (Actor / Data / Trust Boundaries / ASVS Mapping / Updated Requirements / Acceptance Criteria / Securability Notes)
  • Acceptance criteria are behaviorally testable, not aspirational
  • Securability Notes are surgical — only material SSEM/FIASSE points, not exhaustive enumeration
Traceability
  • Every added requirement cites its ASVS reference
  • Cross-cutting requirements section captures shared controls
  • Open gaps and assumptions are listed explicitly
覆盖情况
  • 每个功能都有ID、参与者、数据分类和信任边界列表
  • 先选择并说明ASVS级别,再进行功能映射
  • 每个功能都按选定级别映射至所有适用的ASVS章节
  • 表中的缺口模式已应用于所有相关功能
  • 每个缺失/部分覆盖项都对应具体的PRD修改内容
输出规范
  • 包含覆盖矩阵,且包含“需修改内容”列
  • 每个功能严格遵循输出格式(参与者/数据/信任边界/ASVS映射/更新后的需求/验收标准/安全性说明)
  • 验收标准可通过行为测试验证,而非空泛表述
  • 安全性说明精准——仅包含实质的SSEM/FIASSE要点,而非详尽枚举
可追溯性
  • 每个新增需求都标注ASVS参考
  • 跨领域需求部分涵盖共享控制措施
  • 明确列出未解决缺口与假设

When in doubt

不确定时的处理原则

  • Prefer adding a missing requirement over assuming coverage; mark it explicitly so reviewers see it.
  • Prefer fewer, sharper ASVS references per feature over a long list that nobody will action.
  • Prefer plain language in Securability Notes — these are read by product managers, not just security engineers.
  • 优先添加缺失的需求,而非假设已覆盖;需明确标记,以便评审人员可见。
  • 每个功能优先选择少量精准的ASVS参考,而非冗长的无人关注的列表。
  • 安全性说明优先使用平实语言——这些内容不仅供安全工程师阅读,也供产品经理查看。

Reference Material

参考资料

  • Step-by-step runbook: plays/prd-fiasse-asvs-enhancement.md
  • ASVS chapter index:
    data/asvs/README.md
  • ASVS requirements (per chapter):
    data/asvs/V*.md
  • FIASSE v1.0.4 foundational principles:
    data/fiasse/S2.1.md
    S2.6.md
    (Transparency S2.5, Least Astonishment S2.6)
  • FIASSE v1.0.4 SSEM attribute umbrellas:
    data/fiasse/S3.2.1.md
    S3.2.3.md
    ; leaf files (e.g.
    S3.2.1.4.md
    Observability) for attribute-specific guidance
  • FIASSE v1.0.4 Boundary Control and Resilient Coding:
    data/fiasse/S4.3.md
    ,
    S4.4.md
    , and the canonical-input-handling leaves
    S4.4.1.md
    ,
    S4.4.1.1.md
    ,
    S4.4.1.2.md
  • FIASSE v1.0.4 Dependency Management and Stewardship:
    data/fiasse/S4.5.md
    ,
    S4.6.md
  • 分步手册: plays/prd-fiasse-asvs-enhancement.md
  • ASVS章节索引:
    data/asvs/README.md
  • ASVS需求(按章节):
    data/asvs/V*.md
  • FIASSE v1.0.4基础原则:
    data/fiasse/S2.1.md
    S2.6.md
    (透明度S2.5、最小意外原则S2.6)
  • FIASSE v1.0.4 SSEM属性总览:
    data/fiasse/S3.2.1.md
    S3.2.3.md
    ;属性特定指南见叶子文件(如
    S3.2.1.4.md
    可观测性)
  • FIASSE v1.0.4边界控制与弹性编码:
    data/fiasse/S4.3.md
    S4.4.md
    ,以及规范化输入处理叶子文件
    S4.4.1.md
    S4.4.1.1.md
    S4.4.1.2.md
  • FIASSE v1.0.4依赖管理与维护:
    data/fiasse/S4.5.md
    S4.6.md