1980 Commits
Author SHA1 Message Date
pavel kuliaka dbcaa9d491 shtest: skip locale test if date lacks locale support (#3583) 2026-07-18 17:03:18 +09:00
Thomas Klausner 579e6f76cf Cast char to unsigned char before passing to isspace (#3574) 2026-07-02 14:45:10 +09:00
itchyny 42d4035d4f Add a download link for Windows arm64 2026-06-22 19:31:20 +09:00
itchyny 3c81b62958 Update jq documentation for jq 1.8.2 release 2026-06-20 23:17:39 +09:00
github-actions[bot]andgithub-actions[bot] f0dabad36a Update signatures of 1.8.2 (#3566)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-06-20 23:12:40 +09:00
dependabot[bot] 34f7186b86 build(deps): bump actions/checkout from 6 to 7 in the official-actions group (#3565) jq-1.8.2 2026-06-20 20:58:06 +09:00
itchyny 88e83408f2 Update NEWS.md and AUTHORS for 1.8.2 (#3529) 2026-06-17 22:33:44 +09:00
itchyny a5a29cccc5 Upload attestation bundle as a release artifact (#3563)
The bundle generated by actions/attest is currently only retrievable
via the GitHub attestations API, which requires authentication.
Uploading it as jq-attestation.json lets downstream consumers
(distro packagers, unauthenticated CI) verify provenance offline.
2026-06-16 14:35:02 +09:00
itchynyandDirk Müller 46d1da3094 Tighten string length bounds and propagate invalid jv in implode
The bound added in CVE-2026-32316 (e47e56d22) still allowed
`sizeof(jvp_string) + (currlen + len) * 2 + 1` to wrap `size_t` on
32-bit platforms. Tighten the threshold so the final allocation
fits in 32-bit `size_t`.

Also break out of `jv_string_implode` and `f_string_implode` once
`jv_string_append_codepoint` returns an invalid `jv`; otherwise the
next iteration triggers the assertion in `jvp_string_ptr` (or
invokes undefined behavior under `-DNDEBUG`).

Fixes CVE-2026-54679.

Co-authored-by: Dirk Müller <dirk@dmllr.de>
2026-06-16 14:33:04 +09:00
itchyny e987df0d46 Fix heap-buffer-overflow in raw file loading
When `jv_string_append_buf` overflows the string length limit,
it returns an invalid `jv`; `jv_load_file` then re-entered it
on the invalid value and overran the heap. Break out of the loop
once the value is invalid.

Fixes CVE-2026-49839.
2026-06-08 22:15:06 +09:00
dependabot[bot] 985abe534f build(deps): bump lxml from 6.1.0 to 6.1.1 in /docs (#3553) 2026-06-02 08:36:56 +09:00
theyoucheng df924eae91 Fix undefined pointer arithmetic in UTF-8 helpers
Fixes GHSA-ggc9-rpv2-xgpm and GHSA-gvwx-xj9r-3frq.
2026-05-23 10:11:11 +09:00
itchyny a829f678f3 Fix one-byte over-read in BASE64_DECODE_TABLE (#3547)
The table was declared with 255 entries but indexed by an unsigned
char, so the decoder would read one byte past the array for input
bytes equal to 0xFF. Through jq's normal input paths the over-read
is unreachable because invalid UTF-8 bytes are normalized to U+FFFD
before reaching @base64d, but the table is still wrong at the C
level and reachable by libjq callers that construct strings via
the C API without UTF-8 validation.
2026-05-23 09:36:15 +09:00
Yu-Fu Fu 7122866869 Guard deep structural equality and comparison recursion (#3539)
jv_equal and jv_cmp overflows the C stack on deeply nested
input. Cap recursion at 10000 with -1 / INT_MIN sentinels;
operators that compose user expressions surface this as
"Equality check too deep" / "Comparison too deep".

Fixes CVE-2026-47770.
2026-05-22 20:07:16 +09:00
itchyny f58787c418 Detect circular module imports to prevent stack overflow
jq used to recurse without bound on mutual or self-referential
`import` declarations, exhausting the stack. Track each library's
load state with a `loading` flag set before its dependencies are
processed; a recursive reference to an in-progress library now
reports "circular import of X".

Fixes CVE-2026-44777.
2026-05-11 20:41:38 +09:00
itchyny 9d223f153c Reject embedded NUL bytes in module import paths
jq accepts embedded NUL bytes at the language level but resolves
module import paths through NUL-terminated C strings, so the path
validated by policy or audit code could differ from the on-disk
path jq actually opens. Pass jv through gen_import so the AST
preserves the original bytes, and reject embedded NULs in
validate_relpath.

Fixes CVE-2026-43895.
2026-05-09 17:08:43 +09:00
itchyny 9761ceb7d6 Reject numeric literals longer than DEC_MAX_DIGITS (999999999)
A signed-int overflow in decNumber's D2U macro lets huge literals
write attacker-controlled bytes past a stack buffer. Cap the length
before calling decNumberFromString, and pre-slice long strings in
jv_dump_string_trunc so the resulting error message doesn't itself
allocate a multi-GiB buffer.

Fixes CVE-2026-43894.
2026-05-06 19:45:24 +09:00
itchyny 532ccea608 Limit recursive object merge depth to prevent stack overflow
This fixes CVE-2026-43896.
2026-05-05 22:44:02 +09:00
itchyny 33d7bce321 Avoid stack overflow when freeing deeply nested values 2026-05-05 20:31:29 +09:00
itchyny 7316e5ce4b Fix CI to add artifact-metadata permission for actions/attest (#3530) 2026-05-05 14:06:45 +09:00
itchyny 63751f8a9f Fix signed-int overflow in tokenadd to prevent buffer overflow 2026-04-26 22:59:17 +09:00
Rohan Santhosh Kumar 5f2a14dd1b docs: fix "happened" spelling in tutorial changelog entries (#3525) jq-1.8.2rc1 2026-04-24 22:33:53 +09:00
itchyny 5a015deae3 Fix NUL truncation in program files loaded with -f
This fixes CVE-2026-41256.
2026-04-24 22:15:08 +09:00
itchyny 01b3cded76 Fix signed-int overflow in stack_reallocate
This fixes CVE-2026-41257.
2026-04-24 22:09:44 +09:00
itchyny d1a12569d9 Limit the containment check depth
This fixes CVE-2026-40612.
2026-04-24 22:02:24 +09:00
dependabot[bot] 870207323d build(deps): bump lxml from 6.0.2 to 6.1.0 in /docs (#3526) 2026-04-22 15:36:33 +09:00
dependabot[bot] 1eaa31acea build(deps): bump actions/upload-pages-artifact from 4 to 5 in the official-actions group (#3523) 2026-04-22 15:36:15 +09:00
itchyny fb59f14910 Limit path depth to prevent stack overflow
Deeply nested path arrays can cause unbounded recursion in
`jv_setpath`, `jv_getpath`, and `jv_delpaths`, leading to
stack overflow. Add a depth limit of 10000 to match the
existing `tojson` depth limit. This fixes CVE-2026-33947.
2026-04-13 11:23:40 +09:00
itchynyandMattias Wadman 2f09060afa Fix out-of-bounds read in jv_parse_sized()
This fixes CVE-2026-39979.

Co-authored-by: Mattias Wadman <mattias.wadman@gmail.com>
2026-04-13 11:04:52 +09:00
itchynyandAsaf Meizner 0c7d133c3c Randomize hash seed to mitigate hash collision DoS attacks
The hash function used a fixed seed, allowing attackers to craft colliding keys
and cause O(n^2) object parsing performance. Initialize the seed from a random
source at process startup to prevent the attack. This fixes CVE-2026-40164.

Co-authored-by: Asaf Meizner <asafmeizner@gmail.com>
2026-04-13 08:53:26 +09:00
itchyny 6374ae0bcd Fix NUL truncation in the JSON parser
This fixes CVE-2026-33948.
2026-04-13 08:46:11 +09:00
tlsbollei fdf8ef0f08 Add runtime type checks to f_string_indexes
This fixes CVE-2026-39956.
2026-04-08 21:43:46 +02:00
itchyny e47e56d226 Fix heap buffer overflow in jvp_string_append and jvp_string_copy_replace_bad
In `jvp_string_append`, the allocation size `(currlen + len) * 2` could
overflow `uint32_t` when `currlen + len` exceeds `INT_MAX`, causing a small
allocation followed by a large `memcpy`.

In `jvp_string_copy_replace_bad`, the output buffer size calculation
`length * 3 + 1` could overflow `uint32_t`, again resulting in a small
allocation followed by a large write.

Add overflow checks to both functions to return an error for strings
that would exceed `INT_MAX` in length. Fixes CVE-2026-32316.
2026-04-13 08:27:16 +09:00
Vladimír Marek 9f778b4cb5 Add Solaris support (#3515)
I love jq :) So while updating the version we ship in Solaris I have
tried to modify stuff to make everything work out of the box. Just

```
autoreconf -fiv
./configure
gmake
gmake check
```

I also went ahead and created Solaris test action should you be
interested in having it too. The changes are not extensive and I have
tried to comment them nicely in each commit. Hopefully that's enough.

Thanks for jq!
2026-04-08 16:02:41 +02:00
Peter KjellerstedtandPeter Kjellerstedt 27f417f481 Support building with --disable-maintainer-mode and source != build dir (#3518)
If --disable-maintainer-mode is enabled, then the rules for generating
parser.[ch] and lexer.[ch] did nothing. This worked fine if the source
and build directories are the same as the pre-generated parser.c and
lexer.c files would suffice. However, if the build directory is not the
same as the source directory, then the rest of the Make rules expect
parser.[ch] and lexer.[ch] to have been created in the build directory
if their source files (parser.y and lexer.l) are newer than the target
files, which can happen in case the source is fetched using Git.

Avoid the problem by copying the files to the build directory if needed.

Co-authored-by: Peter Kjellerstedt <pkj@axis.com>
2026-04-08 12:58:49 +09:00
itchyny 69785bf77f Use // instead of //= in from_entries definition (#3516) 2026-04-02 22:04:51 +09:00
dependabot[bot] 847b6afd2c build(deps): bump actions/deploy-pages from 4 to 5 in the official-actions group (#3513) 2026-04-02 14:15:32 +09:00
McSinyx c26756395c Respect SOURCE_DATE_EPOCH while generating man page (#3514) 2026-04-02 14:14:54 +09:00
itchyny cec6b0f346 Fix crashes and resource leaks in jq_testsuite (#3509)
- Fix segfault when --skip/--take is the last argument.
- Fix FILE handle leak: opened test files were never closed.
- Support running multiple test files in one invocation.
2026-03-15 21:45:16 +09:00
Ze Sheng b6a9e260cd fix jq_fuzz_parse_stream: use iterative parser API for streaming mode (#3499) 2026-03-11 11:49:14 +09:00
dependabot[bot] 1a394919f9 build(deps): bump the docker-actions group with 5 updates (#3506) 2026-03-09 20:50:20 +09:00
itchyny 4b145b3a58 Group Docker actions updates in dependabot config 2026-03-09 17:34:16 +09:00
dependabot[bot] 03a269b2f7 build(deps): bump crazy-max/ghaction-import-gpg from 6 to 7 (#3501) 2026-03-09 17:31:28 +09:00
Scott Seal 3985b80ce5 Fix use-after-free in args2obj() array argument path (#3498)
Copy `kk` and `vk` before passing to jv_object_get(), which consumes
its arguments. Without copies, subsequent loop iterations read freed
memory (CWE-416) and post-loop jv_free() double-frees (CWE-415).

This bug was introduced in `b279713e` when array processing was hoisted
out of
the loop into locals without accounting for jv_object_get() semantics.
Fixes GHSA-gf4g-95wj-4q4r.
2026-03-09 17:30:08 +09:00
itchyny 3cd7e0da00 Fix crash when importing a module with errors twice (#3497)
When a module fails to parse as a library, `load_library` cached the
invalid block. A second import/include of the same module would find
the cached invalid block and pass it to `block_bind_library`,
triggering the assertion failure. Skip caching the block when there
are parse errors to avoid this problem.
2026-03-06 15:32:29 +09:00
itchyny ed3c7f214b Fix tonumber and toboolean to reject strings with embedded null bytes (#3496) 2026-03-05 08:28:43 +09:00
itchyny bfcf82fde1 Refactor @uri and @urid and fix multi-byte UTF-8 corruption (#3495)
This commit improves performance by refactoring `@uri` and `@urid`
to pre-alloacte buffers and build the `jv` string at the end.
Also, this fixes `@urid` to prevent multi-byte UTF-8 corruption,
and to preserve embedded null bytes.
2026-03-05 08:28:09 +09:00
dependabot[bot] 36b6ae00b1 build(deps): bump the official-actions group with 3 updates (#3494) 2026-03-03 15:36:54 +09:00
itchyny 0df54c888a Fix infinite loop and undefined behavior in del(.[nan]) (#3490) 2026-03-02 21:58:28 +09:00
itchyny 262f0b81c1 Add missing validity check in f_strflocaltime after f_localtime (#3491) 2026-03-02 21:58:07 +09:00