Skip to content

Commit c2486da

Browse files
ding113claude
andauthored
fix(security): 升级 Node.js 运行时修复 CVE-2026-111497,前后端依赖升级到最新版本 (#1514)
Node.js 2026 年 10 月安全更新修复了 Brotli 解码越界写入漏洞 CVE-2026-111497(高危,可远程执行代码), 影响 22.x / 24.x / 26.x。CCH 在鉴权之前解压入站 `content-encoding: br` 请求体,因此必须运行包含修复的 Node。 运行时 - 生产镜像、开发镜像与根 Dockerfile 统一固定为 node:26.12.1-trixie-slim,Bun 固定为 1.4.3 - package.json engines 收紧为 ^22.23.4 || ^24.22.1 || >=26.12.1 - 新增 .node-version,dev / pr-check / release 工作流的 setup-node 统一读取该文件 - Dockerfile 契约测试校验所有 Node 镜像与 .node-version 一致且满足修复版本范围 依赖 - 全部前后端依赖升级到最新版本:Next.js 16.4.2、React 19.3.1、undici 8.12.3、Hono 4.13.13、 Langfuse SDK 6、Vitest 5、Biome 2.6、happy-dom 21、@lobehub/ui 6、@lobehub/icons 6、 @bull-board 9、framer-motion 14、dotenv 18 等 - @opentelemetry/sdk-node 使用 0.223.0:Langfuse 6 的 span processor 以 OTel 2.x (@opentelemetry/sdk-trace-base ^2)为 peer,0.300.0 已切换到 OTel 3.x - typescript 保持 6.0.3:openapi-typescript 7.13.0 仍依赖 TypeScript JS compiler API, TypeScript 7 不提供该 API;类型检查使用 tsgo 与 typescript-7 - 补充直接依赖 swr(大屏页面使用,此前由 antd 间接带入)与 @lobehub/fluent-emoji 5(@lobehub/ui 6 的 peer) 适配 - Next.js 16.4 要求每个 page 都有根 layout:根路径改为 src/app/route.ts,按语言 cookie 跳转到 dashboard - Langfuse 6 按 JSON 编码后的长度校验传播的 metadata,超过 200 字符会整个丢弃, 截断逻辑改为按编码后长度计算 - Biome 2.6 新增推荐规则 noComponentHookFactories / useMathMinMax:组件与 hook 移到模块级, 测试中的构造函数 mock 改为小写命名 - Vitest 5 移除 describe.sequential,改为 { concurrent: false };next-intl 交给 Vite 解析 next/navigation 验证 - bun run build / lint / format:check / typecheck / openapi:check / openapi:lint / validate:migrations 通过 - bun run test:924 个文件、9407 个测试全部通过(本机负载过高,使用 --testTimeout=120000 运行) - 集成测试(PostgreSQL + Redis):11 个文件、93 个测试通过 - 本地构建 deploy/Dockerfile 镜像,容器内 Node 为 v26.12.1,用真实 PostgreSQL 与 Redis 启动, 验证迁移、登录、仪表盘、供应商与日志页面、管理 API、OpenAPI 与 Scalar、br / zstd 请求体以及损坏的 br 请求体 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 7436438 commit c2486da

48 files changed

Lines changed: 602 additions & 396 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.bun-version‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.3.10
1+
1.4.3

‎.github/workflows/dev.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
- name: Setup Node.js for formatting
5959
uses: actions/setup-node@v6
6060
with:
61-
node-version: "20"
61+
node-version-file: .node-version
6262

6363
- name: Setup Bun
6464
uses: oven-sh/setup-bun@v2

‎.github/workflows/pr-check.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: 🟢 Setup Node.js
3232
uses: actions/setup-node@v6
3333
with:
34-
node-version: '22'
34+
node-version-file: .node-version
3535

3636
- name: Cache Bun package cache
3737
uses: actions/cache@v5

‎.github/workflows/release.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ jobs:
193193
if: steps.check.outputs.needs_bump == 'true' || github.event_name == 'workflow_dispatch'
194194
uses: actions/setup-node@v6
195195
with:
196-
node-version: "20"
196+
node-version-file: .node-version
197197

198198
- name: Setup Bun
199199
if: steps.check.outputs.needs_bump == 'true' || github.event_name == 'workflow_dispatch'

‎.node-version‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
26.12.1

‎CHANGELOG.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@
3535
重试切商并计入供应商熔断的问题:门控、Discovery 竞速、非流式空响应检测与 fake-streaming 校验统一把 refusal
3636
视为可交付结果原样透传;门控本地错误体与日志新增上游真实状态 `upstream_status_code` 与熔断计入标记 (#1491)
3737

38+
### 安全
39+
40+
- 修复 Node.js Brotli 解码越界写入漏洞 CVE-2026-111497(高危,可远程执行代码):入站 `content-encoding: br`
41+
请求体在鉴权前解压,生产镜像运行时固定为包含修复的 `node:26.12.1-trixie-slim`,`package.json` engines 收紧为
42+
`^22.23.4 || ^24.22.1 || >=26.12.1`,CI 统一从 `.node-version` 读取 Node 版本;Bun 升级到 1.4.3
43+
- 前后端依赖全部升级到最新版本,包括 Next.js 16.4.2、React 19.3.1、undici 8.12.3、Hono 4.13.13、
44+
Langfuse SDK 6、OpenTelemetry SDK 0.223、Vitest 5、Biome 2.6、happy-dom 21、@lobehub/ui 6 与 @lobehub/icons 6
45+
3846
---
3947

4048
## v0.8.7 (2026-06-14)

‎Dockerfile‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# syntax=docker/dockerfile:1
2-
FROM oven/bun:debian AS deps
2+
FROM oven/bun:1.4.3-debian AS deps
33
WORKDIR /app
44
COPY package.json ./
55
RUN bun install
66

7-
FROM oven/bun:debian AS builder
7+
FROM oven/bun:1.4.3-debian AS builder
88
WORKDIR /app
99
COPY --from=deps /app/node_modules ./node_modules
1010
COPY . .
1111
ENV NEXT_TELEMETRY_DISABLED=1
1212
ENV CI=true
1313
RUN --mount=type=cache,target=/app/.next/cache bun run build
1414

15-
FROM node:22-slim AS runner
15+
FROM node:26.12.1-trixie-slim AS runner
1616
WORKDIR /app
1717
ENV NODE_ENV=production
1818
ENV PORT=3000

‎README.en.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Register now via <a href="https://pateway.ai/?ch=1ycdoum&aff=T8FV5H42">this link
114114
### Requirements
115115

116116
- Docker and Docker Compose (latest version recommended)
117-
- Optional (for local development): Node.js ≥ 22.15 (inbound zstd request-body decompression uses native `node:zlib` zstd), Bun ≥ 1.3
117+
- Optional (for local development): Node.js 22.23.4+ / 24.22.1+ / 26.12.1+ (inbound request-body decompression uses native `node:zlib`; these releases fix the Brotli decoder out-of-bounds write CVE-2026-111497), Bun ≥ 1.4.3
118118

119119
### 🚀 One-Click Deployment Script (✨ Recommended - Fully Automated)
120120

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ AIGoCode 为 CCH 的用户提供了特别福利,通过此链接注册的用户
114114
### 环境要求
115115

116116
- Docker 与 Docker Compose(推荐使用最新版本)
117-
- 可选(本地开发):Node.js ≥ 22.15(入站请求体 zstd 解压依赖原生 `node:zlib` zstd),Bun ≥ 1.3
117+
- 可选(本地开发):Node.js 22.23.4+ / 24.22.1+ / 26.12.1+(入站请求体解压依赖原生 `node:zlib`,这些版本包含 Brotli 解码越界写入漏洞 CVE-2026-111497 的修复),Bun ≥ 1.4.3
118118

119119
### 🚀 一键部署脚本(✨ 推荐方式,全自动安装)
120120

‎biome.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.5.6/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.6.2/schema.json",
33
"vcs": {
44
"enabled": true,
55
"clientKind": "git",

0 commit comments

Comments
 (0)