From 95aaf2c9eb8b13905216c30cfcd3e45ae5058b94 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Fri, 30 Oct 2026 14:04:59 +0100 Subject: [PATCH 1/2] Upgraded zip to v9 to fix security advisories --- CHANGELOG.md | 12 ++++++++++++ Cargo.toml | 2 +- src/container.rs | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f254a6b..cc3b166 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Changed + +- `Error::Zip` now wraps the `ZipError` of `zip` 9 instead of `zip` 8 + +### Security + +- Upgraded `zip` from 8.6.0 to 9.0.5, which fixes the advisories + GHSA-m665-v7pm-7grj, GHSA-q7v9-x93c-xqv3, GHSA-8hxf-qr8p-62x4, + GHSA-hjqx-j4rw-g7xv, and GHSA-9hj8-73fh-9963 + ## [1.0.0] - 2026-07-17 ### Added diff --git a/Cargo.toml b/Cargo.toml index 3b514b8..7da55eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,7 +42,7 @@ name = "slide_elements" path = "examples/slide_elements.rs" [dependencies] -zip = "8.6.0" +zip = "9.0.5" quick-xml = "0.41.0" thiserror = "2.0.18" base64 = "0.22.1" diff --git a/src/container.rs b/src/container.rs index b67e119..b72548b 100644 --- a/src/container.rs +++ b/src/container.rs @@ -56,7 +56,7 @@ impl PptxContainer { for i in 0..archive.len() { let file = archive.by_index(i)?; - let name = file.name().to_string(); + let name = file.name()?.to_string(); if name.starts_with("ppt/slides/slide") && name.ends_with(".xml") { slide_paths.push(name); From 540af00586d122c192093f6c42991ce015a67223 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Fri, 30 Oct 2026 14:10:18 +0100 Subject: [PATCH 2/2] Limited zip to the deflate compression --- CHANGELOG.md | 3 +++ Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc3b166..a889b3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - `Error::Zip` now wraps the `ZipError` of `zip` 9 instead of `zip` 8 +- `zip` now only enables the deflate compression, which PPTX and ODP files + use. This drops the dependencies for AES, bzip2, LZMA, PPMd, Zstandard, + and Deflate64 ### Security diff --git a/Cargo.toml b/Cargo.toml index 7da55eb..7514321 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,7 +42,7 @@ name = "slide_elements" path = "examples/slide_elements.rs" [dependencies] -zip = "9.0.5" +zip = { version = "9.0.5", default-features = false, features = ["deflate"] } quick-xml = "0.41.0" thiserror = "2.0.18" base64 = "0.22.1"