Lucene search

K
osvGoogleOSV:GO-2021-0264
HistoryJan 13, 2022 - 8:54 p.m.

Panic when opening certain archives in archive/zip

2022-01-1320:54:43
Google
osv.dev
17
panic mitigation
archive/zip
file skipping
defense-in-depth
file accessibility

AI Score

7.9

Confidence

High

EPSS

0.003

Percentile

70.9%

Previously, opening a zip with (*Reader).Open could result in a panic if the zip contained a file whose name was exclusively made up of slash characters or โ€œโ€ฆโ€ path elements.

Open could also panic if passed the empty string directly as an argument.

Now, any files in the zip whose name could not be made valid for fs.FS.Open will be skipped, and no longer added to the fs.FS file list, although they are still accessible through (*Reader).File.

Note that it was already the case that a file could be accessible from (*Reader).Open with a name different from the one in (*Reader).File, as the former is the cleaned name, while the latter is the original one.

Finally, the actual panic site was made robust as a defense-in-depth measure.