最近,Express 团队已经注意到 Express 项目中存在一些安全漏洞。我们已经发布了多项补丁来解决这些漏洞。
🌐 Recently, the Express team has been made aware of a number of security vulnerabilities in the Express project. We have released a number of patches to address these vulnerabilities.
Warning
我们强烈建议你尽快将这些模块升级到推荐(或最新)版本。
以下漏洞已被修复:
🌐 The following vulnerabilities have been addressed:
- body-parser 中间件的高严重性漏洞 CVE-2024-45590
- 基本认证连接中间件中的高严重性漏洞 CVE-2024-47178
- Express 核心中的中等严重性漏洞 CVE-2024-43796
- 发送实用程序模块中的中等严重性漏洞 CVE-2024-43799
- serve-static 中间件中的中等严重性漏洞 CVE-2024-43800
- 路径到正则表达式工具模块中的中等严重性漏洞 CVE-2024-45296
body-parser 中间件中的高严重性漏洞 CVE-2024-45590
🌐 High severity vulnerability CVE-2024-45590 in body-parser middleware
body-parser 版本 <1.20.3 在启用 URL 编码时易受到拒绝服务攻击
恶意行为者使用特别制作的有效负载可能会向服务器发送大量请求,从而导致服务拒绝。
🌐 A malicious actor using a specially-crafted payload could flood the server with a large number of requests, resulting in denial of service.
受影响的版本:<1.20.3
修补版本:>=1.20.3
这个漏洞是在OSTIF对Express的审计期间发现的,并已由Express安全分流团队进行缓解。
🌐 This vulnerability was discovered during the OSTIF audit to Express and was mitigated by the Express security triage team.
欲了解更多详情,请参见 GHSA-qwcr-r2fm-qrc7。
🌐 For more details, see GHSA-qwcr-r2fm-qrc7.
basic-auth-connect 中间件中高严重性漏洞 CVE-2024-47178
🌐 High severity vulnerability CVE-2024-47178 in basic-auth-connect middleware
basic-auth-connect 使用了时序不安全的等值比较
basic-auth-connect <1.1.0 使用不安全的时间比较来进行相等性比较,这可能会泄露时间信息
🌐 basic-auth-connect <1.1.0 uses a timing-unsafe equality comparison that can leak timing information
受影响的版本
<1.1.0
已修补版本
>=1.1.0
这个漏洞是在OSTIF对Express的审计期间发现的,并已由Express安全分流团队进行缓解。
🌐 This vulnerability was discovered during the OSTIF audit to Express and was mitigated by the Express Security triage team.
更多详细信息可在 GHSA-7p89-p6hx-q4fw 获取
🌐 More details area available in GHSA-7p89-p6hx-q4fw
Express 核心中的中等严重性漏洞 CVE-2024-43796
🌐 Moderate severity vulnerability CVE-2024-43796 in Express core
核心 express 包易受通过 response.redirect() 的跨站脚本 (XSS) 攻击。
🌐 The core express package is vulnerable to cross-site scripting (XSS) attack via response.redirect().
在 Express 版本 <4.20.0 中,将不受信任的用户输入传递给 response.redirect()——即使在清理之后——也可能执行不受信任的代码。
🌐 In Express version <4.20.0, passing untrusted user input—even after sanitizing it—to response.redirect() may execute untrusted code.
受影响的版本:
<4.20.0>=5.0.0-alpha.1,<5.0.0
已修补版本:
>=4.20.0>=5.0.0
这一漏洞是在OSTIF对Express的审计期间发现的,并已由Express安全分流团队进行缓解。
🌐 This vulnerability was discovered during the OSTIF audit of Express and was mitigated by the Express security triage team.
有关更多详情,请参见 GHSA-qw6h-vgh9-j6wx。
🌐 For more details, see GHSA-qw6h-vgh9-j6wx.
发送工具模块中的中等严重性漏洞 CVE-2024-43799
🌐 Moderate severity vulnerability CVE-2024-43799 in send utility module
send 实用模块存在模板注入漏洞,可能导致跨站脚本(XSS)攻击漏洞。
🌐 The send utility module is vulnerable to template injection that can lead to vulnerability to cross-site scripting (XSS) attack.
将不受信任的用户输入——即使在清理之后——传递给 SendStream.redirect() 可能会执行不受信任的代码。
🌐 Passing untrusted user input—even after sanitizing it—to SendStream.redirect() can execute untrusted code.
受影响的版本:< 0.19.0
修补版本:>=0.19.0
这一漏洞是在OSTIF对Express的审计期间发现的,并已由Express安全分流团队进行缓解。
🌐 This vulnerability was discovered during the OSTIF audit of Express and was mitigated by the Express security triage team.
更多详情,请参见 GHSA-m6fv-jmcg-4jfg。
🌐 For more details, see GHSA-m6fv-jmcg-4jfg.
serve-static 中间件中的中等严重性漏洞 CVE-2024-43800
🌐 Moderate severity vulnerability CVE-2024-43800 in serve-static middleware
serve-static 中间件模块容易受到模板注入攻击,从而导致跨站脚本(XSS)攻击的漏洞。
🌐 The serve-static middleware module is vulnerable to template injection that can lead to vulnerability to cross-site scripting (XSS) attack.
将不受信任的用户输入——即使在清理之后——传递给 redirect() 可能会执行不受信任的代码。
🌐 Passing untrusted user input—even after sanitizing it—to redirect() can execute untrusted code.
受影响的版本:
< 1.16.0>=2.0.0,<2.1.0
已修补版本:
>=1.16.0>=2.1.0
这一漏洞是在OSTIF对Express的审计期间发现的,并已由Express安全分流团队进行缓解。
🌐 This vulnerability was discovered during the OSTIF audit of Express and was mitigated by the Express security triage team.
欲了解更多详情,请参见 GHSA-cm22-4g7w-348p
🌐 For more details, see GHSA-cm22-4g7w-348p
path-to-regexp 工具模块中的中等严重性漏洞 CVE-2024-45296
🌐 Moderate severity vulnerability CVE-2024-45296 in path-to-regexp utility module
path-to-regexp 工具模块容易受到正则表达式拒绝服务(ReDoS)攻击。
🌐 The path-to-regexp utility module is vulnerable to regular expression denial of service (ReDoS) attack.
每当你在单个段中有两个参数,并且用非句点(.)的东西分隔时,就会生成一个错误的正则表达式(.)。例如,/:a-:b。
🌐 A bad regular expression is generated any time you have two parameters within a single segment, separated by something that is not a period (.). For example, /:a-:b.
使用 /:a-:b 会生成正则表达式 /^\/([^\/]+?)-([^\/]+?)\/?$/。这可以被像 /a${'-a'.repeat(8_000)}/a 这样的路径利用。OWASP 提供了一个很好的示例说明为何会发生这种情况,但本质上,末尾的 /a 确保该路由永远不会匹配,但由于天真的回溯机制,它仍会尝试重复 8,000 个 -a 上所有 :a-:b 的组合。
🌐 Using /:a-:b will produce the regular expression /^\/([^\/]+?)-([^\/]+?)\/?$/. This can be exploited by a path such as /a${'-a'.repeat(8_000)}/a. OWASP has a good example of why this occurs, but in essence, the /a at the end ensures this route would never match, but due to naive backtracking it will still attempt every combination of the :a-:b on the repeated 8,000 -a.
因为 JavaScript 是单线程的,而正则表达式匹配在主线程上运行,所以性能不佳会阻塞事件循环,并可能导致拒绝服务(DoS)。在本地基准测试中,利用不安全的正则表达式会导致性能比安全的正则表达式差 1000 倍以上。在更现实的环境中,使用 Express v4 和十个并发连接时,平均延迟约为 600 毫秒,而安全正则为 1 毫秒。
🌐 Because JavaScript is single-threaded and regex matching runs on the main thread, poor performance will block the event loop and can lead to a DoS. In local benchmarks, exploiting the unsafe regex will result in performance that is over 1000x worse than the safe regex. In a more realistic environment, using Express v4 and ten concurrent connections results in an average latency of ~600ms vs 1ms.
受影响的版本:
>=4.0.0,<8.0.0>=0.2.0,<1.9.0<0.1.10>=2.0.0,<3.3.0>=4.0.0,<6.3.0
已修补版本:
>=8.0.0>=1.9.0>=0.1.10>=3.3.0>=6.3.0
感谢 Blake Embrey 报告并创建了安全补丁。
🌐 Thanks to Blake Embrey who reported and created the security patch.
欲了解更多详情,请参见 GHSA-9wv6-86v2-598j
🌐 For more details, see GHSA-9wv6-86v2-598j



