dinosn GitHub avatar

fastjson-jsontype-rce-lab

dinosn

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

Stars

168

7 天增长

暂无数据

Fork 数

83

开放 Issue

0

开源协议

MIT

最近更新

2026-07-22

为什么值得关注

它展示了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 和编程语言匹配的相似项目。

yaojingang
精选
yaojingang GitHub avatar

TokHub

An open-source system for AI API relay stations that integrates public status pages, supplier rankings, user workspaces, admin backend, multi-layer health probing, usage metering, alerting, auditing, key encryption, and Docker self-hosting into a single deployable platform.

AI 与机器学习后端与 API
109
dboudreau00
精选
dboudreau00 GitHub avatar

Conformiti

Conformiti is a self-hosted, open-source compliance management application that ships with full control libraries for SOC 2, ISO 27001, and PCI DSS v4.0.1, offering document lifecycle management, review reminders, role-based access, and an analytics dashboard.

后端与 API数据与数据库
147
jamesob
精选
jamesob GitHub avatar

local-llm

A comprehensive guide for building and configuring a high-end local machine to run state-of-the-art LLMs, with detailed hardware choices, BIOS tuning, and Docker-based model serving.

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