Php Yii Audit logo

Php Yii Audit

Community
0xShe
php-yii-audit

Yii 框架特效安全审计工具。针对 Yii(通常指 Yii2)访问控制(AccessControl/RBAC)、CSRF、输入过滤规则、输出编码策略、URL/重定向安全等进行白盒静态审计,并映射到通用漏洞类型体系(AUTH/CSRF/XSS/CFG/LOGIC 等)。

Overview

Publisher0xShe
RepositoryPHP-Code-Audit-Skill
Skill namephp-yii-audit
Stars
406
Forks
42
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 0xShe on GitHub. Read the source before you install it.

Installation

Install the Php Yii 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.
    https://github.com/0xShe/PHP-Code-Audit-Skill/tree/main/php-yii-audit
  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/0xShe/PHP-Code-Audit-Skill.git /tmp/PHP-Code-Audit-Skill
mkdir -p .claude/skills
cp -r /tmp/PHP-Code-Audit-Skill/php-yii-audit .claude/skills/php-yii-audit
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Php Yii 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 Php Yii 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 Php Yii 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.

PHP Yii(Yii2)框架安全审计(php-yii-audit)

分析 Yii2 项目的框架机制与配置踩坑,重点覆盖:

  • 访问控制:AccessControl filter、roles 规则、matchCallback 的使用
  • RBAC:user->can/can() 路径的鉴权完整性
  • CSRF:enableCsrfValidation 与 cookie validation
  • 输出编码:views 是否使用 Html::encode、HtmlPurifier,以及危险的原样输出
  • URL 与跳转:redirect/Url 生成是否受信任输入控制
  • 入参过滤:rules()、safeAttributes()、场景(scenario)是否导致 Mass Assignment

输入

用户提供:

  • source_path:Yii 项目根目录 可选:
  • output_path:输出目录路径(默认 {source_path}_audit)

输出目录

输出到:

{output_path}/framework_audit/
  yii_{timestamp}.md

框架识别(必做)

必须给出 Yii 识别证据点(不允许空口断言):

  • 依赖证据:composer.json 包含 yiisoft/yii2 或相关组件
  • 入口证据:web/index.php 或 yii 入口脚本
  • 应用目录:controllers/、models/、views/

风险类型映射(必做)

每条发现都必须写明:

  • 通用类型码:AUTH / CSRF / XSS / CFG / LOGIC 等
  • 映射原因

必审清单(必做:逐项检查并输出结果)

1) AccessControl 鉴权规则正确性(AUTH)

必须定位并输出:

  • behaviors() 中的 AccessControl 配置:rules、roles、matchCallback 与 action 覆盖范围
  • 是否存在只依赖 matchCallback 的宽松模式
  • 是否有自定义认证逻辑但未落到统一 filter

判定规则:

  • 有路径能绕过 AccessControl 或 rules 过宽,则输出 AUTH 风险

2) RBAC/权限校验完整性(AUTH/LOGIC)

必须定位并输出:

  • 控制器/服务层的 user->can({value})、can() 或等价权限判断
  • 对象归属校验:是否同时验证 owner_id/user_id 或资源的归属关系

判定规则:

  • 若仅判断“用户有权限类型”,但未校验对象归属,输出 AUTH 或 LOGIC 风险

3) CSRF(CSRF)

必须定位并输出:

  • enableCsrfValidation 与 cookie validation 设置
  • token 接收字段与验证失败处理方式(是否早退)

4) 输出编码与 XSS(XSS)

必须定位并输出:

  • views 中是否存在原样输出:Html::encode 被绕过的情况、或使用 raw 类机制
  • 模板中是否将用户输入直接拼接到 HTML 属性/JS/URL 中

5) 输入过滤与 Mass Assignment(LOGIC)

必须定位并输出:

  • 模型 rules()、safeAttributes()、scenarios() 的配置
  • 是否存在 load($request->post()) 后直接保存,而敏感字段未被禁止

可观测 PoC(必做:框架特效可观测验证框架)

至少给出以下两类其一并写清观察点:

  • AUTH:对疑似受保护 action,用低权限用户请求,观察响应差异或业务副作用
  • CSRF:对疑似受保护的状态变更 POST 请求,缺失 CSRF token,观察错误与是否仍成功执行

PoC 输出要求:

  • 必须包含 controller/action 路由与参数字段
  • 必须说明你要观察的 HTTP 状态码与业务结果

输出完整性检查(强制)

  • 输出包含:AccessControl/RBAC/CSRF/输出编码/Input filtering 检查结果
  • 每条风险都有:映射类型码 + 位置证据 + 可观测验证框架 + 修复建议

Frequently asked questions

What does the Php Yii Audit AI skill do?

Yii 框架特效安全审计工具。针对 Yii(通常指 Yii2)访问控制(AccessControl/RBAC)、CSRF、输入过滤规则、输出编码策略、URL/重定向安全等进行白盒静态审计,并映射到通用漏洞类型体系(AUTH/CSRF/XSS/CFG/LOGIC 等)。

Why use Php Yii Audit on TypingMind?

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

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/0xShe/PHP-Code-Audit-Skill/tree/main/php-yii-audit. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Php Yii 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 Php Yii Audit?

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

Is the Php Yii Audit AI skill free?

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