AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Deserialization Xxe

skill-zhaji2333-ckskills-deserialization-xxe · by zhaji2333

当发现XML导入/SOAP/Office解析、序列化数据(Java/PHP/Python/.NET)、JSON深合并、yaml.load、不可信反序列化入口时调用。负责反序列化RCE链、XXE、原型污染、phpggc/ysoserial利用链构造与验证。

No reviews yet
0 installs
0 views
view→install

Install

$ agentstack add skill-zhaji2333-ckskills-deserialization-xxe

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets Used
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-zhaji2333-ckskills-deserialization-xxe)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
today

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Deserialization Xxe? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

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


]>
&xxe;

进阶利用

  • 无回显:外部 DTD + 带外(OOB)读取文件
  • SSRF:SYSTEM "http://169.254.169.254/latest/meta-data/"
  • 文件读取:file:///etc/passwdphp://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
  • 输入校验:拒绝序列化对象格式(按业务白名单)

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.