forge-security-review

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Forge Security Review

Forge 安全审查

Runs a Forge-focused white-box security review and reports validated findings with exploitability, impact, evidence, and remediation guidance.
开展以 Forge 为重点的白盒安全审查,并报告经过验证的安全发现,包括可利用性、影响、证据和修复建议。

Token-Efficient Default

Token 高效默认模式

Use manifest-driven routing by default to reduce token usage. Do not load every rule file up front.
默认使用基于 manifest 的路由,以减少 Token 消耗。不要预先加载所有规则文件。

Rule Assets

规则资源

The review rules are packaged with this skill under
assets/security-rules/
:
  • Global baseline:
    assets/security-rules/_global-forge.mdc
  • Category indexes:
    assets/security-rules/forge-*/_index-*.mdc
  • Category deep checks:
    assets/security-rules/forge-*/*.mdc
审查规则与此 skill 一起打包在
assets/security-rules/
下:
  • 全局基线:
    assets/security-rules/_global-forge.mdc
  • 类别索引:
    assets/security-rules/forge-*/_index-*.mdc
  • 类别深度检查:
    assets/security-rules/forge-*/*.mdc

Execution Mandate

执行规范

When this skill is triggered:
  1. Run static analysis first from this skill directory:
  • scripts/run_static_analysis.sh <forge-project-root-directory>
  • use
    .ps1
    script for windows
  1. Read
    manifest.yml
    first before any deep code review.
  2. Load
    assets/security-rules/_global-forge.mdc
    first.
  3. Load only relevant category index rules based on manifest and code signals.
  4. Load deep subrules only when the matching detection heuristics are triggered by real code patterns.
  5. Perform an evidence-based security review across:
    • AuthN/AuthZ
    • Injection and input validation
    • Tenant isolation and cross-tenant leakage
    • Secrets and storage
    • Egress/remotes/CSP and manifest permissions
    • Public entry points (web triggers)
    • Agent and miscellaneous Forge security risks
  6. Do not modify app code unless the user explicitly requests fixes.
  7. Write all scan outputs and generated artifacts to
    security-audit-artifacts/
    .
触发此 skill 时:
  1. 首先在此 skill 目录中运行静态分析:
  • scripts/run_static_analysis.sh <forge-project-root-directory>
  • 在 Windows 上使用
    .ps1
    脚本
  1. 进行任何深度代码审查之前,先读取
    manifest.yml
    。
  2. 首先加载
    assets/security-rules/_global-forge.mdc
    。
  3. 根据 manifest 和代码信号,仅加载相关的类别索引规则。
  4. 仅当实际代码模式触发匹配的检测启发式规则时,才加载深层子规则。
  5. 围绕以下方面执行基于证据的安全审查:
    • AuthN/AuthZ
    • 注入与输入验证
    • 租户隔离与跨租户数据泄露
    • Secrets 与存储
    • Egress/remotes/CSP 与 manifest 权限
    • 公共入口点(Web Trigger)
    • Agent 与其他 Forge 安全风险
  6. 除非用户明确要求修复,否则不要修改应用代码。
  7. 将所有扫描输出和生成的产物写入
    security-audit-artifacts/
    。

Rule Routing Workflow

规则路由工作流

Phase 1: Reconnaissance (Mandatory)

阶段 1:侦察(强制)

Read
manifest.yml
first and extract:
  • permissions.scopes
  • permissions.external.fetch
  • permissions.content.scripts
  • modules
    (resolver/webtrigger/scheduledTrigger/rovo/etc.)
  • remotes
  • app.runtime.name
Build an execution map:
  • UI modules -> bridge calls -> resolvers/functions
  • External entry points (web triggers, events, schedules)
  • api.asUser()
    vs
    api.asApp()
    paths
  • Outbound fetch destinations
首先读取
manifest.yml
并提取:
  • permissions.scopes
  • permissions.external.fetch
  • permissions.content.scripts
  • modules
    (resolver/webtrigger/scheduledTrigger/rovo 等)
  • remotes
  • app.runtime.name
构建执行映射:
  • UI modules -> bridge calls -> resolvers/functions
  • 外部入口点(Web Trigger、events、schedules)
  • api.asUser()
    与
    api.asApp()
    路径
  • 出站 fetch 目标

Phase 2: Index Rule Selection (Two-Tier Loading)

阶段 2:索引规则选择(两级加载)

Always load first:
  • assets/security-rules/_global-forge.mdc
Then load only relevant category index rules:
SignalLoad
Any meaningful scope usage, mutations, or
asApp()
usage
assets/security-rules/forge-authn-authz/_index-authn-authz.mdc
webtrigger
or
scheduledTrigger
modules
assets/security-rules/forge-webtrigger-entrypoints/_index-webtrigger-entrypoints.mdc
permissions.external.fetch
or
remotes
assets/security-rules/forge-egress-remotes/_index-egress-remotes.mdc
SQL APIs or untrusted input reaching resolver sinks
assets/security-rules/forge-injection/_index-injection.mdc
Multi-tenant patterns, module/global state, cache reuse
assets/security-rules/forge-tenant-isolation/_index-tenant-isolation.mdc
Credentials/tokens/secrets handling
assets/security-rules/forge-secrets-storage/_index-secrets-storage.mdc
Unsafe CSP or likely scope/config misconfiguration
assets/security-rules/forge-manifest-config/_index-manifest-config.mdc
Rovo modules/actions
assets/security-rules/forge-rovo-agents/_index-rovo-agents.mdc
Baseline logging/error/static analysis concerns
assets/security-rules/forge-auditing/_index-auditing.mdc
Dependency/package risk review
assets/security-rules/forge-misc/_index-misc.mdc
Subrule policy:
  • After reading an index, load only the subrules that match the detection heuristics observed in code.
  • Do not pre-load every subrule in a category.
始终首先加载:
  • assets/security-rules/_global-forge.mdc
然后仅加载相关的类别索引规则:
信号加载
任何有意义的 scope 使用、写操作或
asApp()
使用
assets/security-rules/forge-authn-authz/_index-authn-authz.mdc
webtrigger
或
scheduledTrigger
modules
assets/security-rules/forge-webtrigger-entrypoints/_index-webtrigger-entrypoints.mdc
permissions.external.fetch
或
remotes
assets/security-rules/forge-egress-remotes/_index-egress-remotes.mdc
SQL APIs 或不可信输入到达 resolver sinks
assets/security-rules/forge-injection/_index-injection.mdc
多租户模式、module/global state 或缓存复用
assets/security-rules/forge-tenant-isolation/_index-tenant-isolation.mdc
凭据、令牌或 Secrets 处理
assets/security-rules/forge-secrets-storage/_index-secrets-storage.mdc
不安全的 CSP 或可能存在的 scope/config 配置错误
assets/security-rules/forge-manifest-config/_index-manifest-config.mdc
Rovo modules/actions
assets/security-rules/forge-rovo-agents/_index-rovo-agents.mdc
基线日志、错误处理或静态分析问题
assets/security-rules/forge-auditing/_index-auditing.mdc
依赖或软件包风险审查
assets/security-rules/forge-misc/_index-misc.mdc
子规则策略:
  • 读取索引后,仅加载与代码中观察到的检测启发式规则相匹配的子规则。
  • 不要预先加载类别中的每个子规则。

Phase 3: Analysis and Verification

阶段 3:分析与验证

For each loaded category:
  1. Enumerate reachable entry points.
  2. Trace source -> validation/authz -> sink.
  3. Confirm exploitability with evidence.
  4. Score confirmed findings with CVSS v3.1.
对于每个已加载的类别:
  1. 枚举可达入口点。
  2. 追踪 source -> validation/authz -> sink 路径。
  3. 使用证据确认可利用性。
  4. 使用 CVSS v3.1 对已确认的安全发现进行评分。

Focused Review Mode

聚焦审查模式

If the user asks for a narrow review (for example, only authz), load:
  • Global baseline
  • Requested category index
  • Only matching subrules in that category
Still mention any obvious critical findings observed outside scope.
如果用户要求进行范围较窄的审查(例如仅审查 AuthZ),则加载:
  • 全局基线
  • 请求的类别索引
  • 该类别中仅与检测结果匹配的子规则
即使不在审查范围内,也应提及观察到的任何明显严重问题。

Review Workflow

审查工作流

  1. Build an execution map:
    • UI Kit/Custom UI entry points
    • Bridge invocations and resolver handlers
    • api.asUser()
      /
      api.asApp()
      call paths
    • External egress/remotes and trigger entry points
  2. For each finding, trace source -> validation/authz -> sink.
  3. Validate exploitability before classifying as a confirmed vulnerability.
  4. Keep non-exploitable hardening observations in a separate "needs validation" section.
  5. Provide file-level evidence and practical test leads for each issue.
  1. 构建执行映射:
    • UI Kit/Custom UI 入口点
    • Bridge 调用和 resolver handlers
    • api.asUser()
      /
      api.asApp()
      调用路径
    • 外部 Egress/remotes 和 trigger 入口点
  2. 对每项安全发现,追踪 source -> validation/authz -> sink 路径。
  3. 在归类为已确认漏洞之前验证其可利用性。
  4. 将不可利用的加固建议放在单独的“需要验证”部分。
  5. 为每个问题提供文件级证据和实用的测试线索。

Static Analysis Mode

静态分析模式

If the user asks for a full scan, run the complete workflow from:
  • assets/security-rules/forge-auditing/static-analysis-forge.mdc
Expected tools (when available): Semgrep, npm audit, Snyk, gitleaks.
如果用户要求执行完整扫描,则运行以下文件中的完整工作流:
  • assets/security-rules/forge-auditing/static-analysis-forge.mdc
预期工具(可用时):Semgrep、npm audit、Snyk、gitleaks。

Output Requirements

输出要求

  • Provide a markdown security audit report.
  • Order confirmed exploitable findings by CVSS v3.1 severity and impact.
  • Include for each confirmed finding:
    • CVSS vector and base score
    • Severity band
    • Exploitability and impact
    • File evidence and source-to-sink trace
    • CWE mapping
    • Reproducible PoC/test steps with concrete commands
  • Include assumptions and evidence gaps.
  • Do not report scanner counts only when vulnerabilities exist.
  • 提供 Markdown 安全审计报告。
  • 按 CVSS v3.1 严重程度和影响对已确认且可利用的安全发现进行排序。
  • 每项已确认的安全发现应包含:
    • CVSS 向量和基础分
    • 严重性等级
    • 可利用性和影响
    • 文件证据和 source-to-sink 追踪
    • CWE 映射
    • 包含具体命令的可复现 PoC/测试步骤
  • 列出假设和证据缺口。
  • 当存在漏洞时,不要仅报告扫描器给出的数量统计。

Example Trigger Phrases

触发短语示例

  • "Review this Forge app for security"
  • "Do a white-box security audit of my Forge app"
  • "Check this app for authz bypass and tenant isolation issues"
  • "Run full static analysis for this Forge codebase"
  • “对这个 Forge 应用进行安全审查”
  • “对我的 Forge 应用执行白盒安全审计”
  • “检查这个应用是否存在 AuthZ 绕过和租户隔离问题”
  • “为此 Forge 代码库运行完整的静态分析”