360 Secure SkillHub
360 安全技能中心

x402 CORS and Tags Check

通过零依赖 Node CLI 检查单个 URL 或本地 OpenAPI 文档:402 响应是否可被浏览器读取、CORS 暴露头是否显式包含支付相关头、resource.tags 是否超过 5 个、PAYMENT-REQUIRED 头是否超出字节上限,并输出 JSON 报告,以退出码表示结果。

分类:开发
epistemedeus
epistemedeus
热度 37.50
最近更新 2026-12-04 22:53:43

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add epistemedeus/x402-cors-and-tags-check
兼容性
通用兼容
联网要求
需要联网
数据出网
数据不出本机
Metadata
name
x402-cors-and-tags-check
description
Check an unpaid x402 response or OpenAPI document for a browser-readable 402, missing CORS expose headers, more than 5 resource.tags, and a PAYMENT-REQUIRED line over 8190 bytes. Use before a browser or client depends on the 402.
license
MIT
compatibility
Requires Node.js 22. Probes are unpaid GET and OPTIONS with X-Pilot-QA 1. No wallet, signature, payment, or telemetry.
metadata
{"author":"neomorphic","version":"0.2.0"}

Check x402 CORS and tags

Check one URL or one OpenAPI document with the zero-dependency CLI in this public repository. Do not pay, sign, attach a wallet, or send telemetry. The command exit code is the result: 0 has no error, 1 has a failed check, and 2 means the arguments are not usable.

This skill is skills/x402-cors-and-tags-check in epistemedeus/x402-data-gateway-skills. npx skills add discovers skills/<name>/SKILL.md. It is not marked metadata.internal. Checker version 0.2.0. Research method: x-twitter-agentic-research v1.7.

The published Marketplace listing observed on 2026-12-03 uses tag v0.1.0 of epistemedeus/x402-cors-and-tags-check. This tree is 0.2.0 and is not that published tag.

Run the checker

From a checkout of this repository:

node actions/x402-cors-and-tags-check/bin/check.mjs --url https://example.com/replace-with-your-route --json

https://example.com/replace-with-your-route is a placeholder. Pass the real x402 URL. Add --spec openapi.json to lint a local OpenAPI document. Add --no-preflight to skip OPTIONS. The flag names and defaults are the same as version 0.1.0.

Add --units-file units.json to resolve fixes without a network fetch. The default units URL is https://neomorphic.io/commons/units.json.

A skill-only install copies this directory and does not copy actions/. Clone the repository, or use a git tree that contains actions/x402-cors-and-tags-check, before running the command.

Every probe sends X-Pilot-QA: 1. Count these probes as agent traffic. Do not count them as customer revenue.

Rules

  1. CORS expose. On HTTP 402, or when PAYMENT-REQUIRED is present, Access-Control-Expose-Headers must name PAYMENT-REQUIRED and PAYMENT-RESPONSE. A value of * does not pass. Spec: https://raw.githubusercontent.com/x402-foundation/x402/main/specs/transports-v2/http.md
  2. Tag cap. resource.tags allows at most 5 entries. A tag must be printable ASCII, at most 32 characters, and unique under case-insensitive comparison. Spec: https://raw.githubusercontent.com/x402-foundation/x402/main/specs/extensions/bazaar.md
  3. Header budget. Fail when the PAYMENT-REQUIRED value or the reconstructed line is over 8,190 bytes. Warn when either length is above 6,500 bytes and at or under 8,190 bytes. --strict fails that warning. The aiohttp response line limit is documented in https://github.com/x402-foundation/x402/issues/3803. This command does not run aiohttp.
  4. Browser-readable 402. browser_readable_402 is true only when every predicate below is true.

curl_visible_bazaar_header is true when the response is HTTP 402 and the PAYMENT-REQUIRED header decodes to an object with extensions.bazaar.info and extensions.bazaar.schema both objects. A JSON body does not make this true. This is what curl can see. It is separate from what a browser can read.

browser_exposable_bazaar_header is true when Access-Control-Expose-Headers explicitly names PAYMENT-REQUIRED. A value of * fails this predicate. Fetch exposes every response header when that list contains * and the request credentials mode is not include. When credentials mode is include, * is a literal header name and does not expose PAYMENT-REQUIRED. Spec: https://fetch.spec.whatwg.org/#cors-protocol

Access-Control-Allow-Origin must be * or the probe origin, on the 402 and on a 2xx OPTIONS response. OPTIONS Access-Control-Allow-Headers must include payment-signature. OPTIONS Access-Control-Allow-Methods must include GET. A methods value of * is not GET.

Print the JSON report. The URL result includes browserReadable with curl_visible_bazaar_header, browser_exposable_bazaar_header, and browser_readable_402. Quote a Commons unit id only when the report attaches one. Do not invent a unit id. The pinned CORS id is ku_e31c883cc12e7fd084197e86774fed0e. The pinned header-size id is ku_9bbb376b6e50f81960441e04b9d6b3c2. The tag cap cites a catalog record only when the loaded file states that cap.

Commons candidate

--report-to-commons is off unless you pass it. When a real error matches no loaded Commons unit, the report includes commonsCandidates with publish set to false. The command does not POST, and it does not write the candidate to the network. A passing check does not create a unit. Copy the JSON into a pull request only after a person reviews it.

Install

Default-branch install, after this skill is on the default branch:

npx skills add epistemedeus/x402-data-gateway-skills --skill x402-cors-and-tags-check --yes

This file can also be installed from a git tree URL for the branch that contains it. Do not claim a skills.sh directory page lists this skill until a fetch of that page shows it.

Boundaries

Contact is contact@neomorphic.io. The check is free. It does not set a price, a payee, or a payment URL. Optional catalog and handoff documents, which this command does not modify: