{"id":"CVE-2026-59162","aliases":["CVE-2026-59162","GHSA-fx5j-qcqg-grpf","GO-2026-6452"],"related":[],"kind":"vulnerability","state":"published","title":"Excelize: Negative shared-string index causes panic in GetCellValue and GetRows","summary":"Excelize is a Go language library for reading and writing Microsoft Excel spreadsheets. Prior to 2.11.0, Excelize parses shared-string cell values with strconv.Atoi and checks only the upper bound before indexing the shared string slice, allowing an XLSX file containing a shared-string cell with -1 to trigger sharedStrings[-1] and panic when read through GetCellValue or GetRows. This issue is fixed in version 2.11.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Excelize is a Go language library for reading and writing Microsoft Excel spreadsheets. Prior to 2.11.0, Excelize parses shared-string cell values with strconv.Atoi and checks only the upper bound before indexing the shared string slice, allowing an XLSX file containing a shared-string cell with -1 to trigger sharedStrings[-1] and panic when read through GetCellValue or GetRows. This issue is fixed in version 2.11.0.","source":"cvelist"},{"lang":"en","text":"# Negative shared-string index causes panic in GetCellValue and GetRows\n\n## Summary\n\nExcelize parses shared-string cell values with `strconv.Atoi` and checks only the upper bound before indexing the shared string slice. If an XLSX file contains a shared-string cell with `<v>-1</v>`, the parsed index is negative. The upper-bound check still passes (`len(sharedStrings) > -1`), and Excelize indexes `sharedStrings[-1]`, causing a runtime panic.\n\nThis was reproduced on the current default branch commit `1213a8bd7c5ab360554603ac5c995ccaf6eb4314` and the latest release tag `v2.10.1` (`5ad5ab3af0054c55bdce09f1530085600e9f2e45`). The issue is independent from the row-bound allocation report, so I am reporting it separately.\n\n## Affected package\n\n- Package: `github.com/xuri/excelize/v2`\n- Tested affected versions: current default branch at `1213a8bd7c5ab360554603ac5c995ccaf6eb4314`, and release `v2.10.1`\n- Fixed version: none known at the time of this report\n\n## Impact\n\nAn attacker who can provide an XLSX file to an application using Excelize can trigger a process panic when the application reads the malicious cell through common APIs such as `GetCellValue` or `GetRows`. In services that parse untrusted spreadsheets without a panic recovery boundary, this can cause denial of service.\n\n## Root cause\n\nFor shared-string cells (`t=\"s\"`), `xlsxC.getValueFrom()` parses the cell value as a shared-string index and only checks whether the index is below `len(d.SI)` before indexing:\n\n```go\nxlsxSI, _ := strconv.Atoi(strings.TrimSpace(c.V))\nif len(d.SI) > xlsxSI {\n    return d.SI[xlsxSI].String(), nil\n}\n```\n\nFor `xlsxSI == -1`, `len(d.SI) > -1` is true, so the code proceeds to index `d.SI[-1]` and panics.\n\n## Minimal worksheet payload\n\n```xml\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<worksheet xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\">\n  <sheetData>\n    <row r=\"1\"><c r=\"A1\" t=\"s\"><v>-1</v></c></row>\n  </sheetData>\n</worksheet>\n```\n\nThe workbook also contains a normal `sharedStrings.xml` with one string (`ok`), so the failure is specifically due to accepting a negative index.\n\n## Reproduction\n\nCalling `GetCellValue(\"Sheet1\", \"A1\")` on the workbook panics:\n\n```text\n== negative shared string GetCellValue ==\nelapsed=0s alloc_delta=0MB\nPANIC: runtime.boundsError runtime error: index out of range [-1]\n```\n\nCalling `GetRows(\"Sheet1\")` on the same workbook also panics:\n\n```text\n== negative shared string GetRows ==\nelapsed=0s alloc_delta=0MB\nPANIC: runtime.boundsError runtime error: index out of range [-1]\n```\n\nThe same results were observed on current default branch commit `1213a8bd7c5ab360554603ac5c995ccaf6eb4314` and on release `v2.10.1`.\n\n## Expected behavior\n\nMalformed shared-string indices should be rejected or treated as missing/invalid string references without panicking.\n\n## Suggested remediation\n\nCheck both lower and upper bounds before indexing the shared string table. For example:\n\n```go\nif xlsxSI >= 0 && xlsxSI < len(d.SI) {\n    return d.SI[xlsxSI].String(), nil\n}\n```\n\nAdd regression tests for `GetCellValue()` and `GetRows()` on `t=\"s\"` cells whose `<v>` value is negative.","format":"markdown","source":"ghsa"},{"lang":"en","text":"In github.com/xuri/excelize/v2, parsing a spreadsheet cell with a negative shared-string index causes a runtime panic. The shared-string lookup in xlsxC.getValueFrom checks only the upper bound of the parsed index against the shared-string slice length, causing negative indices (such as -1) to bypass validation and trigger an out-of-bounds slice access when reading cells via APIs such as GetCellValue or GetRows.","format":"markdown","source":"go"},{"lang":"es","text":"Excelize es una biblioteca del lenguaje Go para leer y escribir hojas de cálculo de Microsoft Excel. Antes de la versión 2.11.0, Excelize analiza los valores de celda de cadena compartida con strconv.Atoi y verifica solo el límite superior antes de indexar la porción de cadena compartida, lo que permite que un archivo XLSX que contiene una celda de cadena compartida con -1 active sharedStrings[-1] y cause un pánico cuando se lee a través de GetCellValue o GetRows. Este problema se solucionó en la versión 2.11.0.","source":"nvd"}],"published":"2026-07-10T15:51:26.078Z","modified":"2026-11-23T20:30:10.668Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N","score":6.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N","score":6.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-248","CWE-755"],"affected":[{"ranges":[{"version":"< 2.11.0","status":"affected"}],"vendor":"qax-os","product":"excelize","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.11.0"}],"ecosystem":"Go","package":"github.com/xuri/excelize/v2","purl":"pkg:golang/github.com/xuri/excelize/v2","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"1.4.0"}],"ecosystem":"Go","package":"github.com/xuri/excelize","purl":"pkg:golang/github.com/xuri/excelize","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.11.1-0.20260728235842-f98df08a8f6a"}],"ecosystem":"Go","package":"github.com/xuri/excelize/v2","purl":"pkg:golang/github.com/xuri/excelize/v2","source":"go"},{"ranges":[{"status":"affected","fixed":"2.11.0"}],"vendor":"excelize","product":"excelize","cpe":"cpe:2.3:a:excelize:excelize:*:*:*:*:*:go:*:*","source":"nvd"}],"references":[{"url":"https://github.com/qax-os/excelize/security/advisories/GHSA-fx5j-qcqg-grpf","tags":["advisory","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/qax-os/excelize/pull/2331","tags":["fix","issue-tracking","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/qax-os/excelize/commit/93f0b3caed37f21ef5079e3259c6c21dcfe68453","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/qax-os/excelize/releases/tag/v2.11.0","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-59162","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/qax-os/excelize","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/qax-os/excelize/commit/f98df08a8f6aed8bc3b193115d1abb5b1ea2e433","tags":["fix"],"sources":["go"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-07-10T18:40:21.218Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-59162","url":"https://www.cve.org/CVERecord?id=CVE-2026-59162","licence":"CVE Terms of Use","modified":"2026-07-10T18:40:25.481Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-fx5j-qcqg-grpf","url":"https://github.com/advisories/GHSA-fx5j-qcqg-grpf","licence":"CC-BY-4.0","modified":"2026-09-17T17:40:55.699Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-6452","url":"https://pkg.go.dev/vuln/GO-2026-6452","licence":"CC-BY-4.0","modified":"2026-11-23T20:30:10.668Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-59162","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-59162","licence":"Public domain","modified":"2026-10-25T15:10:00.147Z"}],"updatedAt":"2026-11-25T22:59:27.656Z","epss":{"score":0.00385,"percentile":0.34742,"date":"2026-12-01T12:00:22.000Z"}}