Skip to content

fetch2: harden deb/ipk unpack command argument

Anders Heimer bitbake-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2fetch2: validate deb/ipk data member nameslib/bb/fetch2/__init__.py lib/bb/tests/fetch.py+60 -30 replies
2/2fetch2: validate striplevel parameterlib/bb/fetch2/__init__.py lib/bb/tests/fetch.py+14 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] fetch2: harden deb/ipk unpack command argument

Hi,

This series hardens fetch2 unpack handling in two small, separate steps.

The first patch fixes deb/ipk unpack handling by selecting the data archive member only from the set of supported data member names. This avoids passing unsupported ar member names through to the shell command. It also quotes the package path used by the deb/ipk unpack command.

The second patch is separate hardening for the striplevel parameter, which is appended to tar arguments before the unpack command is run. It validates striplevel as a decimal component count before using it.

Regression coverage is added to FetcherLocalTest for supported deb/ipk data members, unsupported data member names, quoted package filenames, and invalid striplevel values.

Tests run:
BB_SKIP_NETTESTS=yes bin/bitbake-selftest bb.tests.fetch.FetcherLocalTest

Anders Heimer (2):
fetch2: validate deb/ipk data member names
fetch2: validate striplevel parameter

 lib/bb/fetch2/__init__.py | 15 +++++++---
 lib/bb/tests/fetch.py     | 63 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 74 insertions(+), 4 deletions(-)
Signature · 1 line
2.34.1