Php Laravel Audit logo

Php Laravel Audit

Community
0xShe
php-laravel-audit

Laravel 框架特效安全审计工具。针对 Laravel 常见鉴权/CSRF/Session/模型填充/Blade 渲染等框架特性进行白盒静态审计,并将风险映射到你现有通用漏洞类型体系(AUTH/CSRF/LOGIC/XSS/CFG 等)。

Overview

Publisher0xShe
RepositoryPHP-Code-Audit-Skill
Skill namephp-laravel-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 Laravel 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-laravel-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-laravel-audit .claude/skills/php-laravel-audit
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Php Laravel 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 Laravel 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 Laravel 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 Laravel 框架安全审计(php-laravel-audit)

分析 Laravel 项目源码中的“框架特效安全机制”和“常见踩坑模式”,重点覆盖:

  • 鉴权与路由保护(middleware/auth/Policies/Gates)
  • CSRF 与 token 保护(VerifyCsrfToken、except 列表、API 与 Cookie 认证差异)
  • Session 与 Cookie 安全(session_regenerate_id、cookie flags、remember 机制的风险点)
  • Eloquent mass assignment 与 request-to-model 写入缺陷(Model::create/fill/update 与 $request->all() 链)
  • Blade 模板渲染中的 raw 输出与表达式执行风险({!! !!}、@php 以及未转义输出)
  • Laravel signed URL 与路由签名校验是否闭环(Signed middleware 与生成位置)

输入

用户提供:

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

输出目录

输出到:

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

框架识别(必做)

必须给出你识别该项目为 Laravel 的证据点(不允许空口断言):

  • composer.json 依赖
  • 典型目录:app/、routes/、config/
  • 核心入口:public/index.php、bootstrap/app.php

风险类型映射(必做)

每条发现都必须写明:

  • 适用的通用类型码:AUTH / CSRF / LOGIC / XSS / CFG / SESS / FILE 等(从你的 shared/SEVERITY_RATING.md 可用类型码中选)
  • 这条 Laravel 风险为什么落到该通用类型码(用一句话解释映射逻辑)

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

1) 鉴权与权限保护(AUTH)

必须定位并输出以下证据:

  • 受保护路由进入点:routes/web.php 与 routes/api.php 中的 middleware('auth') / middleware('can') / Route::middleware([{value}])->group({value})
  • 权限逻辑:Gate:: / Policy / authorize / can / ->can({value}) 的位置证据
  • 风险判断:是否存在“已登录但无资源级归属校验”的模式(例如只判断 user 存在,不判断 owner)
  • 路由命名与资源绑定:是否存在 Route Model Binding 但未做归属校验

输出要求:

  • 若发现缺失:必须给出“缺失位置 + 可能被绕过的请求类型(GET/POST/API)+ 修复建议”
  • 若未发现:也必须输出“未发现的判定依据”(例如 except/guard 为空、敏感路由均有 middleware 等)

2) CSRF 与 token 保护(CSRF)

必须定位:

  • CSRF middleware:VerifyCsrfToken 或等价中间件
  • except 列表:哪些路由被排除
  • API 与 Cookie 认证差异:若项目对 API 使用 Cookie/session,需要确认 API 路由是否仍受 CSRF 保护

输出要求:

  • 必须覆盖“可能绕过分支”:例如仅部分方法不校验、仅某些 Content-Type 不校验、仅在 AJAX 时跳过等

3) Session 与 Cookie 安全(SESS)

必须定位:

  • 登录后会话固定防护:是否存在 session_regenerate_id 或 Laravel 对应机制证据
  • Cookie flags:HttpOnly/Secure/SameSite 的配置位置(config/session.php 或自定义中间件)
  • logout:退出是否清理 session

4) Eloquent mass assignment(LOGIC)

必须定位并输出数据流链证据:

  • request 输入获取:$request->all()、$request->input({value})、json_decode({value})
  • 写入模型点:Model::create({value}) / Model::update({value}) / $model->fill({value}) / ->save()
  • 模型填充策略:$fillable / $guarded 的配置位置

判定规则:

  • $request->all() 或等价输入直接进入 create/fill/update,且模型缺少针对敏感字段的 denylist(或 $fillable 过宽),则输出风险

5) Blade raw 输出(XSS)

必须定位并输出:

  • raw 输出:{!! {value} !!}、@php 以及任何“跳过转义”的指令或回调
  • 用户输入来源:来自 $request、request()、数据库字段回填但未转义时的证据

判定规则:

  • 若 raw 输出内容存在用户可控字段,且未做 e() 或等价 escape,则输出风险映射到 XSS 或相关模板注入风险(若你项目用到模板表达式执行则映射到 TPL)

6) Signed URLs 与签名校验闭环(AUTH 或 CFG)

必须定位:

  • 签名 URL 生成:URL::temporarySignedRoute / URL::signedRoute
  • 验证中间件:middleware('signed') 或等价校验机制

判定规则:

  • 若仅生成但无签名验证中间件,或验证逻辑可被绕过,输出风险映射到 AUTH 或 CFG

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

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

  • 鉴权缺失/越权绕过:给出真实路由与 payload 目标(例如切换对象 id)
  • CSRF 缺失/绕过:给出真实路由与需要携带/不携带的 token 场景,并说明观察点

PoC 输出要求:

  • 必须包含真实路由(从 routes/*.php 真实可命中位置抽取)
  • 必须包含真实字段名(如 csrf 字段、或表单 action)

输出完整性检查(强制)

  • 输出包含:Laravel 识别证据点
  • CSRF/Auth/Session/Mass Assignment/Blade raw/Signed URL 六大块均有“检查结果”
  • 每条风险都有:映射类型码 + 位置证据 + 可观测验证框架 + 修复建议

Frequently asked questions

What does the Php Laravel Audit AI skill do?

Laravel 框架特效安全审计工具。针对 Laravel 常见鉴权/CSRF/Session/模型填充/Blade 渲染等框架特性进行白盒静态审计,并将风险映射到你现有通用漏洞类型体系(AUTH/CSRF/LOGIC/XSS/CFG 等)。

Why use Php Laravel Audit on TypingMind?

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

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

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

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

Is the Php Laravel 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 👇