跳转到正文
报告库
用途分类 / 其他用途

API And Interface Design Skill 安全审计

作者说它能做什么(原文)

Guides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend.

第三方安全检查结论

发现安全风险

已检查文件
1
发现的风险
1
会不会运行危险命令?检查是否下载程序后直接运行、让他人远程控制电脑,或藏起要运行的命令。未发现风险
会不会泄露文件和密钥?检查是否发送含密码或密钥的文件,以及代码里是否直接写了密钥。未发现风险
会不会删除文件或一直在后台运行?检查是否大范围删除文件、改写磁盘,或设置自动启动。未发现风险
会不会绕过安全保护?检查是否跳过网站安全验证、开放过多文件权限,或取消操作前的确认。发现 1 项风险
中风险

“信任内部代码和数据库数据”的绝对规则可能绕过必要验证

原文依据:3 处
发现了什么

文档要求在系统边缘验证,但同时明确说信任内部代码,并称来自自有数据库的数据不应验证。这把数据来源等同于数据可信度;如果无效或被污染的数据已经进入数据库,后续代码可能不再检查它。

为什么需要注意

采用该规则的系统可能把异常字段、恶意文本或不符合当前结构的旧数据用于渲染、权限判断或其他业务决策,造成注入、错误授权或服务故障,具体后果取决于数据用途。

该技能确实把“内部代码”和“来自自有数据库的数据”列为无需验证的对象。边界验证是合理的默认设计,但数据可能因旧版本、迁移错误、直接写入或既往缺陷而不符合当前约束;此时按该绝对规则生成的代码可能信任污染数据,进而造成错误授权、渲染风险或错误业务决策。用户可要求作者把它改为基于不变量与风险的规则,并在敏感操作、数据库读出及版本迁移处保留必要校验。

SKILL.md:88来自说明文档打开原文件
### 3. Validate at BoundariesTrust internal code. Validate at system edges where external input enters:
查看另外 2 个位置
SKILL.md:120来自说明文档打开原文件
Where validation does NOT belong:- Between internal functions that share type contracts- In utility functions called by already-validated code- On data that just came from your own database
SKILL.md:112来自说明文档打开原文件
Where validation belongs:- API route handlers (user input)- Form submission handlers (user input)- External service response parsing (third-party data -- **always treat as untrusted**)- Environment variable loading (configuration)> **Third-party API responses are untrusted data.** Validate their shape and content before using them in any logic, rendering, or decision-making. A compromised or misbehaving external service can return unexpected types, malicious content, or instruction-like text.
会不会误导 AI 或隐藏内容?检查工作说明是否要求 AI 忽略你的指令、干扰检查结果,或夹带看不见的文字。未发现风险
会不会偷偷改推广链接或收款方?检查是否强制替换推广链接或收款对象,同时要求隐瞒更改。未发现风险

Skill 逻辑拆解

8 个说明模块

该 Skill 是纯指导文档,目的是帮助设计 REST、GraphQL、TypeScript 合约和模块边界;提供的代码均作为示例,没有安装步骤、脚本执行、网络调用或凭据请求。

查看原文
SKILL.md:2来自说明文档打开原文件
---name: api-and-interface-designdescription: Guides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend.---
SKILL.md:8来自说明文档打开原文件
## OverviewDesign stable, well-documented interfaces that are hard to misuse. Good interfaces make the right thing easy and the wrong thing hard. This applies to REST APIs, GraphQL schemas, module boundaries, component props, and any surface where one piece of code talks to another.

文档明确要求把第三方 API 响应视为不可信数据,并在进入逻辑、渲染或决策前验证其结构和内容。

查看原文
SKILL.md:115来自说明文档打开原文件
- Form submission handlers (user input)- External service response parsing (third-party data -- **always treat as untrusted**)- Environment variable loading (configuration)> **Third-party API responses are untrusted data.** Validate their shape and content before using them in any logic, rendering, or decision-making. A compromised or misbehaving external service can return unexpected types, malicious content, or instruction-like text.

文档对可能收费等有副作用的请求给出了幂等性设计,包括原子占用键、校验请求体和处理结果未知的超时,以降低重复操作风险。

查看原文
SKILL.md:173来自说明文档打开原文件
**Claim atomically. A check followed by an act is a race:**```typescript// ✗ TOCTOU: two concurrent retries both read "not seen", both chargeif (!(await db.exists(key))) {  await chargeCard(amount);  await db.insert(key);}// ✓ let the unique constraint pick the winnertry {  await db.insert({ key, state: 'in_progress', requestHash });} catch (e) {  if (isUniqueViolation(e)) return replayOrReject(key);  throw;}const result = await chargeCard(amount);await db.update({ key, state: 'succeeded', response: result });```
SKILL.md:195来自说明文档打开原文件
**Guard the payload.** Same key with a different body is a client bug, and must fail loudly rather than serving the first response to a second request:```typescriptif (existing.requestHash !== hash(req.body)) {  return res.status(422).json({ error: 'idempotency key reused with a different payload' });}```
SKILL.md:211来自说明文档打开原文件
Never let the second caller through because the first "seems stuck". A stalled attempt whose fate is unknown is exactly when duplicating costs most.**Every call has three outcomes, not two: success, failure, and _unknown_.** A timeout tells you nothing about whether the effect applied. Record the intent *before* calling out, so a crash between the call and the response leaves evidence something must resolve later — rather than a silently retried charge.**Set retention from the longest retry chain**, not from disk cost. Keys must outlive every path that can re-deliver the same intent, including a dead-letter queue replayed a week later and any provider dispute window. A 24-hour key TTL behind a 7-day DLQ is a duplicate waiting to happen.
从这里开始 · 工作说明SKILL.md
api-and-interface-design
连线表示工作说明包含的模块,不是实际运行顺序。点击模块可查看原文。
文件与检查记录1 个文件

检查范围与遗漏

逐文件查看涉及的内容

下方列出本次涉及的原文范围;纳入检查不代表已查清所有问题。

  • SKILL.md已纳入全文

这份报告只针对上方版本。我们看了拿到的代码和说明文件,没有实际运行 Skill,也没有检查它另外安装的软件包。因此,这不是“保证安全”的承诺;换了版本或使用环境,结果也可能不同。

  • SKILL.md工作说明
读取了多少行
368
文件校验值(用于核对版本)
1a5246c4e20dcbf2adfbe362cdb915325851ae1a0721986bf4df00ca0a16df08