deserialization-xxe
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "deserialization-xxe" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-7476b726cbf0e78b4a68391ea9b3b2b5a87868accbb671df07919cb5c3eb30c3. Verify the upstream source and version against https://github.com/zhaji2333/CkSKILLS before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Invoke when encountering XML import/SOAP/Office parsing, serialized data (Java/PHP/Python/.NET), JSON deep merge, yaml.load, or untrusted deserialization entry points. Responsible for constructing and validating deserialization RCE chains, XXE, prototype pollution, and phpggc/ysoserial gadget chains.
Introduction source: third_party · zhaji2333 · 0.0.1 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: deserialization-xxe
description: 当发现XML导入/SOAP/Office解析、序列化数据(Java/PHP/Python/.NET)、JSON深合并、yaml.load、不可信反序列化入口时调用。负责反序列化RCE链、XXE、原型污染、phpggc/ysoserial利用链构造与验证。deserialization-xxe — 反序列化与解析器漏洞专项深度挖掘
何时调用(触发条件)
- XML 导入/上传、SOAP 接口、Office/Excel 解析
- 序列化数据入口(Java readObject、PHP unserialize、Python pickle、.NET BinaryFormatter)
- JSON 深合并/深拷贝(Node.js 原型污染)
- yaml.load 未指定安全 Loader
- 代码审计发现危险函数(见
source-code-audit)
一、漏洞类型全景
| 类型 | 语言/场景 | 修复 |
|---|---|---|
| H1. 反序列化 | Java/PHP/Python/.NET | 禁用危险反序列化、白名单 |
| H2. XXE | XML导入、SOAP、Office解析 | 禁用外部实体 |
| H3. 原型污染 | Node.js对象合并 | 过滤危险键 |
二、反序列化专项
各语言危险入口
Java: readObject / XMLDecoder / JNDI lookup / JdbcRowSetImpl / TemplatesImpl
PHP: unserialize / phar反序列化
Python: pickle.loads / yaml.load(Loader=Loader)
.NET: BinaryFormatter / XMLSerializer
利用工具
| 语言 | 工具 |
|---|---|
| Java | ysoserial / marshalsec(RMI/LDAP 起服务) |
| PHP | phpggc |
| Python | pickle 手工构造 |
利用链思路
- Java:Gadget 链(CommonsCollections、CommonsBeanutils 等)→ RMI/LDAP 打 JNDI
- PHP:POP 链(Laravel/ThinkPHP/Yii 框架 gadget)+ phar 协议触发
- Python:pickle 反序列化执行命令
- 入口识别:base64/hex 编码的序列化流、
rO0AB(Java)、a:{}(PHP)、O:8:(PHP对象)
三、XXE 专项
基础 Payload
<?xml version="1.0"?>
<!DOCTYPE foo [
<!ENTITY xxe SYSTEM "file:///etc/passwd">
]>
<foo>&xxe;</foo>
进阶利用
- 无回显:外部 DTD + 带外(OOB)读取文件
- SSRF:
SYSTEM "http://169.254.169.254/latest/meta-data/" - 文件读取:
file:///etc/passwd、php://filter/read=convert.base64-encode/resource=config.php - 协议:http/ftp/gopher
- Office 文档 XXE:docx/xlsx 内 XML 注入外部实体
触发场景
- XML/Excel/CSV 导入
- SOAP 接口
- 文档预览/转换
- SVG 上传(图片上传点也测 XXE)
四、原型污染专项(Node.js)
__proto__ / constructor.prototype / constructor.prototype.__proto__
触发场景
- JSON.parse 后深合并(lodash.merge、Object.assign 递归合并)
- 配置合并、查询参数合并
利用思路
- 污染
__proto__.isAdmin=true/__proto__.shell=... - 污染
__proto__.env(pug/ejs 模板引擎 RCE) - 污染
Object.prototype影响全局校验逻辑
五、验证要点
- 反序列化:先确认可控输入点与编码方式,再选 gadget 链验证 RCE
- XXE:先测回显(文件读取),无回显用 OOB DNSLog 验证
- 原型污染:控制台/接口验证
Object.prototype被污染 - 每个 payload 至少尝试到 Level 4 绕过(编码/变形/协议)
六、修复建议
- 禁用危险反序列化或使用白名单/黑名单过滤
- XML 解析禁用外部实体(XXE 防护)
- yaml 使用
SafeLoader - 深合并过滤
__proto__/constructor键 - 输入校验:拒绝序列化对象格式(按业务白名单)
Version history
-
v2.1.0
GitHub ↗
Original release notes
## 一句话 新增 **`kb/` 结构化数据层**(664 CVE / 237 字典 / 69 载荷)与 **内网/域技能包 `internal-network`**(10 块),`cloud-infra` 扩充 10 块;全局路由、纪律、索引同步接线,并修掉 7 个超限知识块与存量死链。 ## 新增 - **数据层 `kb/`**:`vuln/` 664 条 CVE(ai/cloud/middleware/network/web)、`dict/` 237 个字典(368 万行)、`payload/` 69 个载荷;4 个自动索引 + `tools/kb_index.py`(`--check` 做一致性闸,不参与默认加载) - **`internal-network`(内网/域)**:域侦察与决策树、Kerberos、委派/ACL/ADCS、凭据/中继/投毒、横向移动、隧道多跳、后渗透提权、持久化、内网基础设施(Exchange/SCCM/OA/DB/中间件)、工具投递 - **`kb-security-data`**:CVE / 字典 / payload 检索入口(30 秒分诊 + 证据纪律) - **`cloud-infra` +10 块**:多云概览、AWS IAM 提权、Azure/GCP、国内云、云凭据/IAM/元数据、K8s 逃逸与集群、K8s 组件/网络/存储、容器运行时、对象存储/Serverless、CI-CD/供应链/IaC - **战法索引-08-内网与域**(22 行首枪表)、`rules/55-kb-usage.md`、`templates/SEEDS.template.md` - **`docs/CHANGELOG.md`**:v2.1 完整更新记录 ## 变更 - `AGENTS.md`(10 秒决策 + 文件地图)、`rules/70`、`docs/TRIGGER-MATRIX.md`、`ck-router`(分诊/索引/进站决策)、`README.md`、`docs/ARCHITECTURE.md`(六层结构)全部接线 - 技能包 16 → **18**,知识块 **501**,规则 11 → **12** ## 修复 - 7 个超过 12KB 的知识块按「索引 + 分段」拆分(原文件名保留,新增 `-b` 分段) - 存量死链、kb 相对路径、索引兜底计数、CTF 导向表述清理 ## 验收 - 单块 ≤12KB:0 超限;SKILL.md 全部达标;死链 0 - `python3 tools/kb_index.py --check` → OK(664 / 237 / 69) - 常驻层 `AGENTS.md` 5.4KB(限 6.5KB) ## 升级方式 更新仓库后运行 `python3 tools/kb_index.py --check` 确认索引一致;用法见 `docs/CHANGELOG.md` 第 5 节与 `README.md`「数据层 kb/」小节。
Current listing version
0.0.1
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 专注反序列化与解析器漏洞挖掘,在安全审计领域具备高实用价值
- 覆盖 Java/PHP/Python/.NET/Node.js 多语言场景,技术深度强
Highlights
- 触发条件描述精准完整,涵盖 XML/SOAP/Office/反序列化/原型污染等全部关键入口
Areas to improve
-
Description in the wrong location Reported severity: Minor
顶层 frontmatter 的 description 字段与 skill_body 内部重复
Recommendation: 建议移除 skill_body 内部的 description 字段,保持唯一性
Highlights
- Phase/步骤清晰,含详细表格、代码示例和修复建议
Areas to improve
-
缺少端到端完整示例 Reported severity: Minor
现有示例为片段式 Payload,缺乏从发现入口到成功利用的完整流程演示
Recommendation: 补充一个完整的端到端利用示例(如:Java 反序列化从识别到 RCE 的全过程)
Highlights
- 提供多种利用工具和验证思路,覆盖回显/OOB/DNSLog 等场景
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- 169.254.169.254
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.