You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although in the Ansible output it was not specified which OS packages provided the conflicting Python packages, it appears that all SecureDrop instances are running out-of-date versions of colorama and six. I should have realized this was the case when I made #1302 as a fix to #856--the same phenomenon we'd use to our advantage in that PR is here a potentially serious problem.
colorama has no git history back to version 0.2.5 and the old Google Code page just redirects to the Github repo now. The changelog does not mention any security issues. Anyway, the only function that is called is colorama.init() by qrcode. No public Internet facing code uses the out-of-date colorama code. Also, as noted in #1352 (comment) a PR of mine was merged into qrcode such that colorama will no longer be a dependency in the next version of SD.
six again is only used by qrcode and does not seem to have had any security issues between 1.5.2 and the present.
I think it is safe to conclude that, very fortunately, this problem has not left us vulnerable. Had some Ubuntu base distro package or some other apt dependency of SD provided or pulled in and installed some out-of-date Python package that did include vulnerable code (or should this happen in the future) that would be a serious security issue. I think it's important we take care of this relatively quickly (again, not urgent because there's not actually a security issue here, just the potential for one) and ship out a 0.3.9 that fixes this and #856.
Great research here, @fowlslegs. Looks like the "owned by OS" functionality is coming from a Debian patch, as described here: pypa/pip#2964 (comment)
Definitely something we'll want to track more closely. At the very least, we can force our tests to confirm specific version numbers for the SD-related pip packages, so we can catch occurrences that affect packages more critical than colorama and six.
In terms of actually fixing the problem, two ideas come to mind:
leverage the Replaces control field in the Debian package for securedrop-app-code to ensure our version wins
write the wheel packages to a Python path separate from the OS-wide directory, and update the webserver config to read from that dedicated location
Okay, so our postinst scipt runs the command pip install --no-index --find-links=/var/securedrop/wheelhouse -r /var/www/securedrop/requirements/securedrop-requirements.txt, which installs packages to /usr/local/lib/python2.7/dist-packages. The colorama and six that aren't getting uninstalled because they're owned by OS packages are located under /usr/lib/python2.7/dist-packages. The sys.path variable determines which one gets loaded first:
Although in the Ansible output it was not specified which OS packages provided the conflicting Python packages, it appears that all SecureDrop instances are running out-of-date versions of
colorama
andsix
. I should have realized this was the case when I made #1302 as a fix to #856--the same phenomenon we'd use to our advantage in that PR is here a potentially serious problem.colorama
has no git history back to version 0.2.5 and the old Google Code page just redirects to the Github repo now. The changelog does not mention any security issues. Anyway, the only function that is called iscolorama.init()
byqrcode
. No public Internet facing code uses the out-of-datecolorama
code. Also, as noted in #1352 (comment) a PR of mine was merged intoqrcode
such thatcolorama
will no longer be a dependency in the next version of SD.six
again is only used byqrcode
and does not seem to have had any security issues between 1.5.2 and the present.I think it is safe to conclude that, very fortunately, this problem has not left us vulnerable. Had some Ubuntu base distro package or some other apt dependency of SD provided or pulled in and installed some out-of-date Python package that did include vulnerable code (or should this happen in the future) that would be a serious security issue. I think it's important we take care of this relatively quickly (again, not urgent because there's not actually a security issue here, just the potential for one) and ship out a 0.3.9 that fixes this and #856.
The text was updated successfully, but these errors were encountered: