From: Peter Korsgaard <peter@korsgaard.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] utils/scanpypi: protect against zip-slip vulnerability in zip/tar handling
Date: Tue, 12 Feb 2019 21:45:38 +0100 [thread overview]
Message-ID: <87r2ccspl9.fsf@dell.be.48ers.dk> (raw)
In-Reply-To: <20190212203343.GQ3079@scaer> (Yann E. MORIN's message of "Tue, 12 Feb 2019 21:33:43 +0100")
>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:
Hi,
> As I said on IRC: I would really prefer if we could reject archive that
> do have paths merely containiug /../ components, because those are
> already fishy, even if they still point in-tree, e.g. foo/../bar is
> still technically OK, but why the heck would it be constructed that way
> to begin with? Normal archivers do not do that.
Agreed, but that code seems somewhat more complicated to me, and I
wanted the simplest possible solution.
> But making the path canonical with relpath() is already better than the
> current situation, so:
> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Yet, a little tiny comment, below:
>> + if evil:
>> + print('ERROR: Refusing to extract {} with suspicious members {}'.format(
>> + self.filename, evil))
> I would have sent that to stderr: print(..., file=sys.stderr)
Correct, but scanpypi sems (almost all) error messages to stdout, so I
kept it like this for consistency.
--
Bye, Peter Korsgaard
next prev parent reply other threads:[~2019-02-12 20:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-11 22:22 [Buildroot] [PATCH] utils/scanpypi: protect against zip-slip vulnerability in zip/tar handling Peter Korsgaard
2019-02-12 20:27 ` Peter Korsgaard
2019-02-12 20:33 ` Yann E. MORIN
2019-02-12 20:45 ` Peter Korsgaard [this message]
2019-02-21 12:54 ` Peter Korsgaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r2ccspl9.fsf@dell.be.48ers.dk \
--to=peter@korsgaard.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox