Code Security Audit logo

Code Security Audit

Community
ProgrammerAnthony
code-security-audit

Use when 用户需要对代码进行安全审计、发现安全漏洞、上线前安全评估、检查代码是否存在安全风险时。触发场景:代码安全审计、安全审计、白盒审计、安全扫描、漏洞检测、漏洞挖掘、SQL注入、命令注入、XSS、SSRF、反序列化、认证绕过、越权、代码安全检查、security audit、code audit、pentest、渗透测试准备、帮我看看有没有安全漏洞、上线前安全review、有没有漏洞、找安全问题。

Overview

PublisherProgrammerAnthony
RepositoryExpert-Coding-Harness
Skill namecode-security-audit
Stars
236
Forks
77
Bundled files
32
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.

  • 32 bundled files

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

  • Open source

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

Installation

Install the Code Security Audit 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.
  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/ProgrammerAnthony/Expert-Coding-Harness.git /tmp/Expert-Coding-Harness
mkdir -p .claude/skills
cp -r /tmp/Expert-Coding-Harness/skills/code-security-audit .claude/skills/code-security-audit
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Code Security Audit 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 Code Security Audit 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 Code Security Audit 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.

代码安全审计专家

铁律:所有漏洞发现必须有代码路径证据。 禁止基于"典型框架通常有此漏洞"等假设报告漏洞,未找到完整调用链的必须标记为"疑似,需人工验证"。

Inputs / Outputs / Gates / Handoffs(统一契约)

  • Inputs(最小输入):目标仓库/目录;技术栈线索(语言/框架/运行方式);审计范围(模块/commit/接口);扫描模式(Quick/Standard/Deep)。
  • Outputs(产物形态):审计计划(先)+ 结构化审计报告(后,结构参考 references/audit-report-template.md)。
  • Gates(继续前必须满足)
    • 未经用户确认范围与模式,禁止开始扫描分析(保持与本文件 HARD-GATE 一致)。
    • 结论必须有代码路径证据链(Source→Sink);不完整链路必须标为“疑似,需人工验证”。
    • 通用门控清单可复制使用:references/quality-gates-checklist.md
  • Handoffs(推荐下游)
    • writing-plans(实施计划编写):输出修复计划
    • subagent-driven-development(子代理驱动开发):按计划执行修复
    • code-security-audit(代码安全审计专家):修复后复审

审计方法:三层分析法

层次方法目标
Grep / 模式匹配快速定位高风险区域,识别危险函数调用
线Read / 逐行追踪完整数据流追踪,Source → Sink 路径分析
推理 / 逻辑验证确认漏洞有效性、防护可绕过性、利用条件

扫描模式

启动时询问用户选择模式(默认 Standard):

请选择扫描模式:
1. Quick(快速扫描,约 5-10 分钟)— 高危漏洞 + 敏感信息 + 已知 CVE
2. Standard(标准扫描,约 30-60 分钟)— OWASP Top 10 + 认证授权 + 加密
3. Deep(深度扫描,约 1-3 小时)— 全维度覆盖 + 攻击链 + 业务逻辑 + 合规

10 个安全维度 + 三轨模型

#维度审计轨道覆盖内容
D1注入Sink-drivenSQL/Cmd/LDAP/SSTI/SpEL/JNDI
D2认证Config-drivenToken/Session/JWT/Filter 链
D3授权Control-drivenCRUD 权限一致性、IDOR、水平越权
D4反序列化Sink-drivenJava/Python/PHP Gadget 链
D5文件操作Sink-driven上传/下载/路径遍历
D6SSRFSink-drivenURL 注入、协议限制
D7加密Config-driven密钥管理、加密模式、KDF
D8配置Config-drivenActuator、CORS、错误信息暴露
D9业务逻辑Control-driven竞态条件、Mass Assignment、状态机、多租户隔离
D10供应链Config-driven依赖 CVE、版本检查

五阶段审计流程

Phase 1:侦察与架构建模(约 10% 工时)

目标:建立项目全貌,产出架构图和攻击面清单。

bash
# 技术栈识别
ls -la
find . -name "package.json" -o -name "pom.xml" -o -name "requirements.txt" -o -name "go.mod" | head -20
# 入口点识别
rg "router|app.route|@RequestMapping|@Controller|@RestController" -l
# 配置文件识别
find . -name "*.yml" -o -name "*.yaml" -o -name "*.properties" -o -name "*.env" | head -20
# 敏感信息预扫
rg -i "password|secret|api_key|token|private_key" -l

输出:

  • 技术栈与框架版本
  • Mermaid 架构图(分层/数据流/攻击路径)
  • 攻击面清单(对外 API 端点列表)
  • 数据流边界(外部输入来源)

加载 references/knowledge/architecture-analysis.md 获取架构分析方法论。


Phase 2:并行模式匹配(约 30% 工时)

目标:按 10 个维度并行扫描,快速定位高风险区域。

加载 references/knowledge/pattern-scanning.md 获取各语言的危险函数模式。
加载 references/knowledge/secret-detection.md 扫描敏感信息泄露。

Sink-driven 扫描(D1、D4、D5、D6):

  • 搜索危险函数 → 向上追踪参数来源 → 验证是否有防护

Control-driven 扫描(D3、D9):

  • 枚举所有 API 端点 → 逐一验证权限校验是否完整

Config-driven 扫描(D2、D7、D8、D10):

  • 检查认证配置、加密算法、调试开关、依赖版本

完成后对照 references/checklists/coverage-matrix.md 自检维度覆盖率。
D1–D3 任一未覆盖,不可进入 Phase 3。


Phase 3:深度污点追踪(约 40% 工时)

目标:对 Phase 2 发现的高危点进行完整数据流追踪,确认漏洞真实性。

加载 references/knowledge/data-flow-analysis.md 获取数据流模型。
加载 references/knowledge/taint-analysis-enhanced.md 获取污点追踪报告模板。
加载 references/knowledge/phase2-deep-methodology.md 获取 D3/D9 深度方法论。

追踪路径:Source(用户输入)→ Filter(安全控制)→ Service(业务处理)→ Sink(危险操作)

对每个疑似漏洞:

  1. 确认数据可达性:外部输入能否到达危险操作(找代码证据,不做假设)
  2. 确认防护缺失:净化函数是否真的有效,是否有绕过可能
  3. 评估可利用性:利用是否需要特定权限或条件

Phase 4:攻击链构建与漏洞验证(约 15% 工时)

目标:评估漏洞组合攻击可能性,构建完整攻击路径,评估综合风险。

加载 references/knowledge/vulnerability-validation.md 获取漏洞验证四步法。
加载 references/knowledge/attack-chain-analysis.md 获取攻击链构建方法。

攻击链分析步骤:

  1. 识别所有已确认漏洞的关联关系
  2. 构建漏洞依赖关系图(哪些漏洞可以组合利用)
  3. 评估攻击链的综合风险等级(通常高于单个漏洞)
  4. 提供攻击链的优先修复建议

Phase 5:生成结构化报告(约 5% 工时)

加载 references/knowledge/reporting.md 获取报告生成标准。
加载 references/templates/report-template.md 获取完整报告模板。

报告必须包含:

  • 执行摘要(总体风险评级、关键发现数量)
  • 项目概述(技术栈、架构图)
  • 漏洞详情(含完整数据流路径 Source→Sink)
  • 攻击链分析(漏洞组合场景)
  • 修复建议(P0 立即/P1 短期/P2 中期/P3 长期)
  • 覆盖矩阵自检结果
  • 未覆盖范围说明

严重度分级

级别CVSS 分数响应时间典型示例
Critical9.0-10.024小时内RCE、SQL注入获取所有数据
High7.0-8.91周内越权访问、文件路径穿越
Medium4.0-6.91月内信息泄露、弱加密
Low0.1-3.93月内非敏感信息暴露、最佳实践偏差
Info0.0可选修复代码质量问题、建议性改进

防幻觉规则

核心原则:宁可漏报,不可误报。误报会消耗开发团队信任。

禁止行为正确做法
基于"典型框架通常有此漏洞"直接标记必须在项目代码中找到具体调用链
凭记忆编造代码片段只引用 Read 工具实际读取的代码
编造或估计行号使用读取结果中的实际行号
未找到完整调用链就列为确认漏洞标记为"疑似,需人工验证"
找到防护代码就跳过该维度验证防护是否充分、是否可绕过
不确定版本是否受 CVE 影响就不提如实说明不确定性,提供排查方向

完整规则加载 references/knowledge/anti-hallucination.md


参考资源(按需加载)

核心知识库

  • references/knowledge/architecture-analysis.md — Phase 1 架构分析方法论
  • references/knowledge/pattern-scanning.md — Phase 2 多语言危险函数模式
  • references/knowledge/data-flow-analysis.md — Phase 3 数据流模型与追踪方法
  • references/knowledge/taint-analysis-enhanced.md — 污点追踪报告模板
  • references/knowledge/phase2-deep-methodology.md — D3/D9 控制流深度方法论
  • references/knowledge/vulnerability-validation.md — Phase 4 漏洞验证四步法
  • references/knowledge/attack-chain-analysis.md — 攻击链构建与综合风险评估
  • references/knowledge/reporting.md — Phase 5 报告生成标准
  • references/knowledge/secret-detection.md — 敏感信息检测方法
  • references/knowledge/dependency-analysis.md — 依赖安全分析(D10)
  • references/knowledge/anti-hallucination.md — 防幻觉完整规则
  • references/knowledge/security-controls-matrix.yaml — 安全控制矩阵(CWE 映射)

检查清单

  • references/checklists/coverage-matrix.md — D1-D10 覆盖自检与终止条件
  • references/checklists/code-level-checklist.md — OWASP 代码级逐项检查
  • references/checklists/architecture-level-checklist.md — 架构级安全检查

漏洞规则

  • references/rules/sql-injection-rules.md — SQL 注入检测规则与模式
  • references/rules/command-injection-rules.md — 命令注入检测规则与模式

报告与模板

  • references/templates/report-template.md — 完整审计报告模板(快速版/完整版)
  • references/templates/reproduction-steps-template.md — 漏洞复现步骤模板
  • references/templates/architecture-diagram-templates.md — Mermaid 架构图模板

扩展资料

  • references/wooyun/wooyun-cases.md — WooYun 真实漏洞案例库(2010-2016)
  • references/examples/audit-examples.md — 完整审计流程示例
  • references/examples/vulnerability-cases.md — 多语言漏洞案例库
  • references/examples/detailed-vulnerability-chains.md — 攻击链 POC 详细步骤
  • references/compliance/compliance-frameworks.md — GDPR/PCI-DSS/ISO 27001 合规要点
  • references/tools/security-tools.md — SAST 工具配置与命令参考
  • references/devsecops-best-practices.md — DevSecOps 左移实践指南

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 Code Security Audit AI skill do?

Use when 用户需要对代码进行安全审计、发现安全漏洞、上线前安全评估、检查代码是否存在安全风险时。触发场景:代码安全审计、安全审计、白盒审计、安全扫描、漏洞检测、漏洞挖掘、SQL注入、命令注入、XSS、SSRF、反序列化、认证绕过、越权、代码安全检查、security audit、code audit、pentest、渗透测试准备、帮我看看有没有安全漏洞、上线前安全review、有没有漏洞、找安全问题。

Why use Code Security Audit on TypingMind?

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

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ProgrammerAnthony/Expert-Coding-Harness/tree/master/skills/code-security-audit. 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 Code Security Audit?

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 Code Security Audit?

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

Is the Code Security Audit AI skill free?

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