<feed xmlns='http://www.w3.org/2005/Atom'>
<title>apt/test/integration, branch 2.1.15</title>
<subtitle>Debians commandline package manager</subtitle>
<id>https://git.kalnischkies.de/apt/atom?h=2.1.15</id>
<link rel='self' href='https://git.kalnischkies.de/apt/atom?h=2.1.15'/>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/'/>
<updated>2020-12-18T18:31:19Z</updated>
<entry>
<title>Implement encoded URI handling in all methods</title>
<updated>2020-12-18T18:31:19Z</updated>
<author>
<name>David Kalnischkies</name>
<email>david@kalnischkies.de</email>
</author>
<published>2020-07-09T22:02:25Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=97d6c3b2d05fe0d965657197adf56cc78f9edf81'/>
<id>urn:sha1:97d6c3b2d05fe0d965657197adf56cc78f9edf81</id>
<content type='text'>
Every method opts in to getting the encoded URI passed along while
keeping compat in case we are operated by an older acquire system.

Effectively this is just a change for the http-based methods as the
others just decode the URI as they work with files directly.
</content>
</entry>
<entry>
<title>Keep URIs encoded in the acquire system</title>
<updated>2020-12-18T18:31:19Z</updated>
<author>
<name>David Kalnischkies</name>
<email>david@kalnischkies.de</email>
</author>
<published>2020-07-09T14:38:49Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=e6c55283d235aa9404395d30f2db891f36995c49'/>
<id>urn:sha1:e6c55283d235aa9404395d30f2db891f36995c49</id>
<content type='text'>
We do not deal a lot with URIs which need encoding, but then we do it is
a pain that we store it decoded in the acquire system as it means we
have to decode and reencode URIs eventually which is potentially giving
us slightly different URIs.

We see that in our own testing framework while setting up redirects as
the config options are effectively double-encoded and decoded to pass
them around successfully as otherwise %2f and / in an URI are treated
the same.

This commit adds the infrastructure for methods to opt into getting URIs
send in encoded form (and returning them to us in encoded form, too) so
that we eventually do not have to touch the URIs which is how it should
be. This means though that we have to deal with methods who do not
support this yet (aka: all at the moment) for which we decode and encode
while communicating with them.
</content>
</entry>
<entry>
<title>Proper URI encoding for config requests to our test webserver</title>
<updated>2020-12-18T18:02:05Z</updated>
<author>
<name>David Kalnischkies</name>
<email>david@kalnischkies.de</email>
</author>
<published>2020-07-08T15:51:40Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=97be873d782c5e9aaa8b4f4f4e6e18805d0fa51c'/>
<id>urn:sha1:97be873d782c5e9aaa8b4f4f4e6e18805d0fa51c</id>
<content type='text'>
Our http method encodes the URI again which results in the double
encoding we have unwrap in the webserver (we did already, but we skip
the filename handling now which does the first decode).
</content>
</entry>
<entry>
<title>test: fixup for hash table size increase (changed output order)</title>
<updated>2020-12-15T12:20:16Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>julian.klode@canonical.com</email>
</author>
<published>2020-12-15T12:20:16Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=b6c8c5ce2b255eb03554435a620934d47a2a14d5'/>
<id>urn:sha1:b6c8c5ce2b255eb03554435a620934d47a2a14d5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>CVE-2020-27350: tarfile: integer overflow: Limit tar items to 128 GiB</title>
<updated>2020-12-09T16:30:43Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>julian.klode@canonical.com</email>
</author>
<published>2020-12-05T18:55:30Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=df81895bce764dd02fbb4d67b92d28a730b5281f'/>
<id>urn:sha1:df81895bce764dd02fbb4d67b92d28a730b5281f</id>
<content type='text'>
The integer overflow was detected by DonKult who added a check like this:

(std::numeric_limits&lt;decltype(Itm.Size)&gt;::max() - (2 * sizeof(Block)))

Which deals with the code as is, but also still is a fairly big limit,
and could become fragile if we change the code. Let's limit our file
sizes to 128 GiB, which should be sufficient for everyone.

Original comment by DonKult:

The code assumes that it can add sizeof(Block)-1 to the size of the item
later on, but if we are close to a 64bit overflow this is not possible.
Fixing this seems too complex compared to just ensuring there is enough
room left given that we will have a lot more problems the moment we will
be acting on files that large as if the item is that large, the (valid)
tar including it probably doesn't fit in 64bit either.
</content>
</entry>
<entry>
<title>CVE-2020-27350: debfile: integer overflow: Limit control size to 64 MiB</title>
<updated>2020-12-09T16:30:43Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>julian.klode@canonical.com</email>
</author>
<published>2020-12-05T19:17:56Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=0444f9dd52c2bc7bec315f6f1ecad76a30713fa0'/>
<id>urn:sha1:0444f9dd52c2bc7bec315f6f1ecad76a30713fa0</id>
<content type='text'>
Like the code in arfile.cc, MemControlExtract also has buffer
overflows, in code allocating memory for parsing control files.

Specify an upper limit of 64 MiB for control files to both protect
against the Size overflowing (we allocate Size + 2 bytes), and
protect a bit against control files consisting only of zeroes.
</content>
</entry>
<entry>
<title>tarfile: OOM hardening: Limit size of long names/links to 1 MiB</title>
<updated>2020-12-09T16:30:43Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>julian.klode@canonical.com</email>
</author>
<published>2020-12-04T11:37:19Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=822db13d68658a1a20df2d19c688c18faa331616'/>
<id>urn:sha1:822db13d68658a1a20df2d19c688c18faa331616</id>
<content type='text'>
Tarballs have long names and long link targets structured by a
special tar header with a GNU extension followed by the actual
content (padded to 512 bytes). Essentially, think of a name as
a special kind of file.

The limit of a file size in a header is 12 bytes, aka 10**12
or 1 TB. While this works OK-ish for file content that we stream
to extractors, we need to copy file names into memory, and this
opens us up to an OOM DoS attack.

Limit the file name size to 1 MiB, as libarchive does, to make
things safer.
</content>
</entry>
<entry>
<title>CVE-2020-27350: arfile: Integer overflow in parsing</title>
<updated>2020-12-09T16:30:43Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>julian.klode@canonical.com</email>
</author>
<published>2020-10-19T11:22:33Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=d10c68d628fe5342d400a999a6d10c5c7c0cef41'/>
<id>urn:sha1:d10c68d628fe5342d400a999a6d10c5c7c0cef41</id>
<content type='text'>
GHSL-2020-169: This first hunk adds a check that we have more files
left to read in the file than the size of the member, ensuring that
(a) the number is not negative, which caused the crash here and (b)
ensures that we similarly avoid other issues with trying to read too
much data.

GHSL-2020-168: Long file names are encoded by a special marker in
the filename and then the real filename is part of what is normally
the data. We did not check that the length of the file name is within
the length of the member, which means that we got a overflow later
when subtracting the length from the member size to get the remaining
member size.

The file createdeb-lp1899193.cc was provided by GitHub Security Lab
and reformatted using apt coding style for inclusion in the test
case, both of these issues have an automated test case in
test/integration/test-ubuntu-bug-1899193-security-issues.

LP: #1899193
</content>
</entry>
<entry>
<title>test-method-rred: Use apthelper instead of apt-helper</title>
<updated>2020-12-02T15:41:40Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2020-12-02T15:41:40Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=eefadade6e886d9423c5d3145858891047c46abc'/>
<id>urn:sha1:eefadade6e886d9423c5d3145858891047c46abc</id>
<content type='text'>
Fixes lookup in as-installed testing

Gbp-Dch: ignore
</content>
</entry>
<entry>
<title>Merge branch 'feature/rred' into 'master'</title>
<updated>2020-11-25T18:02:03Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2020-11-25T18:02:03Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=6530ce64d2337ab309d6c974202243abb09d2d04'/>
<id>urn:sha1:6530ce64d2337ab309d6c974202243abb09d2d04</id>
<content type='text'>
Enhance rred for possible external usage

See merge request apt-team/apt!136</content>
</entry>
</feed>
