Description
decNumberCopy in decNumber.c in jq through 1.7.1 does not properly consider that NaN is interpreted as numeric, which has a resultant stack-based buffer overflow and out-of-bounds write, as demonstrated by use of --slurp with subtraction, such as a filter of .-. when the input has a certain form of digit string with NaN (e.g., "1 NaN123" immediately followed by many more digits).
CVSS breakdown
CVSS 3.1
Attack Vector
Local
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High
Affected products
- jqlang / jq0 – 1.7.1
References
- MISChttps://github.com/jqlang/jq/issues/3196
- MISChttps://gist.github.com/Ekkosun/a83870ce7f3b7813b9b462a395e8ad92
- MISChttps://github.com/jqlang/jq/blob/71c2ab509a8628dbbad4bc7b3f98a64aa90d3297/src/decNumber/decNumber.c#L3375
- VENDOR_ADVISORYhttps://github.com/jqlang/jq/security/advisories/GHSA-x6c3-qv5r-7q22
- MISChttps://github.com/jqlang/jq/issues/3296