Php Symfony Audit logo

Php Symfony Audit

Community
0xShe
php-symfony-audit

Symfony 框架特效安全审计工具。针对 Symfony 常见 security.yaml、CSRF、Twig/Twig raw、表达式与访问控制等框架机制做白盒静态审计,并将风险映射到通用漏洞类型体系(AUTH/CSRF/CFG/XSS/TPL/LOGIC 等)。

Overview

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

Use it in TypingMind

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

分析 Symfony 项目源码中的“框架特效安全机制”和“配置/用法踩坑”,重点覆盖:

  • config/packages/security*.yaml 的 access_control、firewalls 配置正确性
  • CSRF 防护机制(表单提交与 token 验证)
  • Twig 渲染自动转义与 raw 输出风险
  • Symfony 访问表达式与安全拦截链(map 到 AUTH/EXPR/TPL 视情况)
  • HttpClient 外联策略(SSRF 类风险以通用 SSRF 类型映射)

输入

用户提供:

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

输出目录

输出到:

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

框架识别(必做)

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

  • 典型目录:config/、src/、templates/
  • 依赖证据:composer.json 中 symfony/framework-bundle 等
  • 入口证据:public/index.php 或类似前端控制器

风险类型映射(必做)

每条发现都必须写明:

  • 适用的通用类型码:AUTH / CSRF / CFG / XSS / TPL / LOGIC / SESS / SSRF / EXPR 等
  • 映射原因:为什么该 Symfony 风险会落在该类型码(用一句话)

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

1) 访问控制与鉴权策略(AUTH)

必须定位并输出:

  • security.yaml 中的 access_control 规则
  • firewalls 配置(是否 anonymous: true、是否 stateless: true 与认证方式)
  • switch_user、role_hierarchy 或 voter/policy 类配置(如存在)

判定规则:

  • 若存在过宽允许(例如过于泛化的匿名规则覆盖敏感路径),输出 AUTH 风险
  • 若存在“有认证但缺少角色/归属校验”的模式,输出 AUTH 或 LOGIC 风险

2) CSRF 防护(CSRF)

必须定位并输出:

  • Symfony CSRF 相关配置(framework: csrf_protection 或组件级配置)
  • 表单类型使用中 CSRF token 的生成与接收方式
  • token 验证失败的处理路径(是否早退、是否仅在某些分支校验)

判定规则:

  • 若存在“某些路由/表单禁用了 CSRF 或 CSRF token 接收字段不一致”,输出 CSRF 风险

3) Twig 自动转义与 raw 输出(XSS/TPL)

必须定位并输出:

  • Twig 配置:自动转义是否被关闭(全局或局部)
  • 模板中 raw 输出点:|raw、{% autoescape false %}、以及任何“绕过转义”的指令
  • 数据来源:raw 输出的变量来自哪里(request/session/数据库字段)

判定规则:

  • raw 输出变量来源可控且未做 escape,则映射到 XSS 或 TPL(若存在表达式执行/模板引擎可控)

4) 安全表达式与求值风险(EXPR/TPL/AUTH)

必须定位并输出:

  • ExpressionLanguage 用于 security 的位置(voter/policy 中 is_granted 或表达式条件)
  • 表达式字符串来源是否可能被用户控制(例如表达式拼接)

判定规则:

  • 若表达式字符串可控,按 EXPR 或 TPL 风险输出

5) 外联 HTTP 与内网访问(SSRF)

必须定位并输出(仅做框架关联检查):

  • HttpClient/KernelInterface 等外联调用的封装入口
  • URL/host 是否来源于用户输入,是否存在 allowlist 或内网拦截

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

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

  • 访问控制错误:用未登录/低权限用户访问疑似受保护路由,观察响应差异
  • CSRF 错误:构造表单请求缺失或伪造 CSRF token,观察状态码/错误路径

PoC 输出要求:

  • 必须包含真实路由与真实表单 action(或路由路径)
  • 必须说明预期观察点(例如是否返回 403、是否继续执行状态变更)

输出完整性检查(强制)

  • 输出包含:Symfony 识别证据点
  • AUTH/CSRF/Twig(raw)/安全表达式/HttpClient(可选) 五块均有检查结果
  • 每条风险都有:映射类型码 + 位置证据 + 可观测验证框架 + 修复建议

Frequently asked questions

What does the Php Symfony Audit AI skill do?

Symfony 框架特效安全审计工具。针对 Symfony 常见 security.yaml、CSRF、Twig/Twig raw、表达式与访问控制等框架机制做白盒静态审计,并将风险映射到通用漏洞类型体系(AUTH/CSRF/CFG/XSS/TPL/LOGIC 等)。

Why use Php Symfony Audit on TypingMind?

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

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

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

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

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