frontend-security
仓库创建 2026年7月1日最近提交 23 天前SkillHot 收录 22 天前
▸ 精选理由
可直接用于前端审计与加固,包含可落地的最小基线策略。
这个 Skill 做什么
提供前端防护建议:XSS、CSP、CORS、SRI 与 iframe/Trusted Types 等策略。
把浏览器端当成不可信环境来加固:对所有输入做框架转义或用 DOMPurify 做白名单清洗,发严格的 Content-Security-Policy,启用 SRI、iframe sandbox 和 Trusted Types。适合在开发前端、处理 HTML/脚本或引入第三方脚本时使用,能明显降低 XSS 和 DOM 劫持风险。
▸ 展开 SKILL.md 英文原文
Browser-side hardening: XSS, CSP, CORS, SRI, DOM clobbering, iframe sandboxing, Trusted Types
2
Stars
0
Forks
40
仓库内 Skill
+0
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/ShieldNet-360/secure-vibe/main/skills/frontend-security/SKILL.md或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/ShieldNet-360/secure-vibe/main/skills/frontend-security/SKILL.md"SKILL.MD 节选查看完整文件 ↗
# Frontend Security
## Rules (for AI agents)
### ALWAYS
- Treat all user/URL/storage data as untrusted. Render via framework
escaping (`{}` in JSX/Vue/Svelte, `{{ }}` in templating). For raw HTML use a
vetted sanitizer (DOMPurify) with a strict allowlist.
- Send a strict `Content-Security-Policy` header. Minimum production baseline:
`default-src 'self'; script-src 'self' 'nonce-<random>'; object-src 'none';
base-uri 'self'; frame-ancestors 'none'; form-action 'self';
upgrade-insecure-requests`. Use nonces or hashes — never `'unsafe-inline'` for
`script-src`.
- Set `Strict-Transport-Security: max-age=63072000; includeSubDomains; preload`,
`X-Content-Type-Options: nosniff`, `Revia SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有