Commit Graph
1908 Commits
Author SHA1 Message Date
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
itchyny c3d3e7d656 Fix buttons in tutorial to toggle labels when clicked on (#3493) 2026-03-02 17:46:58 +09:00
dependabot[bot] 2beac1aed0 build(deps): bump markdown from 3.10 to 3.10.2 in /docs (#3492) 2026-03-01 16:06:09 +09:00
dependabot[bot] 2d5239e8c1 build(deps): bump jsonschema from 4.25.1 to 4.26.0 in /docs (#3474) 2026-03-01 16:04:55 +09:00
itchyny 601a37f452 Refactor tm2jv to handle fractional seconds removing duplicated code (#3489) 2026-03-01 06:18:14 +09:00
itchyny 750dbe723b Fix memory leaks and double frees (#3487) 2026-03-01 06:15:58 +09:00
Fabian Fleischer 2ad99a6c70 Pre-allocate tokenbuf for string parser (#3485)
Fixes #3483
2026-02-28 15:45:16 +01:00
Fabian Fleischer 061fd14d74 Fix off-by-one in modulo operator (#3486) 2026-02-27 04:35:36 +09:00
itchyny 22361cfb87 Improve error message truncation with closing delimiters (#3478)
Truncated strings now show closing delimiters: `..."` for strings,
`...]` for arrays, and `...}` for objects, making error messages
clearer.
2026-02-25 08:14:23 +09:00
Ze Sheng a2741ee0a8 Limit number of function parameters and definitions to prevent SEGV (#3460) 2026-02-25 07:49:40 +09:00
itchyny b33a7634ba Fix reversed pointer subtraction in f_env bounds check (#3465) 2026-01-20 21:56:09 +09:00
itchyny d44baeb67a Support arm/v7 architecture in Docker images (#3463) 2026-01-15 14:10:07 +09:00
dependabot[bot] ea9e41f758 build(deps): bump the official-actions group with 2 updates (#3450) 2025-12-17 11:24:39 +09:00
dependabot[bot] f46dc3dd61 build(deps): bump markdown from 3.9 to 3.10 in /docs (#3442) 2025-12-17 11:24:12 +09:00
José Joaquín Atria 88b9c4920e Fix stder typo (#3446)
The manual was missing an "r" in "stderr".
2025-12-12 10:54:39 +01:00
bigmoonbit 0eb3da11ed chore: fix typo in tests/jq.test (#3441)
fix typo in  tests/jq.test

Signed-off-by: bigmoonbit <bigmoonbit@outlook.com>
2025-11-27 10:44:45 +01:00
dependabot[bot] 39572e129f build(deps): bump actions/checkout from 5 to 6 in the official-actions group (#3439) 2025-11-24 15:15:18 +09:00
Jan-Piet Mens 4829059147 Add missing word in manual for rawfile (#3434) 2025-11-18 09:49:59 +09:00
itchyny 33b3a68f9c Fix expected value assertion (fix #3430, ref #3393) (#3431) 2025-11-04 21:21:21 +09:00
Mattias Wadman cff4e00982 website: Add wiki link to navigation bar (#3424)
Related to #3423
2025-10-31 10:17:25 +01:00
itchyny 5529788292 Fix slurping raw input not to corrupt multi-byte characters (fix #3389) (#3421) 2025-10-31 15:16:29 +09:00
dependabot[bot] 8d9a3c3ab3 build(deps): bump the official-actions group with 2 updates (#3429) 2025-10-27 16:48:33 +09:00
Ish Nagy b29504b4e1 Increase the maximum printing depth from 256 to 10000 (fixes #3413) (#3414) 2025-10-14 14:12:57 +09:00