Reach jq · 4 builds in 2 of 4 releases
full reviewcross-check✓ a member decided
Description · NVD
jq is a command-line JSON processor. In 1.8.1 and earlier, jq accepts embedded NUL bytes in import paths at the jq-language level, but later resolves those paths through C string operations during module and data-file lookup. This creates a mismatch between the logical import string that policy or audit code may validate and the on-disk path that jq actually opens.
Published 2026-05-11NVD
CVSS 3.1Local · low privileges · no user interaction
How it is reached
- Attack vector
- Local
- Attack complexity
- Low
- Privileges required
- Low
- User interaction
- None
What it costs
- Confidentiality
- Low
- Integrity
- Low
- Availability
- None
- Scope
- Unchanged
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
Fable 5.1 · high confidence · 2026-11-05
The vulnerable code is present: jq 1.7.1's parser hands import paths to gen_import() via jv_string_value() and validate_relpath()/find_lib() use strchr/strcmp/stat on the C string, with no check that the jq-level string length matches strlen; none of the 16 Buildroot patches (only 0014 touches linker.c, for circular imports) adds that check.
jq is explicitly selected in the defconfig and runs by default on the device, but every invocation (update-common, slot-check, nameif, udhcpc script, confd migrate/gen-config, container helper, CLI show commands) uses a hard-coded filter literal; operator/network input only enters as JSON data or --arg values, never as program text, and no shipped program uses import/include.
Exploiting the CVE requires authoring a jq program with an import directive, which on Infix is only possible from a system shell (CLI shell escape or SSH shell as an admin), i.e. an already-privileged local user; there is no policy/audit layer in Infix that validates jq import strings, so the described mismatch has no security boundary to cross here.
Evidence 8
Import/include paths passed to gen_import() via jv_string_value(v) with no NUL-length check — vulnerable code present
output/build/jq-1.7.1/src/parser.y:506-527 (ImportWhat)
Module path validation and lookup use strchr/strcmp/stat on the C string, truncating at embedded NUL
output/build/jq-1.7.1/src/linker.c:98-124 (validate_relpath) and :187-206 (find_lib stat())
Only patch 0014 touches linker.c (circular-import detection); no patch adds NUL rejection for import paths; jq.mk has no IGNORE_CVES for CVE-2026-43895
output/build/jq-1.7.1/.applied_patches_list; buildroot/package/jq/0014-*.patch (+++ b/src/linker.c)
BR2_PACKAGE_JQ=y — explicitly selected target package, /usr/bin/jq installed in output/target
configs/x86_64_defconfig:36, output/.config:745
Default-runtime jq invocations all use fixed filter literals; external input only as JSON data on stdin
board/common/rootfs/usr/libexec/infix/update-common:11,21,29,93; slot-check:4; init.d/20-nameif:33; usr/share/udhcpc/default.script:133
Config migration uses inline jq filters; migration steps are shell scripts, no .jq module files, no import/include anywhere in the tree
src/confd/bin/migrate:59,78,189; src/confd/bin/gen-config:64; src/confd/share/migrate/*
CLI uses jq with fixed programs; ${KLISH_PARAM_xpath} goes to `copy -x`, not to the jq program
src/klish-plugin-infix/xml/infix.xml:985-1012,128,138; src/klish-plugin-infix/src/infix.c:352,384,399
Only route to run an arbitrary jq program is the CLI `shell` escape (system shell), i.e. an already-privileged local user
src/klish-plugin-infix/xml/shell.xml:9-10
Version and patches
Advisory GHSA-7q7g-mrq3-phxr: affected ≤1.8.1, fixed in 1.8.2 (upstream rejects embedded NUL in import paths). This tree ships 1.7.1 with 16 Buildroot patches (CVE-2024-23337, CVE-2024-53427, CVE-2025-48060, CVE-2026-39979/33948/33947/32316/40164/40612/41256/41257/43894/43896/44777/49839/54679); none addresses CVE-2026-43895 and the source still lacks the fix.
Recommendation
Document as not exposed on shipped devices (requires a local shell to supply a jq program with an import directive; no Infix component validates or audits jq import strings). Pick up the upstream fix opportunistically with the next jq patch batch / Buildroot bump; no urgent action.
Open questions
The upstream fix commit itself was not available in the tree, so the exact fixed-version boundary is taken from the advisory text ("1.8.1 and earlier"). Whether the CLI shell command is available to non-admin user groups was not verified, but either way it yields a system shell, which is outside the product's management interfaces.
Members of Kernel Kit decide. Sign in if you are one.