跳到主内容
@wquguru
精选90Caddy(GitHub Releases)客户端

Caddy v2.11.9:修复破坏性回归与多项FastCGI安全漏洞

v2.11.9

原文
发到 X
推荐理由

本次更新包含多项关键安全修复与破坏性变更(如 client_auth 静默丢弃、env 变量被覆盖),直接影响服务安全性与配置兼容性。PHP 用户必须升级以修复回归并规避漏洞。

This is a quick follow-up on top of 2.11.8, to fix a regression it introduced and a few more security issues, mostly in FastCGI. It contains only fixes backported from master, plus a couple of small additions. If you're on 2.11.8 and serve PHP, we recommend upgrading.

这是在 2.11.8 基础上的快速跟进版本,旨在修复其引入的回归问题以及若干其他安全问题,主要集中在 FastCGI 方面。此版本仅包含从 master 分支移植的修复程序,外加少量小功能增强。如果您正在使用 2.11.8 并托管 PHP,我们建议升级。

Huge thank you to our sponsors for keeping the project alive with resources, and for our maintainers who triage and assist tirelessly in this relentless new age of AI.

衷心感谢我们的赞助商以资源支持让项目得以延续,也感谢我们的维护者在 AI 这个 relentless 的新时代中不知疲倦地进行分类和协助。

Highlights

亮点

  • Fixed: PHP directory indexes (regression in 2.11.8). A request for a directory with a trailing slash, like /wp-admin/, was matched by the directory itself instead of its index.php, so it never reached PHP and usually got a 404. This broke WordPress admin pages and other apps that serve an index through a trailing-slash URL. A try_files pattern now only matches a directory when it ends in /. Thanks @dunglas! (#8352)
  • Path matchers with placeholders now work as expected: placeholders like {env.FOO} are no longer lower-cased into {env.foo} before they're looked up, and their values are compared case-insensitively against the request path, like static patterns. Thanks @BenMacha! (#8343)
  • New plain_time_format option for file_server browse: sets the time layout of plain-text directory listings (Accept: text/plain). Thanks @steffenbusch! (#8084)
  • Fewer allocations in path cleaning, header rewriting and weighted_round_robin selection. Thanks @jvoisin! (#7842)
  • For plugin authors: new httpcaddyfile.Helper.IsNamedRoute() tells a directive whether it's being parsed inside a named route. (#8354)
  • 已修复:PHP 目录索引(2.11.8 中的回归问题)。对带有尾部斜杠的目录的请求(例如 /wp-admin/)会被目录本身匹配,而不是其 index.php,导致请求从未到达 PHP 并通常返回 404。这破坏了 WordPress 管理页面以及其他通过尾部斜杠 URL 提供索引的应用程序。现在 try_files 模式仅在路径以 / 结尾时才匹配目录。感谢 @dunglas!(#8352)
  • 带有占位符的路径匹配器现在按预期工作:在查找之前,{env.FOO} 等占位符不再被转换为小写 {env.foo},并且它们的值与请求路径进行不区分大小写的比较,类似于静态模式。感谢 @BenMacha!(#8343)
  • file_server 浏览的新 plain_time_format 选项:设置纯文本目录列表的时间格式(Accept: text/plain)。感谢 @steffenbusch!(#8084)
  • 减少了路径清理、标头重写和 weighted_round_robin 选择中的内存分配次数。感谢 @jvoisin!(#7842)
  • 面向插件作者:新的 httpcaddyfile.Helper.IsNamedRoute() 可告知指令当前是否正在命名路由内解析。(#8354)

⚠️ Breaking changes

⚠️ 破坏性变更

  • Conflicting client_auth is now a Caddyfile error. When two site blocks share TLS connection policies for the same hostname but set different client_auth, the adapter used to keep the first one and silently drop the other, which could quietly remove a stricter mTLS requirement. (#8306)
  • FastCGI requests that are ambiguous about which script they run get 400:
  • when the escaped path (which %-containing path matchers see) and the decoded path would select different scripts, e.g. /public/tool.php%2f..%2f..%2fadmin%2ftool.php (#8357)
  • on Windows, script paths with an 8.3 short name component (like ADMINI~1) or a : (NTFS alternate data streams) (#8356)
  • FastCGI env values now take precedence over request headers, so a client can no longer override HTTP_* variables you set with env (see below). (#8358)
  • 冲突的 client_auth 现在被视为 Caddyfile 错误。当两个站点块为同一主机名共享 TLS 连接策略但设置了不同的 client_auth 时,适配器过去会保留第一个配置并静默丢弃另一个,这可能会悄无声息地移除更严格的 mTLS 要求。(#8306)
  • FastCGI 请求若无法明确确定运行哪个脚本,将返回 400:
  • 当转义后的路径(即 %-containing 路径匹配器看到的路径)和解码后的路径会选择不同的脚本时,例如 /public/tool.php%2f..%2f..%2fadmin%2ftool.php (#8357)
  • 在 Windows 上,脚本路径包含 8.3 短名称组件(如 ADMINI~1)或 :(NTFS 备用数据流)时 (#8356)
  • FastCGI 环境变量值现在优先于请求标头,因此客户端不能再覆盖您通过 env 设置的 HTTP_* 变量(见下文)。(#8358)

Security fixes

安全修复

Thank you to everyone who reported responsibly and helped with patches:

感谢所有负责任地报告问题并协助修补漏洞的人:

  • fastcgi: A client could override any HTTP_* variable set with the FastCGI transport's (or php_fastcgi's) env subdirective by sending a matching request header, for example choosing the user an application sees in HTTP_X_AUTH_USER. Configured values now win. Reported by @JebeenLee and @Camel4, fixed by @dunglas. (GHSA-q34h-28rj-5hjm, #8358)
  • fastcgi: On Windows, NTFS 8.3 short names and alternate data streams could run a script that a path rule was meant to deny, completing the FastCGI fix from 2.11.8. Thanks @dunglas. (GHSA-9cr8-wmhh-39pm, #8356)
  • fastcgi: Encoded slashes and dot segments could make a %-containing path matcher approve one script while another one runs. Thanks @dunglas. (#8357)
  • fastcgi: Over HTTP/2, a host field sent next to :authority could make the application see a different host (HTTP_HOST) than the one Caddy routed the request to. Thanks @dunglas. (#8355)
  • httpcaddyfile: A stricter client_auth could be silently dropped when merging TLS connection policies (see above). Thanks @sam-kota. (#8306)
  • Updated go-jose to v4.1.6 for GHSA-mgcc-cww5-fp2q. (#8299)
  • fastcgi:客户端可以通过发送匹配的请求头,覆盖由 FastCGI 传输(或 php_fastcgi)的 env 子指令设置的任何 HTTP_* 变量,例如选择应用程序在 HTTP_X_AUTH_USER 中看到的用户。现在配置的值的优先级更高。由 @JebeenLee 和 @Camel4 报告,@dunglas 修复。(GHSA-q34h-28rj-5hjm, #8358)
  • fastcgi:在 Windows 上,NTFS 8.3 短名称和备用数据流可能执行路径规则本应拒绝的脚本,从而完成了 2.11.8 中的 FastCGI 修复。感谢 @dunglas。(GHSA-9cr8-wmhh-39pm, #8356)
  • fastcgi:编码的斜杠和点段可能导致包含 % 的路径匹配器批准一个脚本,而另一个脚本正在运行。感谢 @dunglas。(#8357)
  • fastcgi:通过 HTTP/2,与 :authority 一起发送的主机字段可能使应用程序看到与 Caddy 路由请求到的主机不同的主机 (HTTP_HOST)。感谢 @dunglas。(#8355)
  • httpcaddyfile:当合并 TLS 连接策略时(见上文),更严格的 client_auth 可能会被静默丢弃。感谢 @sam-kota。(#8306)
  • 为 GHSA-mgcc-cww5-fp2q 将 go-jose 更新到 v4.1.6。(#8299)

⚠️ These security patches may be breaking if your application relies on the buggy behaviors.

⚠️ 如果您的应用程序依赖于存在缺陷的行为,这些安全补丁可能会导致破坏性变更。

🚨 Notice for Caddy plugin maintainers: Dependabot will probably alert you to the security fixes in Caddy and urge you to upgrade it in your go.mod file. Please ONLY upgrade the Caddy dependency if there's a change to an exported API your plugin uses.

🚨 致 Caddy 插件维护者的通知:Dependabot 可能会提醒您注意 Caddy 中的安全修复,并敦促您在 go.mod 文件中升级它。仅当您的插件使用的导出 API 发生更改时,才请升级 Caddy 依赖项。

What's Changed

已更改的内容

  • caddyhttp: lower-case path patterns with placeholders at request time by @BenMacha in #8343
  • httpcaddyfile: reject conflicting client_auth when merging TLS policies by @sam-kota in #8306
  • build(deps): bump the actions-deps group across 1 directory with 10 updates by @dependabot[bot] in #8340
  • build(deps): bump github.com/go-jose/go-jose/v4 from 4.1.5 to 4.1.6 by @dependabot[bot] in #8299
  • fileserver: make plain-text browse time format configurable by @steffenbusch in #8084
  • fileserver: only match a dir when the pattern ends by / by @dunglas in #8352
  • httpcaddyfile: add Helper.IsNamedRoute by @dunglas in #8354
  • fastcgi: take HTTP_HOST from the routed host only by @dunglas in #8355
  • fastcgi: reject Win 8.3 aliases and alt data streams paths by @dunglas in #8356
  • caddyhttp: presize buffers in hot paths to reduce allocations by @jvoisin in #7842
  • fastcgi: let configured env variables override request headers by @dunglas in #8358
  • fastcgi: reject paths whose escaped form selects another script by @dunglas in #8357
  • caddyhttp:按 @BenMacha 在 #8343 中提出的,在请求时对带有占位符的路径模式进行小写处理
  • httpcaddyfile:按 @sam-kota 在 #8306 中提出的,在合并 TLS 策略时拒绝冲突的 client_auth
  • build(deps):按 @dependabot[bot] 在 #8340 中提出的,跨 1 个目录使用 10 次更新提升 actions-deps 组
  • build(deps):按 @dependabot[bot] 在 #8299 中提出的,将 github.com/go-jose/go-jose/v4 从 4.1.5 提升到 4.1.6
  • fileserver:按 @steffenbusch 在 #8084 中提出的,使纯文本浏览时间格式可配置
  • fileserver:按 @dunglas 在 #8352 中提出的,仅当模式以 / 结尾时才匹配目录
  • httpcaddyfile:按 @dunglas 在 #8354 中提出的,添加 Helper.IsNamedRoute
  • fastcgi:按 @dunglas 在 #8355 中提出的,仅从路由的主机获取 HTTP_HOST
  • fastcgi:按 @dunglas 在 #8356 中提出的,拒绝 Win 8.3 别名和备用数据流路径
  • caddyhttp:按 @jvoisin 在 #7842 中提出的,在热路径中预分配缓冲区以减少内存分配
  • fastcgi:按 @dunglas 在 #8358 中提出的,让配置的 env 变量覆盖请求头
  • fastcgi:按 @dunglas 在 #8357 中提出的,拒绝其转义形式选择其他脚本的路径

Full Changelog: v2.11.8...v2.11.9

完整更新日志:v2.11.8...v2.11.9

更进一步:量化金融体系

看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力

进入量化体系 →

相似阅读

关联信息,但可能不是同一事件