Go Vuln Ssrf Requestforgery logo

Go Vuln Ssrf Requestforgery

Community
yhy0
go-vuln-ssrf-requestforgery

Use when auditing Go code involving HTTP client requests, webhook callbacks, URL handling, HTML template rendering in Go web frameworks, or CSRF protection. Covers CWE-918/352/79. Keywords: SSRF, server-side request forgery, XSS, cross-site scripting, CSRF, http.Get, http.Client, template.HTML, Gin, Echo, Fiber, webhook, Kyverno, DNS rebinding

Overview

Publisheryhy0
Repositoryghsa-skill-builder
Skill namego-vuln-ssrf-requestforgery
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 Ssrf Requestforgery 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-ssrf-requestforgery
  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-ssrf-requestforgery .claude/skills/go-vuln-ssrf-requestforgery
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Go Vuln Ssrf Requestforgery 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 Ssrf Requestforgery 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 Ssrf Requestforgery 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 SSRF / XSS / CSRF Vulnerability Patterns (CWE-918/352/79)

当审计 Go 代码中涉及 HTTP 客户端请求、webhook 回调、URL 处理、HTML 模板渲染、CSRF 防护时加载此 Skill。

Detection Strategy

SSRF (CWE-918)

Sources(攻击入口):

  • 用户提供的 URL(webhook callback URL、image URL、import URL)
  • Kyverno policy 中的 apiCall URL
  • Redirect URL 参数
  • Git 仓库 URL
  • Proxy 目标 URL

Sinks(HTTP 请求发起点):

  • http.Get(userURL) / http.Post(userURL, ...)
  • http.Client{}.Do(req) 其中 req.URL 来自用户
  • net.Dial(userHost + ":" + port)
  • grpc.Dial(userAddr)
  • url.Parse(userURL) -> http.NewRequest("GET", parsedURL, nil)

Sanitization(SSRF 防护):

  • URL allowlist(白名单匹配协议 + 主机)
  • IP blocklist(禁止 127.0.0.1, 10.0.0.0/8, 169.254.169.254, ::1)
  • DNS resolution 后再检查 IP(防止 DNS rebinding)
  • 禁用 HTTP redirect following(CheckRedirect 返回错误)
  • ssrf 防护库(如 github.com/trufflesecurity/of-ssrf)
  • http.Client{Timeout: 10 * time.Second} -- 设置请求超时防止 hang(默认无超时)

XSS (CWE-79)

Sources(攻击入口):

  • 用户输入通过 Go API 传递到前端
  • 用户输入在 Go 模板中渲染

Sinks(XSS 注入点):

  • template.HTML(userInput) -- 类型转换绕过 html/template 自动转义
  • template.JS(userInput) / template.CSS(userInput) -- 同上
  • c.HTML(200, template) (Gin) + text/template 而非 html/template
  • c.String(200, userInput) with Content-Type: text/html
  • w.Write([]byte(userInput)) with text/html Content-Type

Sanitization:

  • html/template 自动转义(但 template.HTML() 类型转换会绕过)
  • bluemonday HTML sanitizer
  • html.EscapeString(userInput)
  • 正确的 Content-Type header(application/json 而非 text/html)

CSRF (CWE-352)

Sources(攻击入口):

  • 跨站 POST/PUT/DELETE 请求

Sinks(状态修改端点):

  • 无 CSRF token 的 POST handler
  • Cookie-based auth 的 API 端点

Sanitization:

  • gorilla/csrf 中间件
  • SameSite=Strict / SameSite=Lax cookie 属性
  • 自定义 CSRF token(X-CSRF-Token header)
  • Double-submit cookie pattern

检测路径:

bash
# SSRF — HTTP 客户端调用
grep -rn "http.Get\|http.Post\|http.Client\|http.NewRequest" --include="*.go"
# URL 解析
grep -rn "url.Parse\|url.PathEscape\|net.Dial\|grpc.Dial" --include="*.go"
# XSS — template.HTML 类型转换
grep -rn "template.HTML\|template.JS\|template.CSS" --include="*.go"
# text/template 用于 HTML
grep -rn '"text/template"' --include="*.go"
# CSRF 中间件
grep -rn "csrf\|gorilla/csrf\|SameSite\|csrfToken" --include="*.go"
# Webhook 回调
grep -rn "webhook\|callback.*url\|notify.*url" --include="*.go"
# DNS rebinding 防护
grep -rn "net.LookupIP\|net.ResolveIPAddr\|IsPrivate\|IsLoopback" --include="*.go"
  1. SSRF: 搜索 HTTP 客户端调用,追踪 URL 来源是否来自用户输入,验证是否有 URL 白名单或 IP 黑名单
  2. XSS: 搜索 template.HTML() 类型转换和 text/template 使用,确认用户输入是否绕过了 auto-escaping
  3. CSRF: 检查状态修改端点是否有 CSRF 保护中间件,cookie 是否设置了 SameSite 属性

Detection Checklist

  • http.Get(userURL) SSRF 审计 (CWE-918):HTTP 客户端是否使用用户提供的 URL?是否验证了目标 URL 不指向内网地址(127.0.0.1, 10.x.x.x, 169.254.169.254)?
  • Kyverno apiCall 跨 Namespace SSRF 审计 (CWE-918):Kyverno policy 的 apiCall 是否使用了 ServiceAccount 的集群权限访问其他 namespace 的 API?低权限用户是否能通过 policy 间接发起请求?
  • Webhook 回调 URL 白名单审计 (CWE-918):Webhook callback URL 是否来自用户配置?是否限制了允许的目标域名?是否检查了 DNS 解析结果不指向内网?
  • DNS Rebinding 防护审计 (CWE-918):SSRF 防护是否在 DNS 解析后检查 IP?攻击者可通过 DNS rebinding 让域名先解析为公网 IP(通过检查)再解析为内网 IP(实际请求)。
  • template.HTML() 类型转换审计 (CWE-79):是否将用户输入通过 template.HTML(userInput) 类型转换?这会绕过 html/template 的自动转义,等同于直接输出原始 HTML。
  • Go Web 框架 XSS 审计 (CWE-79):Gin/Echo/Fiber 的 handler 是否以 text/html Content-Type 返回未转义的用户输入?c.HTML() 是否使用 html/template?
  • CSRF 保护中间件审计 (CWE-352):所有状态修改的 POST/PUT/DELETE 端点是否有 CSRF 保护?gorilla/csrf 中间件是否正确注册?
  • Cookie SameSite 属性审计 (CWE-352):认证 cookie 是否设置了 SameSite=Lax 或 SameSite=Strict?SameSite=None 需要 Secure 标志且仅在 HTTPS 下使用。

False Positive Exclusion Guide

以下模式不是此类漏洞:

  • SSRF: HTTP 客户端访问硬编码 URL -- 如 http.Get("https://api.github.com/...") 无用户控制
  • SSRF: 服务间内部通信 -- 如 gRPC 调用已知的内部服务地址
  • XSS: template.HTML 用于静态内容 -- 如硬编码的 HTML 片段
  • CSRF: 纯 API token 认证 -- 不使用 cookie 认证的 API 不受 CSRF 影响

以下模式需要深入检查:

  • SSRF: URL 来自数据库配置 -- 配置值是否可被低权限用户修改?
  • SSRF: http.Client 默认跟随重定向 -- 第一跳是合法 URL,但重定向到内网
  • XSS: html/template + 自定义 FuncMap -- FuncMap 中的函数是否返回 template.HTML 类型?
  • CSRF: SPA 前端 + Cookie auth -- 即使 SPA 不使用表单提交,cookie 仍会被浏览器自动发送

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 Ssrf Requestforgery AI skill do?

Use when auditing Go code involving HTTP client requests, webhook callbacks, URL handling, HTML template rendering in Go web frameworks, or CSRF protection. Covers CWE-918/352/79. Keywords: SSRF, server-side request forgery, XSS, cross-site scripting, CSRF, http.Get, http.Client, template.HTML, Gin, Echo, Fiber, webhook, Kyverno, DNS rebinding

Why use Go Vuln Ssrf Requestforgery on TypingMind?

Because you install it once and use it with any model. Go Vuln Ssrf Requestforgery 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 Ssrf Requestforgery 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-ssrf-requestforgery. 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 Ssrf Requestforgery?

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 Ssrf Requestforgery?

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

Is the Go Vuln Ssrf Requestforgery 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 👇