Excelize: Unbounded spinCount in agile decryption burns CPU during OpenFile
Published 7 Oct 2026 · Updated 5 Nov 2026
Is your project on an affected github.com/xuri/excelize/v2?
Look after several Go apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected package
- Affected
- >=2.3.1 <2.11.1-0.20260906004932-2badfcd5841d
- Fixed in
- 2.11.1-0.20260906004932-2badfcd5841d
go get github.com/xuri/excelize/v2@v2.11.1-0.20260906004932-2badfcd5841dDetails
Opening a file whose first eight bytes are the OLE magic number sends excelize down the decryption path whether or not the caller set a password, or supports encrypted workbooks at all. openReaderAt (excelize.go:198-215) branches on the header alone, and agileDecrypt calls convertPasswdToKey before the verifier hash is checked, so the key-derivation loop runs spinCount times regardless.
spinCount (crypt.go:98) is a plain int filled by a bare xml.Unmarshal of the file's own EncryptionInfo stream. Nothing bounds it.
A 3072-byte file with spinCount 100000000 makes OpenFile take 58.65s on v2.11.0 with default options, then return zip: not a valid zip file. It is linear at about 0.6 microseconds per iteration and the attacker picks the number, so 1e9 is roughly ten minutes. Nothing on the path takes a context.Context, so the caller cannot cancel it; in an HTTP handler the write timeout returns a response while the goroutine keeps spinning. Memory stays flat at 24 MB, so nothing reclaims it either.
v2.5.0 spinCount=10000000 5.307s v2.9.1 spinCount=10000000 5.444s v2.11.0 spinCount=10000000 7.529s v2.11.0 spinCount=100000000 58.654s
The loop arrived with crypt.go in v2.3.1 and is unchanged through v2.11.0.
Excel and LibreOffice write spinCount 100000, which costs 61ms here, so a ceiling well above the legitimate value would cost real files nothing.
This is availability only, and it is not a vulnerability for a program that only opens files its own operator produced.
Is GHSA-jrfj-fhj2-jjvm in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected github.com/xuri/excelize/v2, and gives you the command that fixes it.
More advisories for github.com/xuri/excelize/v2
- LowCVE-2026-107225Excelize: GetStyle panics on a negative fillId, borderId or fontId in styles.xml in github.com/xuri/excelize · 5 Nov 2026
- LowCVE-2026-107218Excelize: RIGHT() on supplementary-plane text slices with a negative index and panics in github.com/xuri/excelize · 5 Nov 2026
- LowCVE-2026-107221Panic on out-of-order cell column references when reading worksheets in github.com/xuri/excelize · 5 Nov 2026
- LowCVE-2026-107217Integer overflow yields an out-of-domain coordinate with nil error, causing panic in github.com/xuri/excelize · 5 Nov 2026
- LowCVE-2026-107223Unbounded <col max> lacks MaxColumns check in flatCols(), causing column mutators to hang or OOM in github.com/xuri/excelize · 5 Nov 2026
- LowCVE-2026-107224Excelize: A Zip64 uncompressed-size of 2^63 panics OpenFile/OpenReader in github.com/xuri/excelize · 5 Nov 2026
References
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.