Excelize: a row whose earlier cell has a higher column reference than its last cell panics index out of range on almost every worksheet read API
## Affected versions and vulnerable location - Confirmed at `ae2113b` (current HEAD). - Sink: `rows.go:967` `ws.SheetData.Row[rowIdx].C[colNum-1] = *colData` inside `checkRow`. - `checkRow` computes `lastCol` from the column of the last cell in document order (`rows.go:940`), allocates `targetList` of that length, then re-scatters every source cell into `C[colNum-1]`. ## Root cause The slice is sized from the last cell's column, but cells are not required to be column-sorted in the XML. A cell that appears earlier in the row but references a higher column than the last cell has `colNum-1 >= len(targetList)`, so the assignment writes out of range. `MaxColumns`/`TotalRows` do not help, every individual column is valid; the bug is the ordering assumption, not magnitude. ## Attacker model and reachability Any service that opens an untrusted spreadsheet and calls a worksheet API that goes through `workSheetReader -> checkRow` (`excelize.go:332`): `GetCellValue`, `GetCellFormula`, `CalcCellValue`, `GetMergeCells`, `SetCellValue`, and essentially every non-streaming worksheet call. (The streaming `GetRows`/`Rows()` SAX path does not trigger it.) Unauthenticated, deterministic, unrecovered panic -> process crash. ## Proof of concept (executed) Crafted `xl/worksheets/sheet1.xml` with a row whose cells are out of column order and whose earlier cell exceeds the last cell's column: ```xml 43 ``` `GetCellValue("Sheet1","A1")` (via `getCellStringFunc -> workSheetReader -> checkRow`) panick
- Products
- github.com/xuri/excelize/v2
- Affected versions
- Not specified
- Fixed versions
- 2.11.1-0.20260816084418-46a5eb289448
- CVEs
- CVE-2026-107221
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 28 Oct 2026, 08:47 UTC · Revision 1
Source evidence
Excelize: a row whose earlier cell has a higher column reference than its last cell panics index out of range on almost every worksheet read API
core-osv · Original sourcePublished 7 Oct 2026, 20:23 UTC
## Affected versions and vulnerable location - Confirmed at `ae2113b` (current HEAD). - Sink: `rows.go:967` `ws.SheetData.Row[rowIdx].C[colNum-1] = *colData` inside `checkRow`. - `checkRow` computes `lastCol` from the column of the last cell in document order (`rows.go:940`), allocates `targetList` of that length, then re-scatters every source cell into `C[colNum-1]`. ## Root cause The slice is sized from the last cell's column, but cells are not required to be column-sorted in the XML. A cell that appears earlier in the row but references a higher column than the last cell has `colNum-1 >= len(targetList)`, so the assignment writes out of range. `MaxColumns`/`TotalRows` do not help, every individual column is valid; the bug is the ordering assumption, not magnitude. ## Attacker model and reachability Any service that opens an untrusted spreadsheet and calls a worksheet API that goes through `workSheetReader -> checkRow` (`excelize.go:332`): `GetCellValue`, `GetCellFormula`, `CalcCellValue`, `GetMergeCells`, `SetCellValue`, and essentially every non-streaming worksheet call. (The streaming `GetRows`/`Rows()` SAX path does not trigger it.) Unauthenticated, deterministic, unrecovered panic -> process crash. ## Proof of concept (executed) Crafted `xl/worksheets/sheet1.xml` with a row whose cells are out of column order and whose earlier cell exceeds the last cell's column: ```xml 43 ``` `GetCellValue("Sheet1","A1")` (via `getCellStringFunc -> workSheetReader -> checkRow`) panick
osv:GHSA-8mcq-6wmr-jrjv
github.com/xuri/excelize/v2
Fixed versions: 2.11.1-0.20260816084418-46a5eb289448
Complete source record
{
"id": "ef9ee06fede1c6632066a3dd4cb463da5b432f5bd3f8afac999593ea70665300",
"url": "https://osv.dev/vulnerability/GHSA-8mcq-6wmr-jrjv",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Excelize: a row whose earlier cell has a higher column reference than its last cell panics index out of range on almost every worksheet read API",
"summary": "## Affected versions and vulnerable location - Confirmed at `ae2113b` (current HEAD). - Sink: `rows.go:967` `ws.SheetData.Row[rowIdx].C[colNum-1] = *colData` inside `checkRow`. - `checkRow` computes `lastCol` from the column of the last cell in document order (`rows.go:940`), allocates `targetList` of that length, then re-scatters every source cell into `C[colNum-1]`. ## Root cause The slice is sized from the last cell's column, but cells are not required to be column-sorted in the XML. A cell that appears earlier in the row but references a higher column than the last cell has `colNum-1 >= len(targetList)`, so the assignment writes out of range. `MaxColumns`/`TotalRows` do not help, every individual column is valid; the bug is the ordering assumption, not magnitude. ## Attacker model and reachability Any service that opens an untrusted spreadsheet and calls a worksheet API that goes through `workSheetReader -> checkRow` (`excelize.go:332`): `GetCellValue`, `GetCellFormula`, `CalcCellValue`, `GetMergeCells`, `SetCellValue`, and essentially every non-streaming worksheet call. (The streaming `GetRows`/`Rows()` SAX path does not trigger it.) Unauthenticated, deterministic, unrecovered panic -> process crash. ## Proof of concept (executed) Crafted `xl/worksheets/sheet1.xml` with a row whose cells are out of column order and whose earlier cell exceeds the last cell's column: ```xml 43 ``` `GetCellValue(\"Sheet1\",\"A1\")` (via `getCellStringFunc -> workSheetReader -> checkRow`) panick",
"evidence": "osv:GHSA-8mcq-6wmr-jrjv",
"products": [
{
"name": {
"value": "github.com/xuri/excelize/v2",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "2.11.1-0.20260816084418-46a5eb289448",
"evidence": "/affected/0/ranges"
}
],
"affected_versions": []
}
],
"severity": "medium",
"structured": {
"id": "GHSA-8mcq-6wmr-jrjv",
"aliases": [
"CVE-2026-107221",
"GHSA-8mcq-6wmr-jrjv"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"
}
],
"affected": [
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "2.0.0"
},
{
"fixed": "2.11.1-0.20260816084418-46a5eb289448"
}
]
}
],
"package": {
"name": "github.com/xuri/excelize/v2",
"purl": "pkg:golang/github.com/xuri/excelize/v2",
"ecosystem": "Go"
},
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-8mcq-6wmr-jrjv/GHSA-8mcq-6wmr-jrjv.json"
}
}
],
"modified": "2026-10-07T20:30:05.928288242Z",
"provider": "osv",
"references": [
"https://github.com/qax-os/excelize/security/advisories/GHSA-8mcq-6wmr-jrjv",
"https://github.com/qax-os/excelize/pull/2376",
"https://github.com/qax-os/excelize/commit/46a5eb289448e40fbc7d3294589b03861fb822f0",
"https://github.com/qax-os/excelize"
],
"provider_metadata": {
"cwe_ids": [
"CWE-787"
],
"severity": "MODERATE",
"github_reviewed": true,
"nvd_published_at": null,
"github_reviewed_at": "2026-10-07T20:23:08Z"
}
},
"related_cves": [
{
"value": "CVE-2026-107221",
"evidence": "/aliases"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 97234,
"published_at": "2026-10-07T20:23:08+00:00"
}