Oauth Sso logo

Oauth Sso

Community
jinyimeng01
oauth-sso

OAuth 2.0 / OpenID Connect / SSO attack methodology. redirect_uri manipulation, state parameter bypass, CSRF on authorization endpoint, code/access_token interception, PKCE bypass, implicit flow hijack, and cross-tenant token reuse.

Overview

Publisherjinyimeng01
Repositorymastermind-bug-bounty
Skill nameoauth-sso
Stars
60
Forks
5
Bundled files
Instructions only
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.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

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

Installation

Install the Oauth Sso 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/jinyimeng01/mastermind-bug-bounty/tree/main/skills/oauth_sso
  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/jinyimeng01/mastermind-bug-bounty.git /tmp/mastermind-bug-bounty
mkdir -p .claude/skills
cp -r /tmp/mastermind-bug-bounty/skills/oauth_sso .claude/skills/oauth-sso
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Oauth Sso 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 Oauth Sso 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 Oauth Sso 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.

OAuth / SSO Attack — 单点登录攻击

Attack Surface Check

检测到 OAuth/SSO?
├── 登录页有第三方登录按钮 (Google/GitHub/微信/企业微信/钉钉)?
├── URL 中有 client_id / redirect_uri / response_type 参数?
├── /.well-known/openid-configuration 存在?
├── 响应头中有 OAuth/SSO 相关字段?
└── 有多个子域名 → 跨域 SSO token 可能共享?

1. redirect_uri 操纵 (最高回报)

原始请求:
  https://auth.target.com/authorize?
    client_id=app123&
    redirect_uri=https://app.target.com/callback&
    response_type=code

攻击尝试:
  # 开放重定向 (如果 redirect_uri 校验宽松)
  redirect_uri=https://app.target.com.evil.com/callback
  redirect_uri=https://app.target.com@evil.com/callback
  
  # 子域名绕过 (如果有可控子域)
  redirect_uri=https://attacker-controlled.target.com/callback
  
  # 路径穿越
  redirect_uri=https://app.target.com/../evil/callback
  
  # CRLF 注入
  redirect_uri=https://evil.com%0d%0aHost:%20app.target.com
  
  # 参数污染
  redirect_uri=https://app.target.com/callback&redirect_uri=https://evil.com
  
  # localhost bypass (开发环境)
  redirect_uri=http://localhost:8080/callback
  redirect_uri=http://127.0.0.1/callback

2. state 参数

如果 state 参数缺失或不验证:
  → CSRF: 攻击者用自己的 code 绑定受害者账号
  → 流程: 攻击者启动 OAuth → 拿自己的 code →
          构造 https://app.target.com/callback?code=ATTACKER_CODE →
          诱导受害者点击 → 受害者登录了攻击者的身份

检测:
  □ 授权请求中是否有 state 参数?
  □ 回调时 state 是否被验证?
  □ 是否可以去除 state 参数?

3. Code / Token 窃取

# Code 重用 (code 是否一次性?)
1. 用合法方式获取授权码 code_abc
2. 重复使用 code_abc 多次获取 token
3. 如果能获取多个 token → code 未销毁

# 客户端凭证泄露
从 JS 中搜索:
  client_id, client_secret, app_secret
  redirect_uri 白名单
  OAuth 端点 URL

# Implicit Flow token 泄露
如果使用 implicit flow (response_type=token):
  token 在 URL hash 中 → 可能被 Referer header 泄露
  或被浏览器历史/日志记录

4. PKCE 绕过

如果使用 PKCE (Proof Key for Code Exchange):
  □ 是否强制 PKCE? (可以去掉 code_challenge 参数?)
  □ code_verifier 是否被正确验证?
  □ 可以用 plain 方法代替 S256 吗?

5. SSO Token 跨域重用

企业 SSO (企业微信/钉钉/飞书):
  □ 同一个 SSO token 能否跨业务系统使用?
  □ A 系统的 token → B 系统的 API?
  □ 不同角色的 token 权限是否隔离?

多子域名场景:
  app.target.com 的 token → admin.target.com 的 API?
  dev.target.com 的 token → prod.target.com?

6. OpenID Connect 配置泄露

bash
# 获取 OIDC 配置 (可能暴露内部端点)
curl https://target/.well-known/openid-configuration

# 关注:
#   authorization_endpoint
#   token_endpoint
#   userinfo_endpoint
#   jwks_uri  (→ 跳转到 JWT Attack)
#   registration_endpoint (可能允许动态注册客户端!)

7. Quick Test Checklist

□ 检查 OAuth URL 中是否有 redirect_uri 参数
□ 尝试 redirect_uri 绕过 (子域名/路径穿越/CRLF)
□ 检查 state 参数存在性和验证
□ Code 重用测试
□ 搜索 JS 中的 client_secret
□ 请求 /.well-known/openid-configuration
□ SSO token 跨子域/跨业务测试
□ PKCE bypass (去掉 code_challenge)
□ 检查是否有动态客户端注册端点

Frequently asked questions

What does the Oauth Sso AI skill do?

OAuth 2.0 / OpenID Connect / SSO attack methodology. redirect_uri manipulation, state parameter bypass, CSRF on authorization endpoint, code/access_token interception, PKCE bypass, implicit flow hijack, and cross-tenant token reuse.

Why use Oauth Sso on TypingMind?

Because you install it once and use it with any model. Oauth Sso 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 Oauth Sso in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/jinyimeng01/mastermind-bug-bounty/tree/main/skills/oauth_sso. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Oauth Sso?

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 Oauth Sso?

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

Is the Oauth Sso AI skill free?

It is published on GitHub by jinyimeng01. 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 👇