Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2024-08-16
07:23 • Closed ticket [a47b587499]: zipfs should not be available to safe interps pl... artifact: abfcd9e183 user: apnadkarni
2024-08-05
13:43 • Ticket [a47b587499]: 3 changes artifact: 5094443352 user: apnadkarni
13:36
Make zipfs inaccessible to safe interps. See bug [a47b587499] check-in: a0d527efb5 user: apnadkarni tags: zipfs-consolidation
2024-08-04
05:37 • Ticket [a47b587499] zipfs should not be available to safe interps status sti... artifact: 684c176b9c user: apnadkarni
05:36
Bug [a47b587499]. zipfs in safe interps check-in: 7ed1d50269 user: apnadkarni tags: bug-a47b587499
2024-08-02
22:06 • Ticket [a47b587499] zipfs should not be available to safe interps status sti... artifact: 9837ff72d8 user: tberg
2023-09-10
08:14 • New ticket [a47b587499]. artifact: 2980869eab user: apnadkarni

zipfs should not be available to safe interps

Closed / Fixeda47b5874991375da39724508e8ae84b6002f5315Created 3 years agoUpdated 2 years ago
Descriptionmarkdown2023-09-10 08:14:18

zipfs mounted archives should be subject to same safe interp restrictions for file system access as native files. However, the exists and info commands are allowed.

% set safe [interp create -safe]
interp0
% interp0 eval {zipfs mount}
not allowed to invoke subcommand mount of zipfs
% interp0 eval {zipfs exists //zipfs:/test/test}
1
% interp0 eval {zipfs info //zipfs:/test/test}
D:/src/tcltk/wip/tcl/tests/zipfiles/test.zip 5 5 55

TIP 430 says specifically Unlike file exists this command is safe to run in a safe interp, because it confers no access to the local file system.

This does not make sense to me. Local file system is not the only resource that should be protected. An application may choose to store any kind of information within an archive and these should be afforded the same level of protection from malicious code in safe interps as for native file systems. If exists is not allowed for the latter, zipfs exists|info should not be allowed either for archives.

Referenced by2
tbergmarkdown2024-08-02 22:06:54

I agree. If file exists is not allowed, the rationale is that safe interpreters should not be able to see whether a specific file exists or not. Whether the file is on disk or in an attached ZIP should not make any difference.

Rather the opposite seems true. An attached ZIP is likely to contain files critical for the execution of the program. So, it could be considered dangerous allowing to see them as this might open the door for manipulations. And ... as they cannot be mounted and thus read anyway, why would you want to check for their existence?

apnadkarnimarkdown2024-08-04 05:37:30

My inclination is to remove zipfs completely from safe interps. All commands leak file system information of one kind or another.

Proposed implementation is in branch bug-a47b587499.

apnadkarniplain2024-08-05 13:43:17
Merged into zipfs-consolidation branch.
apnadkarniplain2024-08-16 07:23:02
Fixed in [d4dd94ab5c]. zipfs no longer available in safe interps.
Log in (anonymous is fine) to add a comment.