security improvements#951
Conversation
b589702 to
25eb2cf
Compare
tommady
left a comment
There was a problem hiding this comment.
Hi, thanks for the contribution!
I left a comment.
One small thing I noticed: it looks like LimitedReader went on vacation and didn’t make it into:
- tar
- rar
Might be worth inviting it back for consistency (and so things don’t get… too unlimited). 😄
tommady
left a comment
There was a problem hiding this comment.
I'd love your validate_dest_inside_root check!
it is a very clever and highly performant way than canonicalization.
@marcospb19 please help check this
thank you
|
@marcospb19 could this be merged for the next releases? it does fix several security holes after all. |
|
rebased to resolve conflicts |
|
The limiter is now removed again because this may break some use cases |
I apologize for leaving you hanving. We had a bug for 6 months where With that fixed in 0.8.0, I can now turn my attention into this. |
|
I will now solve conflicts and take a thoughtful look. |
|
Polite ask, in a next PR please commit these separatedly so I can know what I'm reviewing. People usually ask for separate PRs but separate commits make it easier too, I tried reviewing this before and had the same trouble, as I keep confusing what every fix is with unrelated code. |
|
Thanks for the work on resolving these security issues! After this is released I plan to include |
|
Perhaps we can open an issue to track incorporating this in CI https://github.com/ouuan/ZipDiff (not the entire suite of course) |
Multiple problems affecting security
../paths escape the output directory, becausePathBuf::joinreplaces the base when the second arg is absolute.path.display(), so an archive can inject ESC sequences, BiDi overrides (CVE-2021-42574), zero-width chars, etc.decompressandlist.LZMA memory limit is set tou32::MAX(4 GiB) in bothdecompress.rsandlist.rs.--passwordon the command line leaks viapsand shell history; no env var alternative exists.