Excelize: GetConditionalFormats indexes conditional-formatting rule sub-elements with no length or nil check
## Summary `GetConditionalFormats` reads sub-elements of a `` straight out of `xl/worksheets/sheetN.xml` and indexes them without checking length, and in one case without checking for nil. Three rule types are affected: `cellIs`, `dataBar` and `colorScale`. A workbook with a rule that is missing a child a real Excel file would always have panics the call. ## Where it is All three sinks are in `styles.go`, at the same line numbers in v2.11.0 and on master `d552a7e`. All three are reached from `GetConditionalFormats` through `styles.go:3271`. `styles.go:3003`, in `extractCondFmtCellIs`: ```go format.Value = c.Formula[0] ``` The branch above it handles `len(c.Formula) == 2`; this one is the fallback and does not check that there is a formula at all, so a `cellIs` rule with no `` child indexes an empty slice. `styles.go:3132`, in the colorScale extractor: ```go values := len(c.ColorScale.Cfvo) ``` `c.ColorScale` is a `*xlsxColorScale` and is nil when the `` element has no `` child. Lines 3148 and 3153 then index `Cfvo[1]` and `Cfvo[2]` in the three-colour branch with no length check either. `styles.go:3186`, `:3188` and `:3190`, in the dataBar extractor: ```go format.MinType = c.DataBar.Cfvo[0].Type ... format.BarColor = "#" + f.getThemeColor(c.DataBar.Color[0]) ``` The guard here is `c.DataBar != nil`, which says nothing about the length of `Cfvo` or `Color`, so an empty `` element reaches all three. ## Who the attacker is Anyone who can hand a spreadsheet to a service that open
- Products
- github.com/xuri/excelize/v2
- Affected versions
- Not specified
- Fixed versions
- 2.11.1-0.20260812075026-be7a16390fa6
- CVEs
- CVE-2026-107222
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 28 Oct 2026, 08:47 UTC · Revision 1
Source evidence
Excelize: GetConditionalFormats indexes conditional-formatting rule sub-elements with no length or nil check
core-osv · Original sourcePublished 7 Oct 2026, 20:22 UTC
## Summary `GetConditionalFormats` reads sub-elements of a `` straight out of `xl/worksheets/sheetN.xml` and indexes them without checking length, and in one case without checking for nil. Three rule types are affected: `cellIs`, `dataBar` and `colorScale`. A workbook with a rule that is missing a child a real Excel file would always have panics the call. ## Where it is All three sinks are in `styles.go`, at the same line numbers in v2.11.0 and on master `d552a7e`. All three are reached from `GetConditionalFormats` through `styles.go:3271`. `styles.go:3003`, in `extractCondFmtCellIs`: ```go format.Value = c.Formula[0] ``` The branch above it handles `len(c.Formula) == 2`; this one is the fallback and does not check that there is a formula at all, so a `cellIs` rule with no `` child indexes an empty slice. `styles.go:3132`, in the colorScale extractor: ```go values := len(c.ColorScale.Cfvo) ``` `c.ColorScale` is a `*xlsxColorScale` and is nil when the `` element has no `` child. Lines 3148 and 3153 then index `Cfvo[1]` and `Cfvo[2]` in the three-colour branch with no length check either. `styles.go:3186`, `:3188` and `:3190`, in the dataBar extractor: ```go format.MinType = c.DataBar.Cfvo[0].Type ... format.BarColor = "#" + f.getThemeColor(c.DataBar.Color[0]) ``` The guard here is `c.DataBar != nil`, which says nothing about the length of `Cfvo` or `Color`, so an empty `` element reaches all three. ## Who the attacker is Anyone who can hand a spreadsheet to a service that open
osv:GHSA-rxcj-4pj5-74gr
github.com/xuri/excelize/v2
Fixed versions: 2.11.1-0.20260812075026-be7a16390fa6
Complete source record
{
"id": "9657ab589571f99dc09952f8f3f513196ece3998cd38c664997554fbcb81f02e",
"url": "https://osv.dev/vulnerability/GHSA-rxcj-4pj5-74gr",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Excelize: GetConditionalFormats indexes conditional-formatting rule sub-elements with no length or nil check",
"summary": "## Summary `GetConditionalFormats` reads sub-elements of a `` straight out of `xl/worksheets/sheetN.xml` and indexes them without checking length, and in one case without checking for nil. Three rule types are affected: `cellIs`, `dataBar` and `colorScale`. A workbook with a rule that is missing a child a real Excel file would always have panics the call. ## Where it is All three sinks are in `styles.go`, at the same line numbers in v2.11.0 and on master `d552a7e`. All three are reached from `GetConditionalFormats` through `styles.go:3271`. `styles.go:3003`, in `extractCondFmtCellIs`: ```go format.Value = c.Formula[0] ``` The branch above it handles `len(c.Formula) == 2`; this one is the fallback and does not check that there is a formula at all, so a `cellIs` rule with no `` child indexes an empty slice. `styles.go:3132`, in the colorScale extractor: ```go values := len(c.ColorScale.Cfvo) ``` `c.ColorScale` is a `*xlsxColorScale` and is nil when the `` element has no `` child. Lines 3148 and 3153 then index `Cfvo[1]` and `Cfvo[2]` in the three-colour branch with no length check either. `styles.go:3186`, `:3188` and `:3190`, in the dataBar extractor: ```go format.MinType = c.DataBar.Cfvo[0].Type ... format.BarColor = \"#\" + f.getThemeColor(c.DataBar.Color[0]) ``` The guard here is `c.DataBar != nil`, which says nothing about the length of `Cfvo` or `Color`, so an empty `` element reaches all three. ## Who the attacker is Anyone who can hand a spreadsheet to a service that open",
"evidence": "osv:GHSA-rxcj-4pj5-74gr",
"products": [
{
"name": {
"value": "github.com/xuri/excelize/v2",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "2.11.1-0.20260812075026-be7a16390fa6",
"evidence": "/affected/0/ranges"
}
],
"affected_versions": []
}
],
"severity": "medium",
"structured": {
"id": "GHSA-rxcj-4pj5-74gr",
"aliases": [
"CVE-2026-107222",
"GHSA-rxcj-4pj5-74gr"
],
"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.7.0"
},
{
"fixed": "2.11.1-0.20260812075026-be7a16390fa6"
}
]
}
],
"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-rxcj-4pj5-74gr/GHSA-rxcj-4pj5-74gr.json"
}
}
],
"modified": "2026-10-07T20:30:05.876273601Z",
"provider": "osv",
"references": [
"https://github.com/qax-os/excelize/security/advisories/GHSA-rxcj-4pj5-74gr",
"https://github.com/qax-os/excelize/pull/2375",
"https://github.com/qax-os/excelize/commit/be7a16390fa69c71d3ca618c741d1a2b5ed362cd",
"https://github.com/qax-os/excelize"
],
"provider_metadata": {
"cwe_ids": [
"CWE-129",
"CWE-476"
],
"severity": "MODERATE",
"github_reviewed": true,
"nvd_published_at": null,
"github_reviewed_at": "2026-10-07T20:22:54Z"
}
},
"related_cves": [
{
"value": "CVE-2026-107222",
"evidence": "/aliases"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 97230,
"published_at": "2026-10-07T20:22:54+00:00"
}