diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index d92ebe4..322f77c 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -31,7 +31,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '20.19.0' + node-version-file: '.node-version' - name: Install pnpm run: npm install -g pnpm@10.28.1 @@ -54,7 +54,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: '1.23' + go-version-file: 'go-backend/go.mod' cache-dependency-path: go-backend/go.sum - name: Download dependencies @@ -89,7 +89,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: '1.23' + go-version-file: 'go-backend/go.mod' cache-dependency-path: go-backend/go.sum - name: Download dependencies @@ -112,7 +112,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: '1.23' + go-version-file: 'go-gost/go.mod' cache-dependency-path: go-gost/go.sum - name: Download dependencies diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 1abb921..f6b8874 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -79,7 +79,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '1.23' + go-version-file: 'go-gost/go.mod' - name: Cache Go modules uses: actions/cache@v4 @@ -197,7 +197,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '1.23' + go-version-file: 'go-backend/go.mod' - name: Cache Go dependencies uses: actions/cache@v4 diff --git a/.github/workflows/publish-skill.yml b/.github/workflows/publish-skill.yml index b7650ca..5858799 100644 --- a/.github/workflows/publish-skill.yml +++ b/.github/workflows/publish-skill.yml @@ -19,7 +19,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '20' + node-version-file: '.node-version' registry-url: 'https://registry.npmjs.org' - name: Get version from tag diff --git a/.node-version b/.node-version new file mode 100644 index 0000000..b8b23ca --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +22.23.4 diff --git a/AGENTS.md b/AGENTS.md index 9e1ea3e..cd770b3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -40,7 +40,8 @@ FLVX — traffic forwarding panel: Go admin API + Vite/React UI + Go agent. - **Backend DB**: handlers use Repository methods, never `repo.DB()` directly. - **GORM models**: always define `TableName()` (GORM pluralizes by default). - **GORM tags**: no `type:jsonb` or `type:serial` (SQLite incompatible). -- **Go versions**: `go.mod` says 1.25.0 for all three modules; CI builds with 1.23. +- **Go versions**: all three modules require Go 1.26.10 or newer (CVE-2026-111943); CI reads the module's `go.mod`. Do not use Go 1.27.0–1.27.2, which also lack this fix. +- **Node.js versions**: `.node-version` pins 22.23.4 for CI; local builds also support patched 24.22.1+ and 26.12.1+ (CVE-2026-111497). ## Anti-patterns diff --git a/README.md b/README.md index bf48598..7152950 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,12 @@ - 支持隧道修改配置、转发修改隧道 +## 构建环境 + +Go 后端和 agent 的最低编译版本为 **Go 1.26.10**;若使用 Go 1.27,须为 **1.27.3 或更新补丁版**。前端与 skill 发布使用 **Node.js 22.23.4**(见 `.node-version`),本地也支持 24.22.1+ 或 26.12.1+。前端使用 `pnpm@10.28.1`。 + +这些版本包含 2026 年 10 月的运行时安全修复。已有部署还需重新构建并更新后端镜像及所有 agent 二进制,详见 [安全排查与升级说明](docs/security/2026-10-runtime-updates.md)。 + ## 部署流程 --- ### Docker Compose部署 diff --git a/docs/security/2026-10-runtime-updates.md b/docs/security/2026-10-runtime-updates.md new file mode 100644 index 0000000..cda8ff5 --- /dev/null +++ b/docs/security/2026-10-runtime-updates.md @@ -0,0 +1,37 @@ +# 2026-10-22 运行时漏洞排查与升级 + +## 排查结论 + +| 漏洞 | 本项目涉及范围 | 修复措施 | +| --- | --- | --- | +| CVE-2026-109618、CVE-2026-109619(PHP RCE) | 仓库无 PHP 源码、Composer 依赖或 PHP 容器。项目后端为 Go,前端生产容器为 Nginx 静态服务。 | 本项目无 PHP 运行时需要更新;同机部署的其他 PHP 服务需单独排查。转发 PHP 网站的流量不会修复目标网站的 PHP。 | +| CVE-2026-111497(Node.js Brotli 越界写入) | 前端 Docker 构建使用 Node.js 22;CI 原使用已停止支持的 Node.js 20。Node.js 用于构建、开发及 skill 安装/发布,不是面板生产服务端。未发现项目源码直接调用 Brotli 解码,但构建依赖和下载工具仍运行于 Node.js。 | Docker、CI 和 `.node-version` 固定为 22.23.4;包声明仅接受已修复的 22.23.4+、24.22.1+、26.12.1+ 分支,前端启用 `engine-strict`。 | +| CVE-2026-111943(Go crypto/x509 中间证书信任) | 后端的版本检查、升级下载、授权验证等使用 HTTPS;agent 的更新下载、TLS 拨号和证书验证使用 Go 标准库。原 Go 1.25 工具链缺少此次拒绝信任修复。 | 三个 Go 模块最低版本升至 1.26.10,CI 从对应 `go.mod` 读取,后端 Docker 使用 1.26.10-bookworm。 | + +Go 漏洞涉及一组特定中间证书,并非拒绝所有包含八层中间证书的证书链。官方修复在 `crypto/x509.Certificate.Verify` 中拒绝包含这些证书的链。Go 1.27.0–1.27.2 也未修复;手动选择 Go 1.27 时必须使用 1.27.3+。`go.mod` 的最低版本无法排除该较新分支里的旧补丁版本,因此发布必须使用仓库固定的工具链。 + +## 让已部署实例获得修复 + +1. 使用本次修改后的构建配置发布新版本,重新构建后端及前端镜像、Linux amd64/arm64 agent。Go 标准库编译进二进制,仅更新宿主机 Go 或 `ca-certificates` 不会替换已有二进制中的标准库。已有镜像标签也不会因源码更新自动修复。 +2. 在面板实际部署目录,将 `.env` 中的 `FLUX_VERSION` 设置为包含本次修复的**已发布版本**,再执行 `docker compose pull backend frontend` 和 `docker compose up -d backend frontend`。如使用独立构建或私有仓库,应部署对应的新镜像。 +3. 将所有节点的 agent 更新为同一安全版本并重启服务,包括离线节点。使用解压后的构建产物执行 `go version -m /path/to/gost` 或 `go version -m /path/to/paneld`,核对构建版本为 go1.26.10(或已修复的更新版本);UPX 压缩可能需要先对副本解压以读取构建信息。 +4. 开发机和自托管构建机也需升级 Node.js。本次排查时本机为 v26.0.0,属于受影响版本;应升级至 26.12.1+,或切换到 `.node-version` 的 22.23.4。无需在运行静态前端的 Nginx 容器内安装 Node.js。 + +本次代码修改不表示远端部署已经更新;须完成新版本发布、镜像替换与节点升级后,才能确认线上获得修复。更新系统 CA 信任包可作为额外措施,但不能替代 Go 二进制重建。 + +## 本次验证 + +- Go 1.26.10 下,`go-backend`、`go-gost`、`go-gost/x` 各自的 `go test ./...` 全部通过。PostgreSQL 外部数据库契约测试仍需配置 `FLVX_POSTGRES_TEST_DSN` 后单独执行。 +- Node.js 22.23.4、pnpm 10.28.1 下,前端 `pnpm install --frozen-lockfile` 与 `pnpm run build` 通过,无需更改依赖锁文件。 +- 本机 Node.js 26.0.0 执行前端构建时,被 `engine-strict` 拒绝。 +- 使用 `CGO_ENABLED=0` 交叉编译后端和 agent 的 Linux amd64/arm64 共四个二进制成功;`go version -m` 确认均为 go1.26.10。 +- Docker Hub 上两个固定构建镜像标签均存在,且包含 Linux amd64/arm64。未执行 Docker 镜像构建或线上部署。 +- 工作流 YAML、包 JSON 解析及 `git diff --check` 通过。 + +## 官方依据 + +- [PHP 官方安全公告](https://www.php.net/archive/2026.php#2026-10-21-4) +- [Node.js 2026-10-21 安全更新及修复版本](https://nodejs.org/en/blog/vulnerability/october-2026-security-releases) +- [Go 官方问题 #82345](https://go.dev/issue/82345) +- [Go 漏洞库 GO-2026-6809](https://pkg.go.dev/vuln/GO-2026-6809) +- [Go 官方发布记录](https://go.dev/doc/devel/release) diff --git a/go-backend/Dockerfile b/go-backend/Dockerfile index 35b65f6..d7d11db 100644 --- a/go-backend/Dockerfile +++ b/go-backend/Dockerfile @@ -1,4 +1,5 @@ -FROM golang:1.25-bookworm AS builder +# CVE-2026-111943: crypto/x509 is linked into paneld; rebuild with the fixed Go release. +FROM golang:1.26.10-bookworm AS builder WORKDIR /src COPY go.mod go.sum ./ diff --git a/go-backend/go.mod b/go-backend/go.mod index 35f8637..893fb15 100644 --- a/go-backend/go.mod +++ b/go-backend/go.mod @@ -1,6 +1,6 @@ module go-backend -go 1.25.0 +go 1.26.10 require ( github.com/fxamacker/cbor/v2 v2.9.0 diff --git a/go-gost/go.mod b/go-gost/go.mod index dd63b06..6b4eba2 100644 --- a/go-gost/go.mod +++ b/go-gost/go.mod @@ -1,6 +1,6 @@ module github.com/go-gost/gost -go 1.25.0 +go 1.26.10 require ( github.com/go-gost/core v0.3.1 diff --git a/go-gost/x/go.mod b/go-gost/x/go.mod index cceb11b..a373b99 100644 --- a/go-gost/x/go.mod +++ b/go-gost/x/go.mod @@ -1,6 +1,6 @@ module github.com/go-gost/x -go 1.25.0 +go 1.26.10 require github.com/shirou/gopsutil/v3 v3.24.5 diff --git a/skills/flvx-api/package.json b/skills/flvx-api/package.json index 360731b..e981df8 100644 --- a/skills/flvx-api/package.json +++ b/skills/flvx-api/package.json @@ -1,6 +1,9 @@ { "name": "@flvx/skill-api", "version": "2.1.9-rc4", + "engines": { + "node": "^22.23.4 || ^24.22.1 || ^26.12.1" + }, "description": "Skill for AI assistants to operate FLVX panel via REST API. Supports OpenCode, OpenClaw, Claude Code.", "keywords": [ "opencode", diff --git a/vite-frontend/.npmrc b/vite-frontend/.npmrc index 1e54ebc..08289de 100644 --- a/vite-frontend/.npmrc +++ b/vite-frontend/.npmrc @@ -1 +1,2 @@ -package-lock=true \ No newline at end of file +package-lock=true +engine-strict=true diff --git a/vite-frontend/Dockerfile b/vite-frontend/Dockerfile index c366367..4f6c3dc 100644 --- a/vite-frontend/Dockerfile +++ b/vite-frontend/Dockerfile @@ -1,5 +1,6 @@ # 多阶段构建 - 构建阶段 -FROM --platform=$BUILDPLATFORM node:22-alpine AS builder +# CVE-2026-111497: use the patched Node.js Brotli decoder during builds. +FROM --platform=$BUILDPLATFORM node:22.23.4-alpine AS builder WORKDIR /app diff --git a/vite-frontend/package.json b/vite-frontend/package.json index bb7c878..2f445c6 100644 --- a/vite-frontend/package.json +++ b/vite-frontend/package.json @@ -3,6 +3,9 @@ "private": true, "version": "0.0.0", "packageManager": "pnpm@10.28.1", + "engines": { + "node": "^22.23.4 || ^24.22.1 || ^26.12.1" + }, "type": "module", "scripts": { "dev": "vite",