cors-security

仓库创建 2026年7月1日最近提交 23 天前SkillHot 收录 22 天前
▸ 精选理由

防止跨域滥用,适用于 API 与边缘服务。

这个 Skill 做什么

提供严格的 CORS 配置策略与中间件/网关实现建议。

给浏览器跨域请求提供一套严格的 CORS 配置建议:带凭证时不能用通配符,采用 origin allowlist、合理的 preflight 缓存和最少的 exposed headers。适合生成 CORS 中间件、配置 API Gateway/CloudFront/Nginx 或审查对外浏览器端点时使用。优点是把安全性和可用性平衡好,减少误配置导致的数据泄露风险。

▸ 展开 SKILL.md 英文原文

Strict CORS configuration: no wildcard with credentials, allowlist-based origins, sensible preflight cache, minimal exposed headers — Applies to: when generating CORS middleware or framework config; when wiring API Gateway / Cloud Front / Nginx CORS headers; when reviewing a cross-origin browser-facing endpoint

开发编程CORS前端安全网关通用
2
Stars
0
Forks
40
仓库内 Skill
+0
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/ShieldNet-360/secure-vibe/main/dist/agent-skills/.agents/skills/cors-security/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/ShieldNet-360/secure-vibe/main/dist/agent-skills/.agents/skills/cors-security/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
<!-- Native skill bundle for agent-skills (cross-tool convention). Generated by `secure-vibe dev regenerate`. -->
<!-- Do not edit by hand; the source of truth is skills/cors-security/SKILL.md. -->

# CORS Security

Strict CORS configuration: no wildcard with credentials, allowlist-based origins, sensible preflight cache, minimal exposed headers

## ALWAYS

- Use an **allowlist** of origins, not `*`. Reflect the incoming `Origin` header only when it matches a known entry from configuration (or matches a precompiled regex of operator-controlled hostnames).
- If responses include credentials (cookies, `Authorization`), set `Access-Control-Allow-Credentials: true` **and** ensure `Access-Control
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有