[MM-65701] Fix for docextractor archive handling (#34983) (#35792)

Automatic Merge
Этот коммит содержится в:
Mattermost Build
2026-03-26 08:31:04 +01:00
коммит произвёл GitHub
родитель 450dba8cad
Коммит 6838381cf9
2 изменённых файлов: 59 добавлений и 0 удалений

Просмотреть файл

@@ -41,6 +41,13 @@ func getExtAlsoTarGz(name string) string {
}
func (ae *archiveExtractor) Extract(name string, r io.ReadSeeker, maxFileSize int64) (string, error) {
// MM-65701: Skip 7zip files due to OOM vulnerability in bodgit/sevenzip library
match, _ := (archives.SevenZip{}).Match(context.Background(), name, r)
_, _ = r.Seek(0, io.SeekStart) // Reset reader position after Match reads from stream
if match.ByName || match.ByStream {
return "", nil
}
ext := getExtAlsoTarGz(name)
// Create a temporary file, using `*` control the random component while preserving the extension.