ReadiumShared links the whole marmelroy/Zip library although only the Minizip C module is imported
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 45/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- build-system, security
Research direction
Start with Package.swift and Sources/Shared/Toolkit/ZIP/Minizip/MinizipContainer.swift, then compare the dependency options described in the issue; the issue notes that Minizip was deliberately restored in #551 and #548. Confirm the chosen approach with maintainers before starting, since the issue asks for direction; done means downstream apps no longer link the Swift Zip library, with the ZIP opener choice unchanged.
Written by the indexing model from the issue text.
Description
ReadiumShared declares "Zip" — the Swift library product of marmelroy/Zip — as a target dependency, but the only module the toolkit imports from that package is the C target Minizip. The Swift wrapper is therefore compiled and linked into every downstream app, and it carries CVE-2023-39135 with no fixed version in existence.
To be explicit about what we are not claiming: we do not say the vulnerable path is reachable from Readium. It is not — the traversal is in the Swift on-disk unzip helper, which the toolkit never calls. The cost is elsewhere: every downstream app's Package.resolved pins a package with a permanently unfixable high-severity advisory, and there is no version to move to, so each dependency scan has to be answered by hand, forever.
What is actually imported
swift-toolkit 3.11.0 (d82f44f4f05d87add9e22a8b75abbd61dce745dd), and unchanged on current develop:
Package.swift:27—.package(url: "https://github.com/marmelroy/Zip.git", from: "2.1.2")(develop:22)Package.swift:42—"Zip"among the dependencies of targetReadiumShared(develop:33)- the only import from that package anywhere in
Sources/:Sources/Shared/Toolkit/ZIP/Minizip/MinizipContainer.swift:8—import Minizip grep -rn "^import Zip" Sources/— no match
Minizip is reachable only transitively: marmelroy/Zip exposes a single product, .library(name: "Zip", targets: ["Zip"]), and Minizip is a target underneath it (Zip/Package.swift:8-23).
What ends up in the binary
Measured with nm over the payload of our shipping app (Xcode 26, iOS 26 simulator, Debug):
nm fancai.debug.dylib | grep -c ' T _$s3Zip' -> 57 exported Swift `Zip` symbols
nm fancai.debug.dylib | grep -c '$s3Zip' -> 205 all `Zip` module symbols
nm fancai.debug.dylib | grep -cE ' T _(unz|zip)' -> 56 minizip C functions, the part you use
The advisory
GHSA-g454-wj9r-jpg4 / CVE-2023-39135, severity high, "Path traversal in Zip Swift":
vulnerable_version_range: <= 2.1.2
first_patched_version: null
2.1.2 is the newest tag of marmelroy/Zip, published 2022-02-23, and the repository's last push is 2024-08-05T18:42:46Z (api.github.com/repos/marmelroy/Zip, checked 2026-09-13). There is nothing to update to, and no sign that there will be.
Ask
Stop shipping the Swift Zip library to downstream apps. Any of these closes it, in our order of preference:
- Vendor the minizip C sources into the toolkit — for instance a
ReadiumMinizipC target — and drop themarmelroy/Zippackage dependency entirely. This is the only option that also removes the pin from downstreamPackage.resolved. - Take minizip from a maintained distribution instead.
- If the sources must keep coming from that package, ask upstream to expose
Minizipas its own product and depend on.product(name: "Minizip", package: "Zip"). That removes the Swift code from the link, butPackage.resolvedwould still carry the advisory.
We know Minizip is back deliberately (#551, #548) and stays until the ZIPFoundation ArchiveOpener is battle-tested — this issue is only about where those C sources come from, not about the choice of opener.
We can prepare a PR for option 1 if that is the direction you would take.
- Dominant language
- Swift
- Stars
- 557
- Forks
- 249
- Avg merge
- 3h 52m
- Merged PRs (30d)
- 19
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from readium/swift-toolkit
-
triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
readium/swift-toolkit#954 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
readium/swift-toolkit#841 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 57/100
readium/swift-toolkit#961 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
readium/swift-toolkit#959 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
readium/swift-toolkit#953 ·
Maintainers usually reply within 1 day
All issues in readium/swift-toolkit
Similar issues
-
area: models enhancement needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
rexmhall09/TUFF#69 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nikitabobko/AeroSpace#2427 · 1 comment ·
Maintainers usually reply within 8 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Maintainers usually reply within 1 day
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
A second click on the Control Center widget doesn't close Control CenterPossibly taken @MaHofseth claimed this today. Openneeds-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100