支持本站 — 捐款将帮助我们持续运营

目标:1000 元,已筹:736

73.6%
一、 漏洞 CVE-2026-22037 基础信息
漏洞信息
                                        # Fastify Express URL编码处理漏洞

## 概述
@fastify/express 插件在版本 4.0.3 之前存在路径绕过漏洞,攻击者可通过 URL 编码字符(如 `/%61dmin`)绕过中间件安全限制。

## 影响版本
@fastify/express < 4.0.3

## 细节
该漏洞源于 @fastify/express 在匹配中间件路径时未正确处理 URL 编码字符。当请求路径包含编码字符(如 `%61` 代表 `a`)时,中间件引擎因路径未匹配而跳过执行,但底层 Fastify 路由器在解码后仍能匹配目标路由,导致中间件(如鉴权逻辑)被绕过。

## 影响
攻击者可利用此漏洞绕过依赖中间件实施的安全控制,访问本应受保护的端点,可能导致未授权访问或敏感操作。
                                        
神龙判断

是否为 Web 类漏洞: 未知

判断理由:

N/A
提示
尽管我们采用了先进的大模型技术,但其输出仍可能包含不准确或过时的信息。
神龙会尽力确保数据准确,但也请结合实际情况进行甄别与判断。
神龙祝您一切顺利!
漏洞标题
@fastify/express vulnerable to Improper Handling of URL Encoding (Hex Encoding)
来源:美国国家漏洞数据库 NVD
漏洞描述信息
The @fastify/express plugin adds full Express compatibility to Fastify. A security vulnerability exists in @fastify/express prior to version 4.0.3 where middleware registered with a specific path prefix can be bypassed using URL-encoded characters (e.g., `/%61dmin` instead of `/admin`). While the middleware engine fails to match the encoded path and skips execution, the underlying Fastify router correctly decodes the path and matches the route handler, allowing attackers to access protected endpoints without the middleware constraints. The vulnerability is caused by how @fastify/express matches requests against registered middleware paths. This vulnerability is similar to, but differs from, CVE-2026-22031 because this is a different npm module with its own code. Version 4.0.3 of @fastify/express contains a patch fort the issue.
来源:美国国家漏洞数据库 NVD
CVSS信息
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:L
来源:美国国家漏洞数据库 NVD
漏洞类别
URL编码处理不恰当(Hex编码)
来源:美国国家漏洞数据库 NVD
二、漏洞 CVE-2026-22037 的公开POC
#POC 描述源链接神龙链接
三、漏洞 CVE-2026-22037 的情报信息
  • 标题: Improper Handling of URL Encoding (Hex Encoding) in @fastify/express · Advisory · fastify/fastify-express · GitHub -- 🔗来源链接

    标签:x_refsource_CONFIRM

    神龙速读:
                                            ### 关键信息总结
    
    #### 漏洞概述
    - **名称**: Improper Handling of URL Encoding (Hex Encoding) in @fastify/express
    - **CVE ID**: CVE-2026-22037
    - **CVSS 评分**: 8.4/10
    - **严重性**: 高
    
    #### 影响版本
    - **受影响版本**: <=4.0.2
    - **已修复版本**: 4.0.3
    
    #### 漏洞细节
    - **描述**: 在 `@fastify/express` 中,注册具有特定路径前缀的中间件可以通过 URL 编码字符(如将 `/admin` 替换为 `/%61dmin`)来绕过中间件的路径匹配,导致中间件执行被跳过,底层 Fastify 路由器正确解码路径并匹配到路由处理程序,使攻击者能够访问受保护的端点,而不需要通过中间件的约束。
    
    #### 计算机漏洞的原因
    - 在 `@fastify/express` 中,路径匹配机制没有正确处理 URL 编码字符,这导致路径编码后的路径无法被正确匹配,使得通过编码来绕过特定路径的访问控制成为可能。
    
    #### 示例代码与证明
    - 提供了使用 `@fastify/express` 框架配置的示例应用程序,并演示了攻击者如何通过 URL 编码绕过保护措施的技术性步骤。
    - 展示了利用该漏洞的请求与结果,表明保护的 `/admin` 路径可以被绕过访问。
    
    #### 相关标识
    - **弱点**: CWE-177, CWE-288
    - **报告者**: rootxharsh
    - **修复验证**: Eomm
    - **修复开发者**: mcollina
                                            
    Improper Handling of URL Encoding (Hex Encoding) in @fastify/express · Advisory · fastify/fastify-express · GitHub
  • 标题: fix: decode paths before matching (#174) · fastify/fastify-express@dc02a3f · GitHub -- 🔗来源链接

    标签:x_refsource_MISC

    神龙速读:
                                            - **漏洞类型**: URL-encoded paths bypass middleware
    - **漏洞描述**: URL-encoded paths (如 /%61dmin) 能够绕过中间件检查。虽然中间件注册在 /admin 上,但通过 URL-encode 的路径可以绕过它们。
    - **解决方法**: 在 Express 匹配中间件之前使用 `FindMyWay.sanitizeUrlPath()` 来解码 URL,以防止编码路径绕过。
    - **相关提交**: #174, #245, #175
    - **依赖更新**: 
        - `fastify-plugin`: 从 ^5.0.0 升级到 ^5.0.0
        - 新增 `find-my-way`: ^9.4.0
    - **测试更新**: 
        - 增加了测试用例,确保编码路径能够被正确解码并运行中间件
        - 确保没有双次解码 URL
        - 确保 Expres 处理程序能够正确处理解码
    - **提交作者**: mcollina, Eomm, Manuel Spigolon
                                            
    fix: decode paths before matching (#174) · fastify/fastify-express@dc02a3f · GitHub
  • https://nvd.nist.gov/vuln/detail/CVE-2026-22037
四、漏洞 CVE-2026-22037 的评论

暂无评论


发表评论