CVE-2025-48060 の上流修正(jv_string_empty のヒープバッファオーバーフロー)を jq 1.6 にバックポートしました。
バックポート(CVE-2025-48060) – 新しいバージョンの jq から上流コミット c6e0416(「Fix heap buffer overflow when formatting an empty string」)を 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