dinosn GitHub avatar

fastjson-jsontype-rce-lab

dinosn

该仓库复现并提供了针对Fastjson 1.2.83远程代码执行链的检测工具,该链利用@JSONType注解和/proc/self/fd文件描述符技术,绕过了禁用AutoType和DTO绑定的防护。

Stars

184

7 天增长

+34

Fork 数

88

开放 Issue

0

开源协议

MIT

最近更新

2026-07-27

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它展示了Fastjson 1.2.83中一个即使在禁用AutoType并通过固定DTO时仍能生效的关键漏洞(F105),并提供了可复现的实验环境和防御性扫描工具。

适合谁使用

  • 分析Fastjson漏洞的安全研究人员
  • 在生产环境中使用Fastjson的Java开发人员
  • 保护Java应用程序的DevOps工程师
  • 评估攻击面的渗透测试人员

典型使用场景

  • 在受控实验室环境中复现@JSONType远程JAR/FD链
  • 被动检查JSON请求日志中的利用模式
  • 对JAR制品进行静态清单检查,发现易受攻击的Fastjson版本
  • 主动可达性探测,在不触发RCE的情况下检测是否存在漏洞端点

项目优势

  • 包含传统JDK 8和现代JDK 17的可复现实验环境,文档清晰
  • 提供四个无依赖的Python扫描工具,涵盖被动、静态、主动和载荷生成
  • 覆盖Fastjson 1.2.83全部193个Java文件的2041个可调用行进行安全审查
  • 提供明确的缓解建议,包括安全模式和厂商专用版本

使用前须知

  • 现代FD链需要在Linux上使用procfs并满足特定条件,并非所有JDK或操作系统均适用
  • 实验环境仅限授权使用;传统实验室会执行命令,必须隔离运行
  • 主动探测仅确认回调,不证明类加载或代码执行

README 快速开始

Fastjson @JSONType remote-JAR/FD-chain lab and detection

This repository now preserves two distinct Fastjson research tracks:

  • modern-fd/ is the recommended, marker-only reconstruction of the Fastjson 1.2.83 single-body remote-JAR/file-descriptor chain on Spring Boot 3, normal embedded Tomcat and JDK 17. It uses the literal fixed-DTO sink JSON.parseObject(body, BoundEnvelope.class) with AutoType disabled.
  • The original top-level Docker Compose lab preserves the earlier JDK 8 direct remote-class route. It is command-capable and should be treated as a legacy, isolated proof rather than the modern-JDK method.
  • scanner/ contains passive request/log detection, static artifact inventory and a non-executing reachability probe.

The bug: ParserConfig.checkAutoType probes every @type value for the @JSONType annotation by doing getResourceAsStream(typeName.replace('.','/') + ".class"). On modern Linux/JDK combinations, a remote jar:http probe can leave the JAR cached behind an open descriptor; later jar:file:/proc/self/fd/N probes in the same body can reopen it under valid class names and initialize an annotated class. The exact 1.2.83 composition works with AutoType disabled and through a fixed DTO containing List. Binding alone is therefore not a mitigation. Full walk-through: docs/MECHANISM.md.

Security review findings

The companion whole-project review covered 2,041 callable/static-initializer rows across all 193 Fastjson 1.2.83 production Java files. The table below prioritizes the highest-impact results; it is not a claim that every Fastjson deployment is affected. This repository directly reproduces F105. The remaining entries summarize separately sealed source review and bounded lab evidence.

PriorityFindingProven resultImportant boundary
1F105 — remote @JSONType bytecode executionAttacker-supplied class initialization through compatible Spring Boot loaders, including the JDK 8 direct route and the Linux/JDK 17 retained-JAR /proc/self/fd/N continuationRequires a parser-reachable @type carrier, compatible Boot/TCCL loader, egress, SafeMode/IgnoreAutoType off, and an exact attacker JAR. The modern fixed-DTO route additionally needs a generic value lane (the lab uses List), Linux pro

项目描述

Docker lab + one-payload exploit + defensive scanner for the fastjson 1.2.66-1.2.83 @JSONType remote-class-load RCE (SSRF->defineClass under Spring Boot LaunchedURLClassLoader; autoType OFF; parseObject binding is not a mitigation)

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

m-novotny
精选
m-novotny GitHub avatar

memguard-rs

A Rust library that provides secure memory handling primitives including zeroization on drop, memory locking, constant-time comparison, and compile-time guarded regions, with zero dependencies and no_std support.

嵌入式与物联网安全
131
lopopolo
精选
lopopolo GitHub avatar

harness-engineering

Harness Engineering is a methodology for improving coding agent outputs by carefully crafting the environment around them—providing curated context, tools, and executable constraints that encode an organization’s nonfunctional requirements and cumulative lessons.

AI 与机器学习AI 智能体
2,390
slvDev
精选
slvDev GitHub avatar

esp32-ai

A 28.9 million parameter language model runs on an $8 ESP32-S3 microcontroller entirely on-device, generating simple stories at about 9.5 tokens per second.

AI 与机器学习大语言模型
1,960