network-request-auditing
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNetwork Request Auditing
网络请求审计
Deep-dive network health using the MCP. This skill focuses on — not just “any 500s” but patterns that indicate bugs, waste, or security issues.
cursor-ide-browserbrowser_network_requests借助 MCP深入分析网络健康状况。本技能聚焦于——不仅是“排查500错误”,还会识别表明存在bug、资源浪费或安全问题的模式。
cursor-ide-browserbrowser_network_requestsHow it works
工作原理
- Drive the app in the browser (navigate, click, submit forms) so real requests fire.
- Call after meaningful interactions (and after navigation settles).
browser_network_requests - Classify and report findings using the criteria below.
Follow workflow rules: use before structural interactions; after actions that change the page, take a fresh snapshot before the next interaction.
cursor-ide-browserbrowser_snapshot- 在浏览器中操作应用(导航、点击、提交表单),触发真实请求。
- 在有意义的交互之后(且页面导航完成后)调用****。
browser_network_requests - 根据以下标准对结果进行分类并报告。
遵循的工作流规则:在结构性交互前使用;在执行会改变页面的操作后,进行下一次交互前需拍摄新的快照。
cursor-ide-browserbrowser_snapshotAudit checklist
审计检查清单
Failures
失败情况
- 4xx / 5xx — list method, URL (path + query), status, and whether the UI handled the error.
- CORS or network errors — often misconfigured origins or mixed content.
- 4xx / 5xx错误——列出请求方法、URL(路径+查询参数)、状态码,以及UI是否处理了该错误。
- CORS或网络错误——通常源于源配置错误或混合内容问题。
Performance
性能问题
- Slow requests — flag requests with high latency (e.g. > 500 ms server time if timings are visible; otherwise note unusually large waterfalls).
- Duplicate calls — same URL + method fired multiple times in one user action (often a React effect or missing deduplication).
- Oversized payloads — responses that look huge for what the UI needs (suggest pagination, field selection, or compression).
- 缓慢请求——标记延迟高的请求(例如,如果可见计时信息,服务器响应时间>500毫秒;否则记录异常长的请求瀑布流)。
- 重复调用——同一用户操作中多次触发相同URL+方法的请求(通常是React副作用或缺少去重机制导致)。
- 过大负载——响应内容远超出UI需求(建议使用分页、字段选择或压缩优化)。
Security and privacy
安全与隐私
- Sensitive data in URLs — tokens or PII in query strings.
- Missing auth — API calls that should send credentials or bearer tokens but do not (compare with adjacent authenticated calls).
- URL中的敏感数据——查询字符串中包含令牌或个人身份信息(PII)。
- 缺少认证信息——应发送凭证或Bearer令牌但未发送的API调用(与相邻的已认证调用进行对比)。
Correctness
正确性验证
- Unexpected hosts — calls to third parties not documented for the feature (trackers, accidental leaks).
- Preflight storms — excessive OPTIONS requests may indicate wrong CORS caching or too many distinct origins.
- 意外请求目标主机——调用未在功能文档中记录的第三方服务(跟踪器、意外数据泄露)。
- 预检请求风暴——过多OPTIONS请求可能表明CORS缓存配置错误或源地址过于分散。
Steps
步骤
-
Start from a clean navigation —to the target URL (or use an existing tab via
browser_navigate).browser_tabs -
Exercise the feature — interactions that trigger API usage (filters, infinite scroll, form save, modal open).
-
Fetch network log —after each logical step if the page does multiple round-trips.
browser_network_requests -
Report — structured output:
- Summary counts (failed, slow, duplicate groups).
- Table or bullet list of issues with URL pattern (not necessarily full secrets), status, category (failure / perf / security / correctness).
- Recommended next code changes or investigations.
-
从干净的导航开始——使用导航到目标URL(或通过
browser_navigate使用现有标签页)。browser_tabs -
测试功能——执行会触发API调用的交互(筛选、无限滚动、表单保存、弹窗打开)。
-
获取网络日志——如果页面存在多次往返请求,在每个逻辑步骤后调用。
browser_network_requests -
生成报告——结构化输出:
- 汇总统计(失败请求、缓慢请求、重复请求组的数量)。
- 问题表格或项目符号列表,包含URL模式(无需完整敏感信息)、状态码、类别(失败/性能/安全/正确性)。
- 推荐的后续代码修改或调查方向。
Notes
注意事项
- Iframe traffic may not appear in the same log — note if the feature runs inside an iframe.
- Compare against expected API design; a 404 might be correct for “optional resource not found” if handled in UI.
- Pair with for errors that do not surface as failed HTTP (e.g. parse errors after 200).
browser_console_messages
- iframe中的流量可能不会出现在同一日志中——需注意功能是否在iframe内运行。
- 与预期的API设计进行对比;如果UI已处理“可选资源未找到”的情况,404错误可能是正常的。
- 搭配使用,排查未表现为HTTP失败的错误(例如200响应后的解析错误)。
browser_console_messages