abraxaslabs.tech · github.com/abraxas · @abraxas_null · [email protected] · opnsense-ntp-gps-fudge
类别: 配置行注入 可达性: 远程
OPNsense 核心 26.7.6 (a842fe48) - opnsense.org
GHSA-fq94 的遗留问题。在 timeserver 主机被剥离后,GPS/PPS 的 fudge1 / fudge2 / refid 仍会拼接进 /var/etc/ntpd.conf。CVE-2026-53581 路径覆盖已被加入允许列表(^cua[a-z0-9.,{}]+$ 外加一个字符设备)。通用 NTP 页面已将额外的 ntpd.conf 文本视为提权(userIsAdmin)。GPS/PPS 的 ACL 是独立的。保存时执行 configd_run('service restart ntpd')。ntpd 以 root 运行且未使用 -u。
| ID | 暂无 CVE |
| 类别 | 配置行注入 |
| 可达性 | 远程(已认证的 WebGUI) |
| CWE | CWE-93 / CWE-74 |
| CVSS | 高危:8.1 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N |
| 产品 | OPNsense core(Deciso B.V.) |
| 受影响 | OPNsense core 26.7.6(a842fe48c21288d11a422cb944678e8eb308becf)NTP GPS/PPS fudge |
| 认证 | 拥有 page-services-ntp-gps 和/或 page-services-ntp-pps 的 WebGUI 会话 |
| 许可证 | GNU Affero GPL v3.0 |
| 实验环境 | 仅 127.0.0.1 |
我固定了标签 26.7.6。实验环境是一个固定 ntpd_configure_do 的 PHP gadget,回环身份为 127.0.0.1:18830。GPS fudge 的 CR/LF 写入了一行额外的 logfile。Timeserver 主机的 CR/LF 被折叠为单个 token。
| 方法 | 汇聚点 | 权限 |
|---|---|---|
GPS fudge1 CR/LF | 在 fudge 127.127.20.0 之后固定 ntpd_configure_do 额外的 logfile /oracle/OPNSENSE-NTP-GPS-FUDGE-WITNESS | 完整性(实验已验证): ntpd.conf 额外行。实验:fudge-newline=yes。 |
利用 includefile / driftfile / statsdir | ntpd 以 root 运行,无 -u | 完整性(推断): 额外的 ntpd 策略 / 在 ntpd 可写路径写入文件。gadget 中未启动 ntpd。 |
| timeserver 主机 CR/LF | ntpd.inc:327-329 剥离 | 否定(实验已验证): timeserver 被折叠为单个 token。timeserver-stripped=yes。 |
PPS fudge1 / refid CR/LF | PPS fudge 127.127.22.0 块 | 完整性(推断): 同类问题。gadget 运行的是 GPS 路径。 |
| 无效的额外指令 | ntpd 启动 | 可用性(推断): ntpd 可能启动失败。 |
| 此路径 | 无 | 侦察: 未额外读取 config.xml 中的机密。 |
实验已验证 vs 推断: GPS fudge 换行和 timeserver 剥离是实验成功项。PPS 同类问题和以 root 运行的实时 ntpd 为推断。
前提条件: page-services-ntp-gps(实验)和/或 page-services-ntp-pps。不是 page-all。存在实时 /dev/cua* 字符节点,使 configure_gps/pps 返回 true。NTP 已启用。CSRF token。浏览器 <input type="text"> 不会保留 CR/LF;但来自该会话的直接 POST 会。
| 攻击面 | 实验 |
|---|---|
| CVE-2026-53581 任意路径覆盖 | ../ 不再能离开 /dev/(gps-char=char) |
| GHSA-h793 GPS XSS | 无法链接到此遗留问题 |
| Timeserver 主机 CR/LF | 已剥离(timeserver-stripped=yes) |
通用 NTP 页面上的 custom_options | 仅限 page-all / userIsAdmin |
| 未认证 | 已关闭 |
无未认证。无 53581 路径覆盖。Timeserver 主机已获得剥离处理。
cd lab
./run.sh
回环 127.0.0.1:18830。Compose 项目 opnsense-ntp-gps-fudge。见证 OPNSENSE-NTP-GPS-FUDGE-WITNESS。最后一行:
SUCCESS opnsense-ntp-gps-fudge fudge-newline=yes timeserver-stripped=yes OPNSENSE-NTP-GPS-FUDGE-WITNESS
对 GPS/PPS 的 fudge1 / fudge2 / refid 剥离 CR/LF(并处理引号),方式与 timeserver 主机在 ntpd.inc:327-329 处已有的处理相同。或者将这些字段限制为数字 / token 类。将额外的 ntpd.conf 文本保留在 userIsAdmin 之后。
a842fe48c21288d11a422cb944678e8eb308becfntpd.inc ntpd_configure_doservices_ntpd_gps.php