{"id":"CVE-2026-107218","kind":"vulnerability","aliases":["CVE-2026-107218","GHSA-8jjq-8j9w-m2v6","GO-2026-6675"],"related":[],"title":"Excelize: RIGHT() on supplementary-plane text slices with a negative index and panics","description":"`leftRight` (calc.go:14236) tests the length with `countUTF16String`, which counts a rune above U+FFFF as 2. The RIGHT branch on 14241 then slices `[]rune(text)` at `utf8.RuneCountInString(text)-numChars`, which counts it as 1. For text with N such runes the two measures are 2N and N, so any `numChars` between them passes the guard and gives a negative index. The `numChars < 0` check at 14216 does not help, since the value that gets through is positive.\n\nWhat makes it worth reporting is `AutoFitColWidth`, which evaluates formulas without looking like it does, so normalising an uploaded sheet is enough to reach it. One scoping correction to my own wording there: `AutoFitColWidth` was added in v2.11.0 and does not exist at v2.10.1, so on v2.10.1 the only reachable path is an explicit `CalcCellValue`.\n\nA 6,077-byte file containing two U+1D7D9 characters in A1 and  RIGHT(A1,3)  in B1 was created and then opened in a separate program without recovery enabled:\n\n```\nv2.9.1    ok\nv2.10.0   ok\nv2.10.1   panic: slice bounds out of range [-1:]\nv2.11.0   panic: slice bounds out of range [-1:]\n```\n\nSo it is a regression, not an old defect. Commit a880146 (2026-01-16) moved the guard to `countUTF16String` and left the slice on the rune index, and `git tag --contains` gives v2.10.1 and v2.11.0 only.\n\nRIGHT only. RIGHTB reaches the same function but takes the byte branch at 14225, which is internally consistent, and I probed MID and MIDB from 1 to 5 with no panic. It is the same negative-index family as GHSA-fx5j-qcqg-grpf and GHSA-48hm-4h8j-58fg, though those are shared-string lookups in the reader rather than a unit mismatch in the formula library.","summary":"The Go spreadsheet library Excelize panics when its RIGHT() formula function handles text containing supplementary-plane characters with a negative index. The sources do not say that an attacker can run code or read data; the impact described is a crash.","severity":"medium","cvss":5.3,"epss":0.00309,"exploited":false,"exploited_at":null,"products":[{"name":"github.com/xuri/excelize/v2","fixed":["2.11.1-0.20260908032718-ecd99d761fe0"],"affected":">= 2.10.1, < 2.11.1-0.20260908032718-ecd99d761fe0","ecosystem":"go"},{"name":"excelize","fixed":[],"affected":">= 2.10.1, <= 2.11.0","ecosystem":"vendor"}],"ecosystems":["go","vendor"],"tags":["cwe-129","excelize","go","package","spreadsheets"],"not_affected_if":["fixed-version","no-formula-evaluation"],"how_to_check":"- Check the version of `github.com/xuri/excelize/v2` in `go.mod` or with `go list -m github.com/xuri/excelize/v2`\n- Check whether the application evaluates spreadsheet formulas on untrusted input\n- Run `govulncheck ./...` to see whether the vulnerable function is reachable","fix":"- `github.com/xuri/excelize/v2` to `2.11.1-0.20260908032718-ecd99d761fe0` or later","status":"open","published_at":"2026-10-07T19:17:34+00:00","first_seen_at":"2026-11-06T00:09:02+00:00","triaged_at":"2026-11-06T00:10:52+00:00","updated_at":"2026-11-06T00:19:08+00:00","category":"package","confidence":0.6,"triage":{"at":"2026-11-06T00:10:52Z","model":"claude-haiku-5-5","output":{"fix":"- `github.com/xuri/excelize/v2` to `2.11.1-0.20260908032718-ecd99d761fe0` or later","reach":"unknown","title":"Excelize: RIGHT() on supplementary-plane text panics the Go library","impact":"low","summary":"The Go spreadsheet library Excelize panics when its RIGHT() formula function handles text containing supplementary-plane characters with a negative index. The sources do not say that an attacker can run code or read data; the impact described is a crash.","audience":"developers","category":"package","nicknames":[],"who_cares":["go","excelize","spreadsheets"],"confidence":0.6,"fix_status":"available","needs_auth":"unknown","worst_case":"Application process panics and crashes on crafted formula input","analyst_note":"","how_to_check":"- Check the version of `github.com/xuri/excelize/v2` in `go.mod` or with `go list -m github.com/xuri/excelize/v2`\n- Check whether the application evaluates spreadsheet formulas on untrusted input\n- Run `govulncheck ./...` to see whether the vulnerable function is reachable","plain_action":"","needs_analyst":false,"not_affected_if":["fixed-version","no-formula-evaluation"],"who_is_affected":"Applications that import Excelize 2.10.1 up to but not including the fixed pseudo-version and evaluate RIGHT() formulas on text that may contain supplementary-plane characters. A negative index argument is also needed to trigger the panic. Programs that only write fixed cell values or never calculate formulas from untrusted input can skip it.","user_interaction":"unknown","needs_special_setup":"unknown","severity_if_unknown":"low"},"cost_usd":0.000723,"input_tokens":4268,"output_tokens":592,"severity_before":"unknown"},"analyst_status":null,"analyst_note":null,"search":"'+1':221C '-01':276C '-1':255C,263C '-107218':17A,28A '-129':34B '-16':277C '-2026':16A,24A,27A '-6675':25A '/xuri/excelize/v2':31A '0':143C '077':215C '1':114C,325C '14216':146C '14225':313C '14241':101C '2':96C '2026':275C '2n':125C '3':229C '48hm':348C '4h8j':349C '5':327C '58fg':350C '6':214C '8j9w':21A '8jjq':20A 'a1':225C,228C 'a880146':274C 'add':193C 'attack':68B 'autofitcolwidth':164C,191C 'b1':231C 'bound':251C,259C 'branch':99C,311C 'byte':216C,310C 'calc.go:14236':82C 'calccellvalu':212C 'charact':56B,223C 'check':144C 'code':71B 'commit':273C 'consist':317C 'contain':52B,218C,294C 'correct':185C 'count':89C,111C 'countutf16string':87C,282C 'crash':80B 'creat':233C 'cve':15A,26A 'cwe':33B 'd7d9':222C 'data':74B 'defect':272C 'describ':77B 'enabl':243C 'enough':179C 'evalu':166C 'excel':1A,35B,43B 'excelize':32A 'exist':199C 'explicit':211C 'famili':338C 'ffff':94C 'file':217C 'formula':48B,167C,368C 'function':49B,306C 'fx5j':342C 'get':154C 'ghsa':19A,341C,347C 'ghsa-48hm-4h8j-58fg':346C 'ghsa-8jjq-8j9w-m2v6':18A 'ghsa-fx5j-qcqg-grpf':340C 'git':292C 'github.com':30A 'github.com/xuri/excelize/v2':29A 'give':137C,295C 'go':23A,36B,40B 'grpf':344C 'guard':135C,280C 'handl':50B 'help':149C 'impact':76B 'index':12A,60B,140C,290C,337C 'intern':316C 'left':284C 'leftright':81C 'length':85C 'librari':42B,369C 'like':170C 'look':169C 'lookup':357C 'm2v6':22A 'make':159C 'measur':123C 'mid':321C 'midb':323C 'mismatch':365C 'move':278C 'n':118C,127C 'negat':11A,59B,139C,336C 'negative-index':335C 'normalis':174C 'numchar':109C,130C,142C 'ok':245C,247C 'old':271C 'one':183C 'open':236C 'packag':37B 'panic':14A,44B,249C,257C,330C 'pass':133C 'path':208C 'plane':6A,55B 'posit':157C 'probe':320C 'program':240C 'qcqg':343C 'rang':254C,262C 'rather':361C 'reach':181C,303C 'reachabl':207C 'read':73B 'reader':360C 'recoveri':242C 'regress':268C 'report':162C 'right':2A,47B,98C,227C,300C 'rightb':302C 'run':70B 'rune':91C,104C,120C,289C 'say':65B 'scope':184C 'separ':239C 'share':355C 'shared-str':354C 'sheet':177C 'sinc':150C 'slice':8A,103C,250C,258C,286C 'sourc':62B 'spreadsheet':38B,41B 'string':356C 'supplementari':5A,54B 'supplementary-plan':4A,53B 'tag':293C 'take':308C 'test':83C 'text':7A,51B,105C,108C,116C 'though':351C 'two':122C,219C 'u':93C,220C 'unit':364C 'upload':176C 'utf8.runecountinstring':107C 'v2.10.0':246C 'v2.10.1':201C,204C,248C,296C 'v2.11.0':195C,256C,298C 'v2.9.1':244C 'valu':152C 'without':168C,241C 'word':189C 'worth':161C","nicknames":[],"mitigations":[],"who_affected":"Applications that import Excelize 2.10.1 up to but not including the fixed pseudo-version and evaluate RIGHT() formulas on text that may contain supplementary-plane characters. A negative index argument is also needed to trigger the panic. Programs that only write fixed cell values or never calculate formulas from untrusted input can skip it.","tier":"C","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"developers","plain_action":null,"pkeys":["excelize","githubcomxuriexcelizev2"],"ptokens":["com","excelize","github","v2","xuri"],"labels":["cwe129","excelize","go","medium","package","spreadsheets","vendor"],"campaign_type":null,"first_public_at":"2026-09-08T03:25:51+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","cvss_by":"GitHub","poc_count":0,"sources":[{"source":"govuln","external_id":"GO-2026-6675","url":"https://pkg.go.dev/vuln/GO-2026-6675","severity":null,"published_at":"2026-11-05T22:53:46+00:00","modified_at":"2026-11-05T22:53:46+00:00","first_seen_at":"2026-11-06T00:09:02+00:00","fetched_at":"2026-11-06T00:09:02+00:00","note":null},{"source":"nvd","external_id":"CVE-2026-107218","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-107218","severity":null,"published_at":"2026-10-07T19:17:34+00:00","modified_at":"2026-10-13T14:23:29+00:00","first_seen_at":"2026-11-06T00:19:01+00:00","fetched_at":"2026-11-06T00:19:01+00:00","note":null},{"source":"ghsa","external_id":"GHSA-8jjq-8j9w-m2v6","url":"https://github.com/advisories/GHSA-8jjq-8j9w-m2v6","severity":"medium","published_at":"2026-10-07T20:23:26+00:00","modified_at":"2026-10-07T20:23:27+00:00","first_seen_at":"2026-11-06T00:19:08+00:00","fetched_at":"2026-11-06T00:19:08+00:00","note":null}],"documents":[{"id":81839,"url":"https://github.com/qax-os/excelize/commit/ecd99d761fe0489f1ed308e2f7dc2e0502d1a396","title":"Patch: github.com","kind":"other","source":"nvd","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":81840,"url":"https://github.com/qax-os/excelize/pull/2390","title":"Patch: github.com","kind":"other","source":"nvd","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":81841,"url":"https://github.com/qax-os/excelize/security/advisories/GHSA-8jjq-8j9w-m2v6","title":"Vendor advisory: github.com","kind":"vendor","source":"nvd","publisher":"vendor","text":null,"published_at":"2026-09-08T03:25:51+00:00","relation":"advisory","confidence":null,"note":"Vendor advisory: github.com"},{"id":81902,"url":"https://api.github.com/repos/qax-os/excelize/security-advisories/GHSA-8jjq-8j9w-m2v6","title":"Maintainer's advisory: api.github.com","kind":"vendor","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Maintainer's advisory: api.github.com"}],"exploit_sources":[{"type":"epss","score":0.00309,"url":"https://api.first.org/data/v1/epss?cve=CVE-2026-107218"}],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}