dinosn GitHub avatar

fastjson-jsontype-rce-lab

dinosn

This repository reconstructs and provides detection tools for a Fastjson 1.2.83 remote code execution chain that exploits the @JSONType annotation and the /proc/self/fd file descriptor technique, bypassing AutoType disable and DTO binding.

Stars

168

7-day growth

No data

Forks

83

Open issues

0

License

MIT

Last updated

2026-07-22

Why it is worth attention

It demonstrates a critical vulnerability (F105) in Fastjson 1.2.83 that works even with AutoType disabled and through a fixed DTO, and offers both reproducible labs and defensive scanning tools.

Who it is for

  • Security researchers analyzing Fastjson vulnerabilities
  • Java developers using Fastjson in production
  • DevOps engineers securing Java applications
  • Penetration testers evaluating attack surface

Use cases

  • Reproducing the @JSONType remote-JAR/FD chain in a controlled lab environment
  • Passively inspecting JSON request logs for exploitation patterns
  • Static inventory of JAR artifacts for vulnerable Fastjson versions
  • Active reachability probing to detect vulnerable endpoints without RCE

Strengths

  • Includes both legacy JDK 8 and modern JDK 17 reproducible labs with clear documentation
  • Provides four dependency-free Python scanning tools for passive, static, active, and payload generation
  • Whole-project security review covering 2,041 callable rows across 193 Fastjson files
  • Clear mitigation guidance including SafeMode and vendor-specific builds

Considerations

  • Modern FD chain requires Linux with procfs and specific conditions; not universal across all JDKs or OS
  • Labs are intended for authorized use only; legacy lab executes commands and must be isolated
  • Active probe only confirms callback, not class loading or RCE

README quick start

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

Description

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)

Related repositories

Similar projects matched by category, topics, and programming language.

yaojingang
Featured
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 & Machine LearningBackend & APIs
109
dboudreau00
Featured
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.

Backend & APIsData & Databases
147
jamesob
Featured
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 & Machine LearningLarge Language Models
1,520