mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-11-13 00:14:22 +08:00
fix(security): require patched Go and Node.js runtimes (#566)
This commit is contained in:
@@ -31,7 +31,7 @@ jobs:
|
|||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '20.19.0'
|
node-version-file: '.node-version'
|
||||||
|
|
||||||
- name: Install pnpm
|
- name: Install pnpm
|
||||||
run: npm install -g pnpm@10.28.1
|
run: npm install -g pnpm@10.28.1
|
||||||
@@ -54,7 +54,7 @@ jobs:
|
|||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.23'
|
go-version-file: 'go-backend/go.mod'
|
||||||
cache-dependency-path: go-backend/go.sum
|
cache-dependency-path: go-backend/go.sum
|
||||||
|
|
||||||
- name: Download dependencies
|
- name: Download dependencies
|
||||||
@@ -89,7 +89,7 @@ jobs:
|
|||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.23'
|
go-version-file: 'go-backend/go.mod'
|
||||||
cache-dependency-path: go-backend/go.sum
|
cache-dependency-path: go-backend/go.sum
|
||||||
|
|
||||||
- name: Download dependencies
|
- name: Download dependencies
|
||||||
@@ -112,7 +112,7 @@ jobs:
|
|||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.23'
|
go-version-file: 'go-gost/go.mod'
|
||||||
cache-dependency-path: go-gost/go.sum
|
cache-dependency-path: go-gost/go.sum
|
||||||
|
|
||||||
- name: Download dependencies
|
- name: Download dependencies
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ jobs:
|
|||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.23'
|
go-version-file: 'go-gost/go.mod'
|
||||||
|
|
||||||
- name: Cache Go modules
|
- name: Cache Go modules
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
@@ -197,7 +197,7 @@ jobs:
|
|||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.23'
|
go-version-file: 'go-backend/go.mod'
|
||||||
|
|
||||||
- name: Cache Go dependencies
|
- name: Cache Go dependencies
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ jobs:
|
|||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version-file: '.node-version'
|
||||||
registry-url: 'https://registry.npmjs.org'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
|
||||||
- name: Get version from tag
|
- name: Get version from tag
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
22.23.4
|
||||||
@@ -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.
|
- **Backend DB**: handlers use Repository methods, never `repo.DB()` directly.
|
||||||
- **GORM models**: always define `TableName()` (GORM pluralizes by default).
|
- **GORM models**: always define `TableName()` (GORM pluralizes by default).
|
||||||
- **GORM tags**: no `type:jsonb` or `type:serial` (SQLite incompatible).
|
- **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
|
## Anti-patterns
|
||||||
|
|
||||||
|
|||||||
@@ -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部署
|
### Docker Compose部署
|
||||||
|
|||||||
@@ -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)
|
||||||
@@ -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
|
WORKDIR /src
|
||||||
|
|
||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
module go-backend
|
module go-backend
|
||||||
|
|
||||||
go 1.25.0
|
go 1.26.10
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/fxamacker/cbor/v2 v2.9.0
|
github.com/fxamacker/cbor/v2 v2.9.0
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
module github.com/go-gost/gost
|
module github.com/go-gost/gost
|
||||||
|
|
||||||
go 1.25.0
|
go 1.26.10
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/go-gost/core v0.3.1
|
github.com/go-gost/core v0.3.1
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
module github.com/go-gost/x
|
module github.com/go-gost/x
|
||||||
|
|
||||||
go 1.25.0
|
go 1.26.10
|
||||||
|
|
||||||
require github.com/shirou/gopsutil/v3 v3.24.5
|
require github.com/shirou/gopsutil/v3 v3.24.5
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "@flvx/skill-api",
|
"name": "@flvx/skill-api",
|
||||||
"version": "2.1.9-rc4",
|
"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.",
|
"description": "Skill for AI assistants to operate FLVX panel via REST API. Supports OpenCode, OpenClaw, Claude Code.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"opencode",
|
"opencode",
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
package-lock=true
|
package-lock=true
|
||||||
|
engine-strict=true
|
||||||
|
|||||||
@@ -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
|
WORKDIR /app
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"packageManager": "pnpm@10.28.1",
|
"packageManager": "pnpm@10.28.1",
|
||||||
|
"engines": {
|
||||||
|
"node": "^22.23.4 || ^24.22.1 || ^26.12.1"
|
||||||
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
Reference in New Issue
Block a user