Dasel: Selector lexer panics on trailing whitespace in `parseCurRune`
TomWright dasel
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| github.com/tomwright/dasel/v3 Go |
|
|
| github.com/tomwright/dasel Go |
| No fix yet |
| github.com/tomwright/dasel/v2 Go |
|
TomWright dasel
| Product | Affected | Fixed in |
|---|---|---|
| github.com/tomwright/dasel/v3 Go |
|
|
| github.com/tomwright/dasel Go |
| No fix yet |
| github.com/tomwright/dasel/v2 Go |
|
| No fix yet |
Dasel is a command-line tool and library for querying, modifying, and transforming data structures. From 3.0.0 until 3.11.2, selector/lexer/tokenize.go parseCurRune advances the input index across trailing whitespace and then reads the source at the exhausted index without an end-of-input check. A selector ending in whitespace, including input passed through lexer.NewTokenizer(...).Tokenize() or dasel.Query, can therefore cause an index-out-of-range panic and terminate the process. This issue is fixed in version 3.11.2.
From the CVE record · GitHub_M
In dasel v3, the selector lexer can read past the end of input when a selector ends in whitespace. Processing such a selector through the tokenizer or dasel.Query can trigger an index-out-of-range panic and terminate the process. The input does not specify whether an attacker needs network access, authentication, or user interaction.
Check installations of Go package github.com/tomwright/dasel/v3 versions 3.0.0 through 3.11.1, and installations of github.com/tomwright/dasel or github.com/tomwright/dasel/v2 at any version.