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

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

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

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2026-119618 — 针对 CVE-2026-119618 的容器化差分实验环境与 stdlib HTTP/2 PoC,该漏洞是 mod_http2 分配器竞态条件,会导致 Apache httpd 2.4.55-2.4.70 中的堆损坏,并附有 ASan/TSan 证据。 | Kitploit
工具/GitHubGitHub/googlesky/cve-2026-119618
Web漏洞扫描器容器安全动态分析 (沙盒)漏洞利用Web安全模糊测试论文与研究实验室与实践
GitHubgooglesky/cve-2026-119618

CVE-2026-119618

针对 CVE-2026-119618 的容器化差分实验环境与 stdlib HTTP/2 PoC,该漏洞是 mod_http2 分配器竞态条件,会导致 Apache httpd 2.4.55-2.4.70 中的堆损坏,并附有 ASan/TSan 证据。

查看仓库
1472天前尚未审核

最受欢迎

查看全部 →

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

  • 1

    OsintHunter

    letox4/osinthunter

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

    1.0k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock 一键执行应用(CVE-2026-43499)

    634
  • 3

    looking-glass

    anonghosty/looking-glass

    CSIRT 平台,可将 Shadowserver 报告导入 MongoDB,并将其重放为交互式地图、分析、发现、公告和高管仪表板。

    417
  • 4

    jumpserver

    jumpserver/jumpserver

    JumpServer是一个开源的特权访问管理(PAM)平台,为DevOps和IT团队提供通过Web浏览器按需安全访问SSH、RDP、Kubernetes、数据库和RemoteApp端点的能力。

    383
  • 5

    ARTEX

    baarai/artex

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

    328
  • 6

    SafeLine

    chaitin/safeline

    自托管WAF和反向代理,可过滤恶意HTTP流量、阻止SQL注入、XSS和机器人攻击,具备速率限制和动态HTML/JS加密功能。

    288

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2026-119618 — Apache httpd mod_http2 中 assign_headers() 的堆损坏

CVECVE-2026-119618
组件Apache HTTP Server,模块 mod_http2(独立版 mod_h2)
受影响版本httpd 2.4.55 – 2.4.70 · mod_h2 2.0.8 – 2.0.42
修复版本httpd 2.4.71 · mod_h2 2.0.43
CWECWE-362 — 使用共享资源的并发执行且同步不当
影响httpd 子进程中的堆损坏;可能导致远程代码执行
攻击向量网络、无需认证、HTTP/2(明文 h2c 或 TLS h2)
触发条件一个无请求体的 HTTP/2 请求,携带 Content-Type 且无 Content-Length,同时请求头表已填满至容量上限
修复提交824beab9b9424d6cfb29595248fdbf6c3dddeab1(cherry-pick 自 trunk 5ed39287660daacd1233cb9bbc984b25fa9a4fe3)
上游 PRapache/httpd#975 → apache/httpd#977,于 2026-11-09 合并
致谢Anthropic 的 OSS Scanner(ANT-2026-MAPKT6MZ);Google Cloud 漏洞研究团队的 Anthony Weems 和 Simon Scannell
安全公告https://httpd.apache.org/security/vulnerabilities_24.html
临时缓解措施从 Protocols 指令中移除 h2 和 h2c
代码仓库https://github.com/googlesky/CVE-2026-119618

mod_http2 为每个 HTTP/2 流分配独立的内存池,而该内存池继承拥有该会话的连接的分配器。该分配器没有互斥锁:apr_allocator_create() 不会创建互斥锁,因此 allocator_lock() 对整个连接而言是空操作。请求处理被刻意转移到工作线程,并使用私有分配器(c2_transit_create()),正是为了让工作线程永远不会触碰连接的分配器。assign_headers() 破坏了这一不变量:对于携带 Content-Type 且无 Content-Length 的无请求体请求,工作线程将合成的 Content-Length: 0 写入共享的流表,而非请求私有的 r->headers_in。当该表已满时,此写入会从连接的无锁分配器中分配一个新的 8 KB 节点,而此时连接线程正在从同一空闲链表分配或释放。两个线程可能弹出同一个节点,由此产生的双重所有权会损坏 httpd 子进程的堆。

本仓库包含一个容器化的差分实验环境,可在 httpd 2.4.70 上复现该损坏,用 ThreadSanitizer 证明竞态,展示 httpd 2.4.71 在相同流量下表现正常,测试所有同类请求形态,验证已发布的临时缓解措施,并记录在修复版本线上的 0-day 扫描。


1. 根本原因

1.1 受影响的代码

modules/http2/h2_request.c,Apache httpd 2.4.70,assign_headers()。 行号来自 2.4.70 发布版 tarball。

320: static void assign_headers(request_rec *r, const h2_request *req,
321:                            int no_body, int is_connect)
322: {
323:     const char *cl;
324:
325:     r->headers_in = apr_table_clone(r->pool, req->headers);
...
341:     /* Unless we open a byte stream via CONNECT, apply content-length guards. */
342:     if (!is_connect) {
343:         cl = apr_table_get(req->headers, "Content-Length");
344:         if (no_body) {
345:             if (!cl && apr_table_get(req->headers, "Content-Type")) {
346:                 /* If we have a content-type, but already seen eos, no more
347:                  * data will come. Signal a zero content length explicitly.
348:                  */
349:                 apr_table_setn(req->headers, "Content-Length", "0");
350:             }
351:         }

2.4.71 中的修复改动了一行:

-                apr_table_setn(req->headers, "Content-Length", "0");
+                apr_table_setn(r->headers_in, "Content-Length", "0");

r->headers_in 是在 r->pool 第 325 行创建的克隆,即工作线程拥有的请求池。req->headers 是流的表,从流池中分配,连接线程可以访问它。

1.2 流池共享连接的无锁分配器

h2_session_open_stream()(h2_session.c:117)将会话池的子池创建为每个流的池,并为其打上标签:

apr_pool_create(&stream_pool, session->pool);
apr_pool_tag(stream_pool, "h2_stream");
stream = h2_stream_create(stream_id, stream_pool, session, ...);

会话池是 MPM 在 child_main() 中创建的连接池的后代(server/mpm/prefork/prefork.c:423)。该池的分配器来自 apr_allocator_create(),并且从未在其上设置任何互斥锁:

/* memory/unix/apr_pools.c:164 */
static APR_INLINE void allocator_lock(apr_allocator_t *allocator)
{
#if APR_HAS_THREADS
    if (allocator->mutex)              /* NULL for the MPM allocator */
        apr_thread_mutex_lock(allocator->mutex);
#endif
}

另一方面,请求处理被明确设计为避免使用 该分配器。c2_transit_create()(h2_mplx.c:210)为每个 worker 提供一个私有分配器:

    /* We create a pool with its own allocator to be used for
     * processing a request. This is the only way to have the processing
     * independent of its parent pool in the sense that it can work in
     * another thread.
     */
    rv = apr_allocator_create(&allocator);

worker 的 request_rec 创建于 c2->pool 之上,而后者是 transit pool 的后代,因此 worker 通常进行的每次分配都是私有的。 存在漏洞的写入是例外:它从 stream pool 分配,而该 pool 的分配器属于连接。

1.3 仅当头部表已满时,写入才会进行分配

对不存在的键调用 apr_table_setn() 会落入 apr_table_add(), 后者调用 table_push() → apr_array_push_noclear() (tables/apr_tables.c:126):

if (arr->nelts == arr->nalloc) {
    int new_size = arr->nalloc <= 0 ? 1 : 2 * arr->nalloc;
    apr_table_entry_t *new_elts = apr_palloc(arr->pool, elt_size * new_size);
    ...
}

该表由 h2_request_create() 创建为 apr_table_make(pool, 10),因此 nalloc 从 10 开始并翻倍:10、20、 40、80、160。伪头部不会存储在表中——它们会变成 req->method、req->scheme、req->authority 和 req->path。 h2_request_end_headers()(h2_request.c:212)恰好添加一个 Host 条目。

因此,一个带有 79 个常规头部 的请求会持有 79 个条目,Host 使其变为 80,而当 assign_headers() 运行时则为 nelts == nalloc == 80。存在漏洞的 apr_table_setn() 会将数组增长到 160 个条目:

160 * sizeof(apr_table_entry_t) = 160 * 24 = 3840 bytes

allocator_align()(apr_pools.c:268)将其向上取整为 MIN_ALLOC (8192),因此只要流池的活动节点剩余不足 3840 字节,写操作就会向流池的 分配器请求一个新的 8 KB 节点。 这就是发生竞态的分配。

1.4 竞态

allocator_alloc()(apr_pools.c:289)遍历空闲节点链表 (allocator->free[index]、allocator->max_index)并弹出一个节点; allocator_free()(apr_pools.c:426)将一个节点压回并重写 max_index。由于没有互斥锁,这些操作是对同一个 apr_allocator_t 的 未同步读-改-写序列——该对象是一个 200 字节的堆对象, 由 apr_allocator_create() 在 child_main() 中分配。两个线程可能 弹出同一个节点,随后两个不同的池就会分发重叠的 内存。

ThreadSanitizer 在 2.4.70 上恰好捕获到了这一点 (evidence/tsan-vulnerable.txt):

WARNING: ThreadSanitizer: data race
  Read of size 8 at 0x7b34000001a0 by thread T1:
    #0 allocator_alloc memory/unix/apr_pools.c:315
    #1 apr_palloc memory/unix/apr_pools.c:843
    #2 apr_array_push_noclear tables/apr_tables.c:132
    #3 apr_table_setn tables/apr_tables.c:638
    #4 assign_headers /build/httpd-2.4.70/modules/http2/h2_request.c:353
    #5 h2_create_request_rec /build/httpd-2.4.70/modules/http2/h2_request.c:387
    #6 c2_process /build/httpd-2.4.70/modules/http2/h2_c2.c:748
    ...
  Previous write of size 8 at 0x7b34000001a0 by main thread:
    #0 allocator_free memory/unix/apr_pools.c:480
    #1 apr_allocator_free memory/unix/apr_pools.c:506
    #2 apr_bucket_free buckets/apr_buckets_alloc.c:241
    #3 socket_bucket_read buckets/apr_buckets_socket.c:43
    ...
  Location is heap block of size 200 at 0x7b34000001a0 allocated by main thread:
    #1 apr_allocator_create memory/unix/apr_pools.c:187
    #2 child_main /build/httpd-2.4.70/server/mpm/prefork/prefork.c:423

工作线程(线程 T1,c2_process → assign_headers)读取空闲链表,而连接线程(主线程,h2_session_process → h2_c1_read)写入该链表。发生竞争的对象正是分配器本身。

这种损坏表现为分配器内部以及连接线程上的流代码中发生进程崩溃——allocator_lock、allocator_free、apr_palloc、run_cleanups、h2_stream_send_frame、output_data_buffered(evidence/asan.*)。

1.5 何时到达易受攻击的分支

h2_c2.c:748 传入 no_body 标志:

r = h2_create_request_rec(req, c, conn_ctx->beam_in == NULL);

conn_ctx->beam_in 由 stream->input 设置,而后者仅在流仍期望一个 body 时才存在。对于在 HEADERS 帧上结束的请求,close_input() 已执行,且 beam_in 为 NULL,因此 no_body == 1。

因此,该分支需要同时满足以下四个条件:

  1. 一个没有 body 的请求(END_STREAM 位于 HEADERS 帧上),
  2. 一个 Content-Type 头,
  3. 没有 Content-Length 头,
  4. 一个完整的头表:79 个常规头,加上由 :authority 合成的 Host 条目。

CONNECT 请求会短路该分支(if (!is_connect))。

1.6 为什么该修复对此调用点是完整的

修复后的构建执行相同的 3840 字节分配,但分配来自 r->headers_in,它位于 r->pool 中。r->pool 是 conn_ctx->req_pool,由 c2->pool(h2_conn_ctx.c:100)创建,后者是 transit pool 的后代——因此由 worker 的私有分配器支撑。分配模式不变;只有分配器改变。这正是使差分干净的原因。


2. 复现环境

一切都在专用网络(cve119618lab)上的 Podman 容器中运行。主机仅作为暂存区。

组件详情
基础镜像docker.io/library/debian:bookworm
APR1.7.4,从上游 tarball 构建
APR-util1.6.3,从上游 tarball 构建
httpd2.4.70(受影响)和 2.4.71(已修复),从上游 tarball 构建
mod_http2--enable-http2=shared,系统 nghttp2
插桩:vuln 中的 AddressSanitizer(-fsanitize=address),:tsan 中的 ThreadSanitizer(-fsanitize=thread)
MPMprefork,Protocols h2c http/1.1(明文 HTTP/2,无 TLS 材料)
限制每个容器都以 --cpus 2 --memory 4g 运行

两个 httpd 版本位于同一镜像中;HTTPD_VERSION 选择其中一个:

HTTPD_VERSION服务器根目录角色
vuln/opt/httpd-2.4.70受影响构建
fixed/opt/httpd-2.4.71已修复构建
下载工具