Vulnerabilities in pkg:golang/github.com/tomwright/dasel/v3

PACKAGE
Advisory Identifier: GHSA-65gg-g7rw-6cpc
Advisory Summary

CVE-2026-62866 is a MODERATE (CVSS 6.2) selector lexer panics on trailing vulnerability (CWE-129: Improper Validation of Array Index) affecting Dasel libraries in the Go ecosystem. The issue involves selector lexer panics on trailing whitespace in `parsecurrune`. Remediation is available by upgrading affected packages to version 3.11.2.

5 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/tomwright/dasel/v3

5 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/tomwright/dasel/v3. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-65gg-g7rw-6cpc CVE-2026-62866 MODERATE Dasel: Selector lexer panics on trailing whitespace in `parseCurRune`
GHSA-cqxr-jxr2-85pq CVE-2026-59168 MODERATE Dasel: Unbounded recursion in JSON and XML readers causes unrecoverable stack-overflow DoS
GHSA-m6xr-fvfg-5g64 CVE-2026-46378 HIGH Dasel: Denial of service in dasel selector lexer due to infinite loop on unterminated regex literal
GHSA-m5j3-4634-c2vq CVE-2026-46377 HIGH Dasel: Index-out-of-range panic in dasel selector lexer on trailing backslash in quoted string
GHSA-4fcp-jxh7-23x8 CVE-2026-33320 MODERATE Dasel has unbounded YAML alias expansion in dasel leads to CPU/memory denial of service

CVE-2026-62866 at a Glance

CVE Identifier CVE-2026-62866
GHSA Identifier GHSA-65gg-g7rw-6cpc
Severity MODERATE
CVSS v3.1 Base Score 6.2
CWE Classification CWE-129: Improper Validation of Array Index
Affected Product Dasel
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-62866

To remediate this vulnerability, upgrade all affected Dasel dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/tomwright/dasel/v3 fixed: 3.11.2
Upgrade github.com/tomwright/dasel/v3 to 3.11.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/tomwright/dasel/v3

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-62866, inspect your project dependencies for Dasel:

inspect dependencies for github.com/tomwright/dasel/v3

Analyze the terminal output to locate any version of Dasel in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.11.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-129: Improper Validation of Array Index, where the product uses untrusted input when calculating or using an array index, but the product does not validate or incorrectly validates the index to ensure the index references a valid position within the array. In Dasel, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Same panic class as GHSA-m5j3-4634-c2vq and GHSA-m6xr-fvfg-5g64, sister site on the same function. Trigger is any selector ending in whitespace: `dasel query 'a '` panics at `selector/lexer/tokenize.go:60`. The whitespace-skip loop right above (lines 55-57) advances `p.i` to `p.srcLen` when the input is all-whitespace or whitespace-trailing. The very next line reads `p.src[p.i]` without a bounds check. ## Vulnerable code `selector/lexer/tokenize.go:53-74` (v3.11.0): ```go func (p *Tokenizer) parseCurRune() (Token, error) { // Skip over whitespace for p.i < p.srcLen && unicode.IsSpace(rune(p.src[p.i])) { p.i++ } // Skip over comments if p.src[p.i] == '/' && p.i+1 < p.srcLen && p.src[p.i+1] == '/' { // ... ``` Lines 69-71 right below already do the bounds check after the comment-skip path. The whitespace-only path slipped past it. ## Reproduce ``` $ echo '{"a":1}' | dasel query -i json 'a ' panic: runtime error: index out of range [2] with length 2 goroutine 1 [running]: github.com/tomwright/dasel/v3/selector/lexer.(*Tokenizer).parseCurRune(...) selector/lexer/tokenize.go:60 github.com/tomwright/dasel/v3/selector/lexer.(*Tokenizer).Next(...) github.com/tomwright/dasel/v3/selector/lexer.(*Tokenizer).Tokenize(...) github.com/tomwright/dasel/v3/selector.Parse(...) github.com/tomwright/dasel/v3/execution.ExecuteSelector(...) ``` Other inputs that hit it: `' '`, `$'a\t'`, `$'a\n'`, `'a ?? '`, `'a + '`. Any token (or no token) followed by whitespace. Reachable directly from the library too - `dasel.Query(ctx, input, "a ")` panics the same way. Project-style test reproducer that fails on current `main`: ```go // drop into selector/lexer/ as tokenize_trailing_ws_test.go package lexer_test import ( "testing" "github.com/tomwright/dasel/v3/selector/lexer" ) func TestTokenize_TrailingWhitespacePanic(t *testing.T) { defer func() { if r := recover(); r != nil { t.Fatalf("Tokenize panicked: %v", r) } }() _, _ = lexer.NewTokenizer("a ").Tokenize() } ``` ## Impact Process crash, no auth, no preconditions. Same severity tier as the two May 13 advisories on this file. ## Affected versions All v3.x. The whitespace-skip loop was added in `78fcca9` (Dasel V3, ~9 months ago); line 60's indexing landed in `9bfe966` (~6 months ago). Reproduced on `github.com/tomwright/dasel/v3@v3.11.0`. ## Suggested fix One line, between the whitespace-skip loop and the comment-skip access. Same shape as lines 69-71: ```go func (p *Tokenizer) parseCurRune() (Token, error) { for p.i < p.srcLen && unicode.IsSpace(rune(p.src[p.i])) { p.i++ } if p.i >= p.srcLen { return NewToken(EOF, "", p.i, 0), nil } if p.src[p.i] == '/' && p.i+1 < p.srcLen && p.src[p.i+1] == '/' { ``` ## Prevalence The other two cases in this class shipped fixes two weeks ago; this one wasn't covered in those patches. I checked the rest of `parseCurRune` for other unguarded direct-access points after a `pos++` - nothing else stood out. A `testing.F` harness on `lexer.NewTokenizer(s).Tokenize()` catches all three with trivially short inputs and would close the class.

CVE-2026-62866 Affected Dasel Versions

1 component(s)
Fixed Versions:
3.11.2
Product / Package Ecosystem Affected Versions Fixed Version
github.com/tomwright/dasel/v3
Go
≥ 3.0.0
< 3.11.2
3.11.2

References

Frequently Asked Questions

What is CVE-2026-62866?
CVE-2026-62866 is a security vulnerability in Dasel involving Selector lexer panics on trailing whitespace in `parseCurRune` under CWE-129: Improper Validation of Array Index.
Which Dasel versions are affected?
Affected versions include releases prior to 3.11.2 across affected packages: github.com/tomwright/dasel/v3.
What version fixes CVE-2026-62866?
Upgrading to 3.11.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/tomwright/dasel/v3 affected?
Yes, github.com/tomwright/dasel/v3 is affected in releases prior to 3.11.2. Upgrade your dependency to 3.11.2 or later.
What is the CVSS score of CVE-2026-62866?
CVE-2026-62866 has a CVSS v3.1 base score of 6.2 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-62866?
CVE-2026-62866 is classified under CWE-129: Improper Validation of Array Index (The product uses untrusted input when calculating or using an array index, but the product does not validate or incorrectly validates the index to ensure the index references a valid position within the array.).
How can I check Go dependencies for CVE-2026-62866?
Run the dependency tree command: 'inspect dependencies for github.com/tomwright/dasel/v3'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-65gg-g7rw-6cpc",
  "modified" : "2026-09-22T19:52:16Z",
  "published" : "2026-09-22T19:52:16Z",
  "aliases" : [ "CVE-2026-62866" ],
  "summary" : "Dasel: Selector lexer panics on trailing whitespace in `parseCurRune`",
  "details" : "Same panic class as GHSA-m5j3-4634-c2vq and GHSA-m6xr-fvfg-5g64, sister site on the same function. Trigger is any selector ending in whitespace: `dasel query 'a '` panics at `selector/lexer/tokenize.go:60`.\n\nThe whitespace-skip loop right above (lines 55-57) advances `p.i` to `p.srcLen` when the input is all-whitespace or whitespace-trailing. The very next line reads `p.src[p.i]` without a bounds check.\n\n## Vulnerable code\n\n`selector/lexer/tokenize.go:53-74` (v3.11.0):\n\n```go\nfunc (p *Tokenizer) parseCurRune() (Token, error) {\n\t// Skip over whitespace\n\tfor p.i < p.srcLen && unicode.IsSpace(rune(p.src[p.i])) {\n\t\tp.i++\n\t}\n\n\t// Skip over comments\n\tif p.src[p.i] == '/' && p.i+1 < p.srcLen && p.src[p.i+1] == '/' {\n\t\t// ...\n```\n\nLines 69-71 right below already do the bounds check after the comment-skip path. The whitespace-only path slipped past it.\n\n## Reproduce\n\n```\n$ echo '{\"a\":1}' | dasel query -i json 'a '\npanic: runtime error: index out of range [2] with length 2\n\ngoroutine 1 [running]:\ngithub.com/tomwright/dasel/v3/selector/lexer.(*Tokenizer).parseCurRune(...)\n\tselector/lexer/tokenize.go:60\ngithub.com/tomwright/dasel/v3/selector/lexer.(*Tokenizer).Next(...)\ngithub.com/tomwright/dasel/v3/selector/lexer.(*Tokenizer).Tokenize(...)\ngithub.com/tomwright/dasel/v3/selector.Parse(...)\ngithub.com/tomwright/dasel/v3/execution.ExecuteSelector(...)\n```\n\nOther inputs that hit it: `'   '`, `$'a\\t'`, `$'a\\n'`, `'a ?? '`, `'a + '`. Any token (or no token) followed by whitespace.\n\nReachable directly from the library too - `dasel.Query(ctx, input, \"a \")` panics the same way. Project-style test reproducer that fails on current `main`:\n\n```go\n// drop into selector/lexer/ as tokenize_trailing_ws_test.go\npackage lexer_test\n\nimport (\n\t\"testing\"\n\t\"github.com/tomwright/dasel/v3/selector/lexer\"\n)\n\nfunc TestTokenize_TrailingWhitespacePanic(t *testing.T) {\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tt.Fatalf(\"Tokenize panicked: %v\", r)\n\t\t}\n\t}()\n\t_, _ = lexer.NewTokenizer(\"a \").Tokenize()\n}\n```\n\n## Impact\n\nProcess crash, no auth, no preconditions. Same severity tier as the two May 13 advisories on this file.\n\n## Affected versions\n\nAll v3.x. The whitespace-skip loop was added in `78fcca9` (Dasel V3, ~9 months ago); line 60's indexing landed in `9bfe966` (~6 months ago). Reproduced on `github.com/tomwright/dasel/v3@v3.11.0`.\n\n## Suggested fix\n\nOne line, between the whitespace-skip loop and the comment-skip access. Same shape as lines 69-71:\n\n```go\nfunc (p *Tokenizer) parseCurRune() (Token, error) {\n\tfor p.i < p.srcLen && unicode.IsSpace(rune(p.src[p.i])) {\n\t\tp.i++\n\t}\n\n\tif p.i >= p.srcLen {\n\t\treturn NewToken(EOF, \"\", p.i, 0), nil\n\t}\n\n\tif p.src[p.i] == '/' && p.i+1 < p.srcLen && p.src[p.i+1] == '/' {\n```\n\n## Prevalence\n\nThe other two cases in this class shipped fixes two weeks ago; this one wasn't covered in those patches. I checked the rest of `parseCurRune` for other unguarded direct-access points after a `pos++` - nothing else stood out. A `testing.F` harness on `lexer.NewTokenizer(s).Tokenize()` catches all three with trivially short inputs and would close the class.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/tomwright/dasel/v3"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.11.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/TomWright/dasel/security/advisories/GHSA-65gg-g7rw-6cpc"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-62866"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/TomWright/dasel/commit/eee03aec28d4a33d6138098d065b7b37b85e3c55"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/TomWright/dasel"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/TomWright/dasel/releases/tag/v3.11.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-129" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-22T19:52:16Z",
    "nvd_published_at" : "2026-09-21T17:17:38Z"
  }
}