This week we look at some details of the 46 unique CVEs addressed across the supported Ubuntu releases and take a deep dive into the recent apt security bug.
Show Notes
Overview
This week we look at some details of the 46 unique CVEs addressed across the supported Ubuntu releases and take a deep dive into the recent apt security bug.
NTP updated for Bionic, Artful, Xenial and Trusty in July 2018 - this is the corresponding update for Precise ESM
Multiple issues including: RCE in ntpq from a crafted response from
the server, various DoS at both protocol level between client and
server (disrupt a client talking to server) and at application level
(to crash the application)
apt uses worker processes which communicate back to the main process when fetching content
workers get told what to download and where to put it and communicate back with parent via stdin/stdout
protocol is like HTTP, human readable text
can include directives from workers regarding redirects, completion (DONE) etc
when handling a HTTP Redirect from the server, apt http worker would append this contents in message sent back to parent
expect just a URI as the redirect content but could be anything - so could contain directives in the apt worker protocol which then get interpreted by the main apt process
so could signal DONE to parent as well as follow-up directives such as reporting false hashes for debs or even falsifying the location of the deb on the filesystem
So could use the Releases.gpg file as the location of the package on the filesystem - and actually inject our malicious package into the start of Releases.gpg - with trusted Releases.gpg content afterwards
Releases.gpg will still validate (since it ignores junk at the start) AND apt will still use the package since it will ignore the signature at the end
So can get malicious package installed - which due to debian packaging can run scripts on install etc and hence get RCE as root :(
Fixed by simply disallowing control characters in HTTP redirect responses
If we assume the mirrors are trusted, could have been mitigated via HTTPS
Since HTTPS would stop MITM attacks
Some Ubuntu mirrors offer HTTPS but this is not enabled by default since not all mirrors offer HTTPS
Official mirrors do not currently offer HTTPS - this is being reevaluated but is difficult for a number of reasons
Users can still easily enable HTTPS themselves by choosing an appropriate mirror with a HTTPS URI
If assume mirrors are untrusted then they could still have exploited this
So whilst HTTPS could help in this case is not a panacea