CVE Vulnerabilities

CVE-2026-40164

Use of Weak Hash

Published: Apr 14, 2026 | Modified: Apr 28, 2026
CVSS 3.x
N/A
Source:
NVD
CVSS 2.x
RedHat/V2
RedHat/V3
7.5 IMPORTANT
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Ubuntu
MEDIUM
root.io logo minimus.io logo echo.ai logo

jq is a command-line JSON processor. Before commit 0c7d133c3c7e37c00b6d46b658a02244fdd3c784, jq used MurmurHash3 with a hardcoded, publicly visible seed (0x432A9843) for all JSON object hash table operations, which allowed an attacker to precompute key collisions offline. By supplying a crafted JSON object (~100 KB) where all keys hashed to the same bucket, hash table lookups degraded from O(1) to O(n), turning any jq expression into an O(n²) operation and causing significant CPU exhaustion. This affected common jq use cases such as CI/CD pipelines, web services, and data processing scripts, and was far more practical to exploit than existing heap overflow issues since it required only a small payload. This issue has been patched in commit 0c7d133c3c7e37c00b6d46b658a02244fdd3c784.

Weakness

The product uses an algorithm that produces a digest (output value) that does not meet security expectations for a hash function that allows an adversary to reasonably determine the original input (preimage attack), find another input that can produce the same hash (2nd preimage attack), or find multiple inputs that evaluate to the same hash (birthday attack).

Affected Software

NameVendorStart VersionEnd Version
Red Hat Enterprise Linux 10RedHatjq-0:1.7.1-11.el10_1.0.2*
Red Hat Enterprise Linux 10RedHatjq-0:1.7.1-11.el10_2.2*
Red Hat Enterprise Linux 10.0 Extended Update SupportRedHatjq-0:1.7.1-8.el10_0.3*
Red Hat Enterprise Linux 8RedHatjq-0:1.6-12.el8_10*
Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update SupportRedHatjq-0:1.5-12.el8_4.5*
Red Hat Enterprise Linux 8.4 Extended Update Support Long-Life Add-OnRedHatjq-0:1.5-12.el8_4.5*
Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update SupportRedHatjq-0:1.6-3.el8_6.2*
Red Hat Enterprise Linux 8.6 Telecommunications Update ServiceRedHatjq-0:1.6-3.el8_6.2*
Red Hat Enterprise Linux 8.6 Update Services for SAP SolutionsRedHatjq-0:1.6-3.el8_6.2*
Red Hat Enterprise Linux 8.8 Telecommunications Update ServiceRedHatjq-0:1.6-6.el8_8.4*
Red Hat Enterprise Linux 8.8 Update Services for SAP SolutionsRedHatjq-0:1.6-6.el8_8.4*
Red Hat Enterprise Linux 9RedHatjq-0:1.6-19.el9_7.0.2*
Red Hat Enterprise Linux 9RedHatjq-0:1.6-19.el9_8.2*
Red Hat Enterprise Linux 9.0 Update Services for SAP SolutionsRedHatjq-0:1.6-12.el9_0.3*
Red Hat Enterprise Linux 9.2 Update Services for SAP SolutionsRedHatjq-0:1.6-15.el9_2.3*
Red Hat Enterprise Linux 9.4 Extended Update SupportRedHatjq-0:1.6-16.el9_4.2*
Red Hat Enterprise Linux 9.6 Extended Update SupportRedHatjq-0:1.6-17.el9_6.4*
Red Hat OpenShift Container Platform 4.15RedHatrhcos-415.92.202606030318-0*
Red Hat OpenShift Container Platform 4.16RedHatrhcos-416.94.202606051757-0*
Red Hat OpenShift Container Platform 4.18RedHatrhcos-418.94.202606051320-0*
Red Hat OpenShift Container Platform 4.19RedHatrhcos-4.19.9.6.202606031700-0*
Red Hat AI Inference Server 3.2RedHatrhaiis/model-opt-cuda-rhel9:1780681984*
Red Hat Hardened ImagesRedHatjq-main-1.8.1-3.hum1*
JqUbuntuesm-apps-legacy/xenial*
JqUbuntuesm-apps/bionic*
JqUbuntuesm-apps/xenial*
JqUbuntuesm-infra-legacy/trusty*
JqUbuntuesm-infra/focal*
JqUbuntujammy*
JqUbuntunoble*
JqUbuntuquesting*
JqUbunturesolute*
JqUbuntuupstream*

Extended Description

A hash function is defined as an algorithm that maps arbitrarily sized data into a fixed-sized digest (output) such that the following properties hold:

     Building on this definition, a cryptographic hash function must also ensure that a malicious actor cannot leverage the hash function to have a reasonable chance of success at determining any of the following:

What is regarded as “reasonable” varies by context and threat model, but in general, “reasonable” could cover any attack that is more efficient than brute force (i.e., on average, attempting half of all possible combinations). Note that some attacks might be more efficient than brute force but are still not regarded as achievable in the real world. Any algorithm that does not meet the above conditions will generally be considered weak for general use in hashing. In addition to algorithmic weaknesses, a hash function can be made weak by using the hash in a security context that breaks its security guarantees. For example, using a hash function without a salt for storing passwords (that are sufficiently short) could enable an adversary to create a “rainbow table” [REF-637] to recover the password under certain conditions; this attack works against such hash functions as MD5, SHA-1, and SHA-2.

Potential Mitigations

  • Use an adaptive hash function that can be configured to change the amount of computational effort needed to compute the hash, such as the number of iterations (“stretching”) or the amount of memory required. Some hash functions perform salting automatically. These functions can significantly increase the overhead for a brute force attack compared to intentionally-fast functions such as MD5. For example, rainbow table attacks can become infeasible due to the high computing overhead. Finally, since computing power gets faster and cheaper over time, the technique can be reconfigured to increase the workload without forcing an entire replacement of the algorithm in use.
  • Some hash functions that have one or more of these desired properties include bcrypt [REF-291], scrypt [REF-292], and PBKDF2 [REF-293]. While there is active debate about which of these is the most effective, they are all stronger than using salts with hash functions with very little computing overhead.
  • Note that using these functions can have an impact on performance, so they require special consideration to avoid denial-of-service attacks. However, their configurability provides finer control over how much CPU and memory is used, so it could be adjusted to suit the environment’s needs.

References