Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2026-10-21
10:03 • Closed ticket [c315de9e44]: Password protected zip files can be rewritten withou... artifact: b7b7cf9eb4 user: serhiy.storchaka
2024-08-22
17:25
Merge [bea92dfdc5efd604]: Fix [6d2ef441cc], [c315de9e44] - zipfs password bugs. check-in: 2966a0827c user: pooryorick tags: unchained, INCOMPATIBLE_LICENSE
2023-09-30
16:34 • Ticket [c315de9e44] Password protected zip files can be rewritten without the pa... artifact: 79c70b534c user: apnadkarni
2023-09-29
12:05 • Ticket [c315de9e44]: 3 changes artifact: 254fc27179 user: apnadkarni
08:40 • Pending ticket [c315de9e44]. artifact: 7097aa6332 user: jan.nijtmans
03:35 • Closed ticket [c315de9e44]. artifact: a1558dcda8 user: apnadkarni
03:31
Merge 8.7 - Fix [6d2ef441cc], [c315de9e44] - zipfs password bugs check-in: bea92dfdc5 user: apnadkarni tags: trunk, main
03:09
Fix [6d2ef441cc], [c315de9e44] - zipfs password bugs check-in: 9c204498a8 user: apnadkarni tags: core-8-branch
2023-09-28
16:26
Proposed fix for [c315de9e44] check-in: ad3a393e8c user: apnadkarni tags: apn-zipfs-password
16:01 • Ticket [c315de9e44] Password protected zip files can be rewritten without the pa... artifact: 083a6db758 user: apnadkarni
15:45 • Ticket [c315de9e44]: 3 changes artifact: 9a0ac35bc3 user: chw
11:29 • Ticket [c315de9e44]: 3 changes artifact: 5f51182046 user: apnadkarni
2023-09-27
16:31 • Ticket [c315de9e44]: 4 changes artifact: e87fa0ed7a user: chw
15:16 • New ticket [c315de9e44]. artifact: 9769972f62 user: apnadkarni

Password protected zip files can be rewritten without the password

Closed / Fixedc315de9e44213d74d546088a65512ba797b8e3daCreated 3 years agoUpdated 43 days ago
Descriptionmarkdown2023-09-27 15:16:47

Password protected files are protected from reading but not writing.

% zipfs mount ../tests/zipfiles/test-password.zip [zipfs root]
% set fd [open [file join [zipfs root] cipher.bin]]
decryption failed - no password provided
% set fd [open [file join [zipfs root] cipher.bin] w]
zipfs_14c_1
% puts $fd "new data"
% close $fd
% set fd [open [file join [zipfs root] cipher.bin]]
zipfs_0_2
% gets $fd
new data
% close $fd
Referenced by4
chwplain2023-09-27 16:31:56
Ashok, I've taken the liberty to change the ticket title replacing modified
by rewritten. Why? Since those files can be only written from scratch. 
Modification would require prior knowledge of content which isn't given
due to not having the password for decoding the file.

Which brings us to discussion of the use(full|less)ness of being able to
non-persistently modifying mounted ZIP filesystems. When I added this
(deliberately undocumented) feature I was thinking of temporarily
monkey patching stuff, not to have it as an assured property of the
ZIP filesystem.
apnadkarniplain2023-09-28 11:29:35
Sure, no problem changing the title.

I'm also chewing on the usefulness of a writable zip file system which is not persisted. I feel it would have some uses but is somewhat incomplete at the moment, e.g. write size being limited at open time. Not completely crystallized in my mind as to whether to postpone to a future release or not.

Either way manpages need to be updated to either say zipfs is read-only (and change implementation accordingly) or state the limitations (no new files or directories, size limits etc.)

Still ruminating on what direction to propose ...
chwplain2023-09-28 15:45:03
What about booking this feature under the ::tcl::unsupported::*
category then? And indeed is the ZIPFS unwritable as long as the
magic *::wrmax isn't changed from its zero default.
apnadkarniplain2023-09-28 16:01:13
That's one possibility. Right now I'm focused on working through the pending bugs. Let's see where things stand after that.
apnadkarniplain2023-09-29 03:35:47
Fixed in [9c204498a8].
jan.nijtmanswiki2023-09-29 08:40:21
apnadkarniplain2023-09-29 12:05:47
Disabled password related tests on MacOS.
apnadkarniplain2023-09-30 16:34:47
This bug is assigned to me, presumably by Jan. However, someone with Mac access and familiarity with that platform will need to pick this up. Tests run without error on Windows and Linux.
serhiy.storchakawiki2026-10-21 10:03:38

Fixed in 9.0.0 by [9c204498a8] (trunk: [bea92dfdc5]): encrypted members can no longer be opened for writing without the password. The macOS-only test failures are tracked in [bbe7c6ff9e].

Log in (anonymous is fine) to add a comment.