CVE-2026-59162: Excelize Negative Shared-string Index Causes Panic Vulnerability

MODERATE
Advisory Identifier: GHSA-fx5j-qcqg-grpf
CWE-755 CWE-248
Published
Advisory Summary

CVE-2026-59162 is a MODERATE negative shared-string index causes panic vulnerability (CWE-755: Improper Handling of Exceptional Conditions) affecting Excelize libraries in the Go ecosystem. The issue involves negative shared-string index causes panic in getcellvalue and getrows. Remediation is available by upgrading affected packages to version 2.11.0.

CVE-2026-59162 at a Glance

CVE Identifier CVE-2026-59162
GHSA Identifier GHSA-fx5j-qcqg-grpf
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-755: Improper Handling of Exceptional Conditions
Affected Product Excelize
Package Ecosystem Go
Published Date
Last Updated

How to Fix CVE-2026-59162

To remediate this vulnerability, upgrade all affected Excelize 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/xuri/excelize/v2 fixed: 2.11.0
Upgrade github.com/xuri/excelize/v2 to 2.11.0
github.com/xuri/excelize fixed: Latest secure release
Upgrade github.com/xuri/excelize to Latest secure release
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/xuri/excelize/v2

How to Check if You Are Affected

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

inspect dependencies for github.com/xuri/excelize/v2

Analyze the terminal output to locate any version of Excelize in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.11.0), 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-755: Improper Handling of Exceptional Conditions, where the product does not handle or incorrectly handles an exceptional condition. In Excelize, 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

# Negative shared-string index causes panic in GetCellValue and GetRows ## Summary Excelize 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. This 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. ## Affected package - Package: `github.com/xuri/excelize/v2` - Tested affected versions: current default branch at `1213a8bd7c5ab360554603ac5c995ccaf6eb4314`, and release `v2.10.1` - Fixed version: none known at the time of this report ## Impact An 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. ## Root cause For 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: ```go xlsxSI, _ := strconv.Atoi(strings.TrimSpace(c.V)) if len(d.SI) > xlsxSI { return d.SI[xlsxSI].String(), nil } ``` For `xlsxSI == -1`, `len(d.SI) > -1` is true, so the code proceeds to index `d.SI[-1]` and panics. ## Minimal worksheet payload ```xml <?xml version="1.0" encoding="UTF-8"?> <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"> <sheetData> <row r="1"><c r="A1" t="s"><v>-1</v></c></row> </sheetData> </worksheet> ``` The workbook also contains a normal `sharedStrings.xml` with one string (`ok`), so the failure is specifically due to accepting a negative index. ## Reproduction Calling `GetCellValue("Sheet1", "A1")` on the workbook panics: ```text == negative shared string GetCellValue == elapsed=0s alloc_delta=0MB PANIC: runtime.boundsError runtime error: index out of range [-1] ``` Calling `GetRows("Sheet1")` on the same workbook also panics: ```text == negative shared string GetRows == elapsed=0s alloc_delta=0MB PANIC: runtime.boundsError runtime error: index out of range [-1] ``` The same results were observed on current default branch commit `1213a8bd7c5ab360554603ac5c995ccaf6eb4314` and on release `v2.10.1`. ## Expected behavior Malformed shared-string indices should be rejected or treated as missing/invalid string references without panicking. ## Suggested remediation Check both lower and upper bounds before indexing the shared string table. For example: ```go if xlsxSI >= 0 && xlsxSI < len(d.SI) { return d.SI[xlsxSI].String(), nil } ``` Add regression tests for `GetCellValue()` and `GetRows()` on `t="s"` cells whose `<v>` value is negative.

CVE-2026-59162 Affected Excelize Versions

2 component(s)
Fixed Versions:
2.11.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/xuri/excelize/v2
Go
< 2.11.0
2.11.0
github.com/xuri/excelize
Go
≤ 1.4.0

References

Frequently Asked Questions

What is CVE-2026-59162?
CVE-2026-59162 is a security vulnerability in Excelize involving Negative shared-string index causes panic in GetCellValue and GetRows under CWE-755: Improper Handling of Exceptional Conditions.
Which Excelize versions are affected?
Affected versions include releases prior to 2.11.0 across affected packages: github.com/xuri/excelize/v2, github.com/xuri/excelize.
What version fixes CVE-2026-59162?
Upgrading to 2.11.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/xuri/excelize/v2 affected?
Yes, github.com/xuri/excelize/v2 is affected in releases prior to 2.11.0. Upgrade your dependency to 2.11.0 or later.
Is github.com/xuri/excelize affected?
Yes, github.com/xuri/excelize is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with CVE-2026-59162?
CVE-2026-59162 is classified under CWE-755: Improper Handling of Exceptional Conditions (The product does not handle or incorrectly handles an exceptional condition.).
How can I check Go dependencies for CVE-2026-59162?
Run the dependency tree command: 'inspect dependencies for github.com/xuri/excelize/v2'. 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-fx5j-qcqg-grpf",
  "modified" : "2026-09-10T15:08:53Z",
  "published" : "2026-09-10T15:08:53Z",
  "aliases" : [ "CVE-2026-59162" ],
  "summary" : "Excelize: Negative shared-string index causes panic in GetCellValue and GetRows",
  "details" : "# 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.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/xuri/excelize/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.11.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/xuri/excelize"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "1.4.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/qax-os/excelize/security/advisories/GHSA-fx5j-qcqg-grpf"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-59162"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/qax-os/excelize/pull/2331"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/qax-os/excelize/commit/93f0b3caed37f21ef5079e3259c6c21dcfe68453"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/qax-os/excelize"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/qax-os/excelize/releases/tag/v2.11.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-248", "CWE-755" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-10T15:08:53Z",
    "nvd_published_at" : "2026-07-10T17:17:02Z"
  }
}