Go Vuln Crypto Tls logo

Go Vuln Crypto Tls

Community
yhy0
go-vuln-crypto-tls

Use when auditing Go code involving TLS configuration, certificate validation, JWT token parsing, SAML assertion verification, webhook signature checking, or cryptographic operations. Covers CWE-295/347/345. Keywords: InsecureSkipVerify, TLS, mTLS, certificate validation, JWT algorithm, SAML signature, cosign, sigstore, hmac.Equal, X.509, webhook HMAC

Overview

Publisheryhy0
Repositoryghsa-skill-builder
Skill namego-vuln-crypto-tls
Stars
75
Forks
8
Bundled files
1
LicenseMIT
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.

  • 1 bundled files

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

  • Open source

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

Installation

Install the Go Vuln Crypto Tls 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/yhy0/ghsa-skill-builder/tree/main/vuln-skills/skills/go-vuln-crypto-tls
  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/yhy0/ghsa-skill-builder.git /tmp/ghsa-skill-builder
mkdir -p .claude/skills
cp -r /tmp/ghsa-skill-builder/vuln-skills/skills/go-vuln-crypto-tls .claude/skills/go-vuln-crypto-tls
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Go Vuln Crypto Tls 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 Go Vuln Crypto Tls 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 Go Vuln Crypto Tls 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.

Go Crypto/TLS Vulnerability Patterns (CWE-295/347/345)

当审计 Go 代码中涉及 TLS 配置、证书验证、JWT 解析、SAML 验证、Webhook 签名校验时加载此 Skill。

Detection Strategy

Sources(不可信输入):

  • TLS 连接的对端证书
  • JWT token(来自 HTTP Authorization header)
  • SAML Response XML(来自 IdP 回调)
  • Webhook 请求 body + signature header
  • Container image 签名(cosign/sigstore)
  • X.509 证书链

Sinks(密码学验证点):

  • tls.Config{InsecureSkipVerify: true} -- 跳过 TLS 证书验证,允许中间人攻击(MITM)
  • http.Transport{TLSClientConfig: &tls.Config{...}} -- HTTP 客户端 TLS 配置
  • jwt.Parse(tokenString, keyFunc) -- JWT 解析(无 WithValidMethods)
  • xmldsig.Verify() / SAML signature validation -- XML 签名验证
  • hmac.New() + == 比较 -- 非时间常量的 HMAC 比较
  • x509.Certificate.Verify(opts) -- 证书链验证

Sanitization(正确的密码学验证):

  • tls.Config{InsecureSkipVerify: false} + 正确的 RootCAs / ClientCAs
  • jwt.Parse(token, keyFunc, jwt.WithValidMethods([]string{"RS256"})) -- 限制算法
  • hmac.Equal(expected, actual) -- 时间常量比较
  • x509.VerifyOptions 配置完整的 CA pool 和 usage 约束
  • SAML 签名验证使用 canonicalization(C14N)防止 XML 签名包装攻击
  • TLS MinVersion: tls.VersionTLS12

检测路径:

bash
# InsecureSkipVerify
grep -rn "InsecureSkipVerify" --include="*.go"
# TLS 配置
grep -rn "tls.Config\|TLSClientConfig\|tls.Dial" --include="*.go"
# JWT 解析
grep -rn "jwt.Parse\|jwt.ParseWithClaims\|jwt.NewParser" --include="*.go"
# SAML 处理
grep -rn "saml\|SAML\|xmldsig\|xml.*signature" --include="*.go"
# HMAC 比较
grep -rn "hmac.New\|hmac.Equal\|crypto/hmac" --include="*.go"
# Cosign/Sigstore
grep -rn "cosign\|sigstore\|Verify.*signature\|VerifyImage" --include="*.go"
# 证书验证
grep -rn "x509.Verify\|x509.Certificate\|CertPool" --include="*.go"
# mTLS 配置
grep -rn "ClientAuth\|RequireAndVerifyClientCert\|ClientCAs" --include="*.go"
  1. 搜索密码学验证点(TLS 配置、JWT 解析、签名验证)
  2. 检查验证是否被正确实施或被跳过
  3. 验证安全性:
    • InsecureSkipVerify 是否为 true?
    • JWT 解析是否限制了允许的算法(防止 alg: none 或算法混淆)?
    • HMAC 比较是否使用 hmac.Equal(而非 == 或 bytes.Equal)?
    • SAML 签名验证是否正确处理了 XML canonicalization?
    • TLS session resumption 是否可能绕过 CA trust store 的更新?
    • mTLS 是否要求客户端证书(ClientAuth: tls.RequireAndVerifyClientCert)?
  4. 若验证被跳过或不完整 -> 标记为候选漏洞

Detection Checklist

  • InsecureSkipVerify: true 审计 (CWE-295):所有 tls.Config 实例是否将 InsecureSkipVerify 设为 false?设为 true 将跳过 TLS 证书验证,攻击者可实施中间人攻击(MITM)窃取或篡改通信内容。仅测试环境可接受,生产环境应正确配置 RootCAs CA 证书池。搜索所有 InsecureSkipVerify 出现的位置,包括测试代码中被复制到生产环境的情况。
  • TLS Session Resumption 审计 (CWE-295):Go 的 TLS session resumption 是否可能在 CA trust store 更新后继续使用旧证书?tls.Config.SessionTicketsDisabled 是否需要在 CA 更换时设为 true?
  • JWT 算法验证审计 (CWE-347):jwt.Parse 是否指定了 jwt.WithValidMethods([]string{"RS256"})?未指定时攻击者可能用 HS256(对称算法)伪造 token,使用服务器的公钥作为 HMAC key。
  • JWT Claims 完整性审计 (CWE-287):JWT 验证是否检查了 iss(签发者)、aud(受众)、exp(过期)claims?Mattermost 曾因未验证 OAuth state token 导致认证绕过。
  • SAML XML 签名包装审计 (CWE-347):SAML 签名验证是否仅验证了 XML 文档的一部分?攻击者可能在已签名的节点外插入恶意断言。SSOReady 曾因 differential XML parsing 导致签名绕过。
  • Webhook HMAC 时间常量比较审计 (CWE-345):Webhook 签名验证是否使用 hmac.Equal() 而非 == 或 bytes.Equal()?非常量时间比较允许时间侧信道攻击逐字节猜测签名。
  • mTLS 客户端证书验证审计 (CWE-295):mTLS 配置是否使用 tls.RequireAndVerifyClientCert?是否正确设置了 ClientCAs CA pool?NeuVector 曾因 mTLS 配置错误导致 MITM。
  • Cosign/Sigstore 签名验证审计 (CWE-347):容器镜像签名验证是否可被绕过?签名策略是否被正确评估(sigstore policy-controller)?

False Positive Exclusion Guide

以下模式不是此类漏洞:

  • 测试代码中的 InsecureSkipVerify: true -- _test.go 中连接 localhost 测试服务器
  • 开发环境的自签名证书 -- 明确限制在开发环境且有配置开关
  • hmac.Equal 用于非安全场景 -- 如校验数据完整性而非认证
  • JWT 不用于认证 -- 如仅用于内部 RPC 的元数据传递

以下模式需要深入检查:

  • InsecureSkipVerify 通过配置文件控制 -- 默认值是什么?文档是否建议在生产环境禁用?
  • 自定义 VerifyPeerCertificate 回调 -- 是否正确验证了证书链?空回调 func(...) error { return nil } 等于跳过验证
  • jwt.Parse 的 keyFunc 返回错误时的行为 -- 是否 fallback 到不验证?
  • TLS MinVersion 未设置 -- Go 默认 TLS 1.2,但显式设置更安全

Real-World Cases

详见 references/cases.md(7 个真实案例,需要时加载)。

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 Go Vuln Crypto Tls AI skill do?

Use when auditing Go code involving TLS configuration, certificate validation, JWT token parsing, SAML assertion verification, webhook signature checking, or cryptographic operations. Covers CWE-295/347/345. Keywords: InsecureSkipVerify, TLS, mTLS, certificate validation, JWT algorithm, SAML signature, cosign, sigstore, hmac.Equal, X.509, webhook HMAC

Why use Go Vuln Crypto Tls on TypingMind?

Because you install it once and use it with any model. Go Vuln Crypto Tls 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 Go Vuln Crypto Tls in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/yhy0/ghsa-skill-builder/tree/main/vuln-skills/skills/go-vuln-crypto-tls. 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 Go Vuln Crypto Tls?

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 Go Vuln Crypto Tls?

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

Is the Go Vuln Crypto Tls AI skill free?

Yes. It is published on GitHub by yhy0 under the MIT license. 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 👇