As you might know, with PEP 476, since Python 3.5 (backported to 3.4.3 and 2.7.9) tls certificates are now checked for their validity.
Lack of validation leaves software exposed to mitm, so I think it's fairly uncontroversial to think of the update 2.7.8 -> 2.7.9 as a security update.
Recently I found myself using my old laptop, running Ubuntu LTS instead of the latest and greatest. After running updates and setting up the environment to work on some python code, I realized that the version for the python2 interpreter seemed suspiciously low: 2.7.5-5ubuntu3
You can check yourself the version online:
latest python2.7 on latest ubuntu (as of 26th December 2015) is 2.7.9-1
latest python2.7 on latest ubuntu lts (as of 26th December 2015) 2.7.5-5ubuntu3
This doesn't necessarily means that it doesn't ship the 2.7.9 changes, because they could've been backported (though I find it suspicious, due to the huge change in the ssl module, I'd expect it easier to adopt 2.7.9 wholesale rather than backporting the patches)... so I tried to open up a page with a certificate that's not commonly accepted (e.g. https://cacert.org ) and, to my dismay, no exception was raised.
For comparison, with a newer Python:
>>> urlopen('https://cacert.org') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.7/urllib.py", line 87, in urlopen return opener.open(url) [...SNIP...] File "/usr/lib/python2.7/ssl.py", line 808, in do_handshake self._sslobj.do_handshake() IOError: [Errno socket error] [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)
It has now been more than 1 year since Python 2.7.9 has been released, and both Ubuntu 14.04.2 and 14.04.3 have been released in the meanwhile, so if it hasn't been backported, it's not because they were waiting for a dot-release of the LTS.
An example of how things might be affected by this change: At my previous job, I found an internal script that was scheduled to connect and authenticate to an internal https-only website to report some information, such internal website relied on an internal root certificate. The script didn't fail, even if the root CA was not available to it, only thanks to the lack of this check. The credentials were stored safely on disk, but (as risky as it would've been to do it in a work environment) being on the same network it could've been possible to do a mitm attack to steal these credentials.
This is interesting because updating to 2.7.9 would both solve the potential security issue with that script, and make the script stop working until fixed. I thus thought that an explanation for why this hasn't been backported to Ubuntu LTS might be the risk in breaking existing code, but I'm not persuaded.
While I'm at it, here's the code to fix such broken code, by doing certificate pinning (actually only the CA is pinned) for the benefit of people who might stumble on this, since it's really trivial but there are not a lot of examples around:
Whatever the reason for not shipping this security fix, there's often expectation that (barring 0 days and newly discovered vulnerabilities) having a system of a supported OS version, with all of the system updates installed (and kept up-to-date subsequently) gives you a secure foundation over which to build a system (which will then be made insecure with misconfigurations and custom code).
I was a bit unsure if I should ask this over unix.stackexchange.com or somewhere else, anyhow I tried to have a look for documentation on the policy used by the Ubuntu maintainers   , and I don't see anywhere that could explain why some fixes might not qualify to be backported. OTOH security support means:
[they] provide security updates for supported software in the Ubuntu distribution.
Nowhere it's written that such updates are complete and exhaustively cover every security issue known by the maintainers. Ok, FOSS software often/always has the "No warranty" clause/disclaimer, but I'm not concerned about that.
I'm concerned with the mismatching expectations that IT professionals and the world at large have over security updates, and what can actually be provided: After all, not every software project has different releases still supported, and if it's still in active development, it might not be feasible to backport such fixes to older versions (ok, it might be argued that such software shouldn't belong in the Ubuntu main repositories). Sometimes security issues might be fixed upstream, without the developers realizing they were security issues in the first place, and so no one will realize the need for backporting these. And this is assuming that the maintainers are infallible beings that won't commit mistakes.
There's a question that asks about a similar problem but from a different angle: PCI compliance. I'd expect such a standard to be both more-strict than best practices for normal server/workstation deployments, and also not as comprehensive as needed to cover every possible case (after all, standards are formalized only after enough people take notice). So for PCI compliance that might be only needed to "tick a checkbox", but it'd be worrying if even to follow best practices it wasn't enough just to run the system updates, but we'd need to also keep track with upstream for every single piece of software running on a system.
OTOH, if we truly have to take ownership of all of this, it would force us in the direction of having less to deal with, a smaller attack surface and fewer moving parts... Maybe scrapping Linux or a full-fledged OS altogether and only run Unikernels on server...
So, what is/could be the rationale for not choosing to backport such fixes? Is it documented?
PS: After writing this, I found this other stackexchange question
The upstream version of Python 2.7 in Ubuntu 14.04 will always be 2.7.6.
This is a bit at odds with my understanding of the wiki, since potentially Ubuntu could ship 2.7.9 for Trusty. The answerer anyhow doesn't seem to be affiliated with Canonical/Ubuntu, he also writes:
Since 2.7.9 will be part of Ubuntu 15.04, I'd expect an update around the time 14.04.2 releases, if ever. The corresponding Launchpad bug is as yet unassigned.
So, with 14.04.2 nothing obviously changed. One user on Launchpad mentions:
As for backporting to older releases I don't know, but it should be possible to add a request once the package has landed in Vivid.
I know that there's a process to request normal backports in Debian/Ubuntu, but that shouldn't apply for security updates.