• 2026年10月31日 星期六

近期公开的 Linux 内核漏洞 CVE-2026-98432 影响所有对公网开放 TCP 端口(如 SSH、代理、网站)的 Linux 系统,攻击者无需账号密码即可远程利用。该漏洞存在于内核本身,更换端口或加强密码都不能避免。Windows 系统不受影响。

请尽快按下面步骤处理您的 VPS。全程只需复制整段命令粘贴到 SSH 终端并回车,大约 2 分钟。

第 1 步:以 root 登录 VPS,查看系统版本

cat /etc/os-release | head -n 2

显示 Debian 请执行第 2 步,显示 Ubuntu 请执行第 3 步。

第 2 步:Debian 12 / 13 — 官方已发布修复,升级后重启即可

apt-get update && apt-get full-upgrade -y && reboot

重启完成即已修复(Debian 12 修复版本 6.1.190-1,Debian 13 修复版本 6.12.113-1),无需其他操作。

第 3 步:Ubuntu 22.04 / 24.04 — 官方修复尚未进入正式更新源,先启用临时防护

以下命令会让系统丢弃携带 IPv4 选项的 TCP 连接请求,这正是该漏洞的触发条件。正常的 SSH、网站、代理等访问不使用该选项,不受任何影响。防护开机自动生效,一次执行即可。

apt-get update && apt-get install -y nftables
mkdir -p /etc/nftables.d
cat >/etc/nftables.d/cve-2026-98432.nft <<'EOF'
table inet cve_2026_98432 {
  chain input {
    type filter hook input priority -310; policy accept;
    ip protocol tcp ip hdrlength > 5 counter drop
  }
}
EOF
cat >/etc/systemd/system/cve-2026-98432-nft.service <<'EOF'
[Unit]
Description=CVE-2026-98432 temporary mitigation
After=network-pre.target
Wants=network-pre.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/nft -f /etc/nftables.d/cve-2026-98432.nft
ExecStop=/usr/sbin/nft delete table inet cve_2026_98432

[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable --now cve-2026-98432-nft.service
nft list table inet cve_2026_98432

最后一行输出中出现 ip protocol tcp ip hdrlength > 5 counter 即表示防护已生效。

如果您希望逐条执行、了解每一步的作用,可以按下面顺序操作,效果与上面整段命令相同:

(1)安装 nftables 防火墙工具:

apt-get update && apt-get install -y nftables

(2)创建规则文件,内容为丢弃携带 IPv4 选项的 TCP 报文:

mkdir -p /etc/nftables.d
cat >/etc/nftables.d/cve-2026-98432.nft <<'EOF'
table inet cve_2026_98432 {
  chain input {
    type filter hook input priority -310; policy accept;
    ip protocol tcp ip hdrlength > 5 counter drop
  }
}
EOF

(3)创建 systemd 服务,让规则在每次开机时自动加载:

cat >/etc/systemd/system/cve-2026-98432-nft.service <<'EOF'
[Unit]
Description=CVE-2026-98432 temporary mitigation
After=network-pre.target
Wants=network-pre.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/nft -f /etc/nftables.d/cve-2026-98432.nft
ExecStop=/usr/sbin/nft delete table inet cve_2026_98432

[Install]
WantedBy=multi-user.target
EOF

(4)启用服务并立即加载规则:

systemctl daemon-reload
systemctl enable --now cve-2026-98432-nft.service

(5)确认规则已生效:

nft list table inet cve_2026_98432

第 4 步:Ubuntu 用户请关注官方内核更新

请留意 Ubuntu 官方发布的内核安全更新,并保持系统及时更新。当官方内核更新说明已修复 CVE-2026-98432 时,执行以下命令升级并重启,再移除临时防护:

apt-get update && apt-get full-upgrade -y && reboot

重启后执行:

systemctl disable --now cve-2026-98432-nft.service

使用 Socks-VPS 的客户:v1.5.0 已为 SOCKS 端口内置同样的防护,请执行 sudo socks-vpsctl update 更新;SSH 等其他端口仍请按上述步骤处理。

如在操作中遇到任何问题,欢迎随时提交工单联系我们。

Thank you for your business,
NovixLink