已将 CVE-2025-48060(jv_string_empty 中的堆缓冲区溢出)的上游修复反向移植到 jq 1.6。
反向移植(CVE-2025-48060)—— 将上游提交 c6e0416(“修复格式化空字符串时的堆缓冲区溢出”)从较新的 jq 版本反向移植到 jq-1.6,调整了内部字符串表示(jv_string_empty),添加了回归测试(0[implode]),并成功重新构建和运行了测试套件。
你可以在官方 jq-1.6 版本之上应用此反向移植,既可以基于 tarball,也可以基于 git checkout。
curl -LO https://github.com/jqlang/jq/releases/download/jq-1.6/jq-1.6.tar.gz
tar xf jq-1.6.tar.gz
cd jq-1.6
patch -p1 < 0001-Fix-heap-buffer-overflow-when-formatting-an-empty-st.patch
autoreconf -i
./configure --with-oniguruma=builtin
make -j"$(nproc)"
make check
如果你想从 git checkout 应用它:
git clone https://github.com/jqlang/jq.git
cd jq
git checkout jq-1.6
git am 0001-Fix-heap-buffer-overflow-when-formatting-an-empty-st.patch
git submodule update --init
autoreconf -i
./configure --with-oniguruma=builtin
make -j"$(nproc)"
make check