
Backported the upstream fix for CVE-2025-48060 (heap buffer overflow in jv_string_empty) to jq 1.6.
Backported the upstream fix for CVE-2025-48060 (heap buffer overflow in jv_string_empty) to jq 1.6.
Backport (CVE-2025-48060) – Backported upstream commit c6e0416 (“Fix heap buffer overflow when formatting an empty string”) from a newer jq version to jq-1.6, adapting internal string representation (jv_string_empty), adding a regression test (0[implode]), rebuilding and running the test suite successfully.
You can apply this backport on top of the official jq-1.6 release either from a tarball or from a 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
In case you want to apply it from a 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