[GH-ISSUE #3164] end of python2 #1983

Closed
opened 2026-05-05 08:38:48 -06:00 by gitea-mirror · 22 comments
Owner

Originally created by @rusty-snake on GitHub (Jan 18, 2020).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3164

The Python 2 language, i.e. Python 2.7.x, was officially discontinued on January 1, 2020 (first planned for 2015) after which security patches and other improvements will not be released for it. With Python 2's end-of-life, only Python 3.5.x and later are supported.

Source: https://en.wikipedia.org/wiki/Python2

Python2 is getting a security risk. Till it's completely dead we should remove include allow-python2.inc from every profile where it's not requiered. We could also add disable-python2.inc for profiles where we can't add disable-interpreters.inc.

List of profile with include allow-python2.inc:

Originally created by @rusty-snake on GitHub (Jan 18, 2020). Original GitHub issue: https://github.com/netblue30/firejail/issues/3164 > The Python 2 language, i.e. Python 2.7.x, was officially discontinued on January 1, 2020 (first planned for 2015) after which security patches and other improvements will not be released for it. With Python 2's end-of-life, only Python 3.5.x and later are supported. _Source: https://en.wikipedia.org/wiki/Python2_ Python2 is getting a security risk. Till it's completely dead we should remove `include allow-python2.inc` from every profile where it's not requiered. We could also add `disable-python2.inc` for profiles where we can't add `disable-interpreters.inc`. List of profile with `include allow-python2.inc`: - [ ] [anki.profile](https://github.com/netblue30/firejail/blob/master/etc/anki.profile) - [ ] [arm.profile](https://github.com/netblue30/firejail/blob/master/etc/arm.profile) - [ ] [autokey-common.profile](https://github.com/netblue30/firejail/blob/master/etc/autokey-common.profile) - [ ] [bleachbit.profile](https://github.com/netblue30/firejail/blob/master/etc/bleachbit.profile) - [ ] [blender.profile](https://github.com/netblue30/firejail/blob/master/etc/blender.profile) - [ ] [caja.profile](https://github.com/netblue30/firejail/blob/master/etc/caja.profile) - [ ] [cameramonitor.profile](https://github.com/netblue30/firejail/blob/master/etc/cameramonitor.profile) - [ ] [catfish.profile](https://github.com/netblue30/firejail/blob/master/etc/catfish.profile) - [ ] [celluloid.profile](https://github.com/netblue30/firejail/blob/master/etc/celluloid.profile) - [ ] [cherrytree.profile](https://github.com/netblue30/firejail/blob/master/etc/cherrytree.profile) - [ ] [ddgtk.profile](https://github.com/netblue30/firejail/blob/master/etc/ddgtk.profile) - [ ] [deluge.profile](https://github.com/netblue30/firejail/blob/master/etc/deluge.profile) - [ ] [d-feet.profile](https://github.com/netblue30/firejail/blob/master/etc/d-feet.profile) - [ ] [dia.profile](https://github.com/netblue30/firejail/blob/master/etc/dia.profile) - [ ] [display.profile](https://github.com/netblue30/firejail/blob/master/etc/display.profile) - [ ] [electrum.profile](https://github.com/netblue30/firejail/blob/master/etc/electrum.profile) - [ ] [exfalso.profile](https://github.com/netblue30/firejail/blob/master/etc/exfalso.profile) - [ ] [filezilla.profile](https://github.com/netblue30/firejail/blob/master/etc/filezilla.profile) - [ ] [flowblade.profile](https://github.com/netblue30/firejail/blob/master/etc/flowblade.profile) - [ ] [fontforge.profile](https://github.com/netblue30/firejail/blob/master/etc/fontforge.profile) - [ ] [font-manager.profile](https://github.com/netblue30/firejail/blob/master/etc/font-manager.profile) - [ ] [freecad.profile](https://github.com/netblue30/firejail/blob/master/etc/freecad.profile) - [ ] [gconf.profile](https://github.com/netblue30/firejail/blob/master/etc/gconf.profile) - [ ] [gnome-music.profile](https://github.com/netblue30/firejail/blob/master/etc/gnome-music.profile) - [ ] [gnome-schedule.profile](https://github.com/netblue30/firejail/blob/master/etc/gnome-schedule.profile) - [ ] [hexchat.profile](https://github.com/netblue30/firejail/blob/master/etc/hexchat.profile) - [ ] [inkscape.profile](https://github.com/netblue30/firejail/blob/master/etc/inkscape.profile) - [ ] [klatexformula.profile](https://github.com/netblue30/firejail/blob/master/etc/klatexformula.profile) - [ ] [kodi.profile](https://github.com/netblue30/firejail/blob/master/etc/kodi.profile) - [ ] [krita.profile](https://github.com/netblue30/firejail/blob/master/etc/krita.profile) - [ ] [liferea.profile](https://github.com/netblue30/firejail/blob/master/etc/liferea.profile) - [ ] [lollypop.profile](https://github.com/netblue30/firejail/blob/master/etc/lollypop.profile) - [ ] [macrofusion.profile](https://github.com/netblue30/firejail/blob/master/etc/macrofusion.profile) - [x] [meld.profile](https://github.com/netblue30/firejail/blob/master/etc/meld.profile) (b07ef43) - [ ] [mendeleydesktop.profile](https://github.com/netblue30/firejail/blob/master/etc/mendeleydesktop.profile) - [ ] [mpDris2.profile](https://github.com/netblue30/firejail/blob/master/etc/mpDris2.profile) - [ ] [mpsyt.profile](https://github.com/netblue30/firejail/blob/master/etc/mpsyt.profile) - [ ] [mpv.profile](https://github.com/netblue30/firejail/blob/master/etc/mpv.profile) - [ ] [ms-office.profile](https://github.com/netblue30/firejail/blob/master/etc/ms-office.profile) - [ ] [mypaint.profile](https://github.com/netblue30/firejail/blob/master/etc/mypaint.profile) - [ ] [natron.profile](https://github.com/netblue30/firejail/blob/master/etc/natron.profile) - [ ] [nautilus.profile](https://github.com/netblue30/firejail/blob/master/etc/nautilus.profile) - [ ] [nemo.profile](https://github.com/netblue30/firejail/blob/master/etc/nemo.profile) - [ ] [nitroshare.profile](https://github.com/netblue30/firejail/blob/master/etc/nitroshare.profile) - [ ] [nyx.profile](https://github.com/netblue30/firejail/blob/master/etc/nyx.profile) - [ ] [obs.profile](https://github.com/netblue30/firejail/blob/master/etc/obs.profile) - [ ] [openshot.profile](https://github.com/netblue30/firejail/blob/master/etc/openshot.profile) - [ ] [picard.profile](https://github.com/netblue30/firejail/blob/master/etc/picard.profile) - [ ] [pithos.profile](https://github.com/netblue30/firejail/blob/master/etc/pithos.profile) - [ ] [pitivi.profile](https://github.com/netblue30/firejail/blob/master/etc/pitivi.profile) - [ ] [playonlinux.profile](https://github.com/netblue30/firejail/blob/master/etc/playonlinux.profile) - [ ] [profanity.profile](https://github.com/netblue30/firejail/blob/master/etc/profanity.profile) - [ ] [pybitmessage.profile](https://github.com/netblue30/firejail/blob/master/etc/pybitmessage.profile) - [ ] [qbittorrent.profile](https://github.com/netblue30/firejail/blob/master/etc/qbittorrent.profile) - [ ] [qutebrowser.profile](https://github.com/netblue30/firejail/blob/master/etc/qutebrowser.profile) - [ ] [ranger.profile](https://github.com/netblue30/firejail/blob/master/etc/ranger.profile) - [ ] [rhythmbox.profile](https://github.com/netblue30/firejail/blob/master/etc/rhythmbox.profile) - [ ] [scribus.profile](https://github.com/netblue30/firejail/blob/master/etc/scribus.profile) - [ ] [sdat2img.profile](https://github.com/netblue30/firejail/blob/master/etc/sdat2img.profile) - [ ] [smplayer.profile](https://github.com/netblue30/firejail/blob/master/etc/smplayer.profile) - [ ] [soundconverter.profile](https://github.com/netblue30/firejail/blob/master/etc/soundconverter.profile) - [ ] [subdownloader.profile](https://github.com/netblue30/firejail/blob/master/etc/subdownloader.profile) - [ ] [xpra.profile](https://github.com/netblue30/firejail/blob/master/etc/xpra.profile) - [ ] [youtube-dl.profile](https://github.com/netblue30/firejail/blob/master/etc/youtube-dl.profile)
Author
Owner

@rusty-snake commented on GitHub (Jan 18, 2020):

youtube-dl: still supporting 2.6 and 2.7

<!-- gh-comment-id:575891967 --> @rusty-snake commented on GitHub (Jan 18, 2020): youtube-dl: still supporting 2.6 and 2.7 - ytdl-org/youtube-dl#5697 - https://github.com/ytdl-org/youtube-dl/blob/master/.travis.yml
Author
Owner
<!-- gh-comment-id:575892401 --> @rusty-snake commented on GitHub (Jan 18, 2020): meld: no python 2.x support - https://gitlab.gnome.org/GNOME/meld/blob/master/NEWS - https://gitlab.gnome.org/GNOME/meld/blob/master/.gitlab-ci.yml - https://gitlab.gnome.org/GNOME/meld/blob/master/README.md
Author
Owner

@reinerh commented on GitHub (Jan 18, 2020):

I think some distributions are still providing security support for Python 2.
The goal is to drop it from the next Debian stable release, but it might not get achieved, depending on how many important applications will not yet be ported by then.

Dropping Python 2 support from firejail will make backporting firejail to older distributions more complicated (e.g. the current Debian stable), as many applications there are still running with Python 2. I'm not sure if it then still makes sense to continue uploading backports. But I'm fine with either way.

Interested in other opinions...

<!-- gh-comment-id:575932035 --> @reinerh commented on GitHub (Jan 18, 2020): I think some distributions are still providing security support for Python 2. The goal is to drop it from the next Debian stable release, but it might not get achieved, depending on how many important applications will not yet be ported by then. Dropping Python 2 support from firejail will make backporting firejail to older distributions more complicated (e.g. the current Debian stable), as many applications there are still running with Python 2. I'm not sure if it then still makes sense to continue uploading backports. But I'm fine with either way. Interested in other opinions...
Author
Owner

@rusty-snake commented on GitHub (Jan 18, 2020):

For now the focus should be on programs written original in p3 or ported to p3 on the original p2 EOL dated (2015).

I agree with you that programs which are still using p2 on Debian stable (and maybe oldstable) should have a opt-in/opt-out note.

<!-- gh-comment-id:575933483 --> @rusty-snake commented on GitHub (Jan 18, 2020): For now the focus should be on programs written original in p3 or ported to p3 on the original p2 EOL dated (2015). I agree with you that programs which are still using p2 on Debian stable (and maybe oldstable) should have a opt-in/opt-out note.
Author
Owner

@ghost commented on GitHub (Jan 18, 2020):

What would be the security risk of leaving include allow-python2.inc enabled if it is not installed due to being dead?

<!-- gh-comment-id:575934591 --> @ghost commented on GitHub (Jan 18, 2020): What would be the security risk of leaving `include allow-python2.inc` enabled if it is not installed due to being dead?
Author
Owner

@rusty-snake commented on GitHub (Jan 18, 2020):

None, but if you have one program depending on python2 …

<!-- gh-comment-id:575934773 --> @rusty-snake commented on GitHub (Jan 18, 2020): None, but if you have one program depending on python2 …
Author
Owner

@ghost commented on GitHub (Jan 18, 2020):

As long as the functionality of the include isn't dropped alltogether just yet I'm fine with removing it by default. Perhaps a new switch in firejail.config would be handy:

# Enable or disable support for Python 2, default disabled.
# allow-python2 no
<!-- gh-comment-id:575936482 --> @ghost commented on GitHub (Jan 18, 2020): As long as the functionality of the include isn't dropped alltogether just yet I'm fine with removing it by default. Perhaps a new switch in `firejail.config` would be handy: ``` # Enable or disable support for Python 2, default disabled. # allow-python2 no ```
Author
Owner

@reinerh commented on GitHub (Jan 18, 2020):

Hm, in my opinion firejail.config is more about core functionality of firejail itself, not so much about stuff that could be achieved with profiles.
I would prefer not to introduce this as a configuration option.
A profile-only way of achieving that could look like this:
Include in every profile that needs python a allow-python.inc include, and in this include include allow-python2.inc and allow-python3.inc.
And whoever does not want to allow python2 could just remove one line in the python include.

<!-- gh-comment-id:575937545 --> @reinerh commented on GitHub (Jan 18, 2020): Hm, in my opinion firejail.config is more about core functionality of firejail itself, not so much about stuff that could be achieved with profiles. I would prefer not to introduce this as a configuration option. A profile-only way of achieving that could look like this: Include in every profile that needs python a `allow-python.inc` include, and in this include include `allow-python2.inc` and `allow-python3.inc`. And whoever does not want to allow python2 could just remove one line in the python include.
Author
Owner

@smitsohu commented on GitHub (Jan 18, 2020):

When Python is started from a running sandbox, it will run with all restrictions of the sandbox. Whether or not there is a broken Python binary on the system, waiting to be executed under the restrictions of a sandbox, should maybe not be the primary concern.

Distributions shipping Python2 along with important software written in Python2 will be around for a very long time. Besides Debian Stretch LTS (June 2022) there are also Ubuntu 18.04 LTS (April 2023) or CentOS 7 (June 2024).

As moving to Python3 is not always straightforward or even possible from a practical perspective, I think there will be a strong motivation to run Python2 scripts/tools inside a sandbox like Firejail.

<!-- gh-comment-id:575937771 --> @smitsohu commented on GitHub (Jan 18, 2020): When Python is started from a running sandbox, it will run with all restrictions of the sandbox. Whether or not there is a broken Python binary on the system, waiting to be executed under the restrictions of a sandbox, should maybe not be the primary concern. Distributions shipping Python2 along with important software written in Python2 will be around for a very long time. Besides Debian Stretch LTS (June 2022) there are also Ubuntu 18.04 LTS (April 2023) or CentOS 7 (June 2024). As moving to Python3 is not always straightforward or even possible from a practical perspective, I think there will be a strong motivation to run Python2 scripts/tools inside a sandbox like Firejail.
Author
Owner

@Fred-Barclay commented on GitHub (Jan 18, 2020):

I'm with @smitsohu here. I don't think we should remove python2 for at least several more years.

<!-- gh-comment-id:575939832 --> @Fred-Barclay commented on GitHub (Jan 18, 2020): I'm with @smitsohu here. I don't think we should remove python2 for at least several more years.
Author
Owner

@rusty-snake commented on GitHub (Jan 18, 2020):

To clarify my point: I only want to drop include allow-python2.inc for profiles from programs without python2 support. Of course we should leave python2 for programs with python2 version in common distros. But some profiles (e.g. gnome-music.profile IIRC) never had python2 support, because they are written after the release of python3.

<!-- gh-comment-id:575940828 --> @rusty-snake commented on GitHub (Jan 18, 2020): To clarify my point: I only want to drop `include allow-python2.inc` for profiles from programs without python2 support. Of course we should leave python2 for programs with python2 version in common distros. But some profiles (e.g. gnome-music.profile IIRC) never had python2 support, because they are written after the release of python3.
Author
Owner

@smitsohu commented on GitHub (Jan 18, 2020):

@rusty-snake Thanks, somehow I misunderstood what was the plan! Sounds good 👍

<!-- gh-comment-id:575941319 --> @smitsohu commented on GitHub (Jan 18, 2020): @rusty-snake Thanks, somehow I misunderstood what was the plan! Sounds good :+1:
Author
Owner

@ghost commented on GitHub (Jan 19, 2020):

I made a suggestion in https://github.com/netblue30/firejail/pull/3167 to help Arch users that still use meld-gtk2 from the AUR that might wonder why their favo diff GUI is suddenly broken.

<!-- gh-comment-id:575950262 --> @ghost commented on GitHub (Jan 19, 2020): I made a **suggestion** in https://github.com/netblue30/firejail/pull/3167 to help Arch users that still use [meld-gtk2](https://aur.archlinux.org/packages/meld-gtk2/) from the AUR that might wonder why their favo diff GUI is suddenly broken.
Author
Owner

@Fred-Barclay commented on GitHub (Jan 19, 2020):

@rusty-snake I misunderstood too then, yeah that makes perfect sense 😄

<!-- gh-comment-id:575958357 --> @Fred-Barclay commented on GitHub (Jan 19, 2020): @rusty-snake I misunderstood too then, yeah that makes perfect sense :smile:
Author
Owner

@Vincent43 commented on GitHub (Jan 19, 2020):

Clearing allow-python2.inc from apps that never used python2 make sense - it shouldn't be added there in first place however I think we shouldn't remove it from apps that used python2 in earlier versions for compatibility with older distros.

I also don't think that disable-python2.inc would be valuable because if you already get code execution somewhere then it doesn't matter if your exploit call python2 or python3. Python security matters only for apps that use python themselves.

<!-- gh-comment-id:576007045 --> @Vincent43 commented on GitHub (Jan 19, 2020): Clearing `allow-python2.inc` from apps that never used python2 make sense - it shouldn't be added there in first place however I think we shouldn't remove it from apps that used python2 in earlier versions for compatibility with older distros. I also don't think that `disable-python2.inc` would be valuable because if you already get code execution somewhere then it doesn't matter if your exploit call python2 or python3. Python security matters only for apps that use python themselves.
Author
Owner

@rusty-snake commented on GitHub (Jan 19, 2020):

however I think we shouldn't remove it from apps that used python2 in earlier versions for compatibility with older distros.

IMHO we can remove it when debian (old)stable and Ubuntu LTS have the python3 version of the program.

<!-- gh-comment-id:576008159 --> @rusty-snake commented on GitHub (Jan 19, 2020): > however I think we shouldn't remove it from apps that used python2 in earlier versions for compatibility with older distros. IMHO we can remove it when debian (old)stable and Ubuntu LTS have the python3 version of the program.
Author
Owner

@Fred-Barclay commented on GitHub (Jan 20, 2020):

@rusty-snake I'd push it out a bit further, when CentOS has the python3 versions.

<!-- gh-comment-id:576434077 --> @Fred-Barclay commented on GitHub (Jan 20, 2020): @rusty-snake I'd push it out a bit further, when CentOS has the python3 versions.
Author
Owner

@rusty-snake commented on GitHub (Jan 20, 2020):

@Fred-Barclay Cent OS (latest) or all supported? CentOS latest (currently 8) should have the python3 version so that we can remove it. But CentOS 6 and 7 have very old versions, for which the firejail master profiles are often not (or no longer) developed or at least not well tested

<!-- gh-comment-id:576436759 --> @rusty-snake commented on GitHub (Jan 20, 2020): @Fred-Barclay Cent OS (latest) or all supported? CentOS latest (currently 8) should have the python3 version so that we can remove it. But CentOS 6 and 7 have very old versions, for which the firejail master profiles are often not (or no longer) developed or at least not well tested
Author
Owner

@Fred-Barclay commented on GitHub (Jan 20, 2020):

@rusty-snake honestly I'd say CentOS 7... EOL is 30 June 2024 which is pretty far out there but not too unreasonable IMHO.

<!-- gh-comment-id:576440736 --> @Fred-Barclay commented on GitHub (Jan 20, 2020): @rusty-snake honestly I'd say CentOS 7... EOL is 30 June 2024 which is pretty far out there but not too unreasonable IMHO.
Author
Owner

@ghost commented on GitHub (Jan 20, 2020):

Claws-mail just started to drop python2 support for some plugins. As we didn't support these in our profile (my ommission) I added a comment.

@rusty-snake You can add claws-mail to your list here now I suppose.

<!-- gh-comment-id:576452716 --> @ghost commented on GitHub (Jan 20, 2020): Claws-mail just started to [drop python2 support for some plugins](https://git.claws-mail.org/?p=claws.git;a=summary). As we didn't support these in our profile (my ommission) I added a comment. @rusty-snake You can add claws-mail to your list here now I suppose.
Author
Owner

@ghost commented on GitHub (Jan 21, 2020):

I noticed display.profile is on the list here. And indeed the profile allows both python2 and python3. Yet I don't see any python dependencies in the imagemagick packages on Arch, Debian and Ubuntu. Debian buster actually has it as /usr/bin/display-im6.q16, so it would be broken there. I wonder, is this profile actually still valuable? It is the only command from the ImageMagick tools we support. Without a description it's doubtful regular firejail users actually know what it does, probably confuse it with the DISPLAY env var, etcetera. There haven't been issue reports against it either. In any case we can safely drop the python support completely IMHO.

<!-- gh-comment-id:576711308 --> @ghost commented on GitHub (Jan 21, 2020): I noticed `display.profile` is on the list here. And indeed the profile allows both python2 and python3. Yet I don't see **any** python dependencies in the imagemagick packages on Arch, Debian and Ubuntu. Debian [buster](https://packages.debian.org/buster/amd64/imagemagick-6.q16/filelist) actually has it as /usr/bin/display-im6.q16, so it would be broken there. I wonder, _is this profile actually still valuable?_ It is the only command from the ImageMagick tools we support. Without a description it's doubtful regular firejail users actually know what it does, probably confuse it with the DISPLAY env var, etcetera. There haven't been issue reports against it either. In any case we can safely drop the python support completely IMHO.
Author
Owner

@rusty-snake commented on GitHub (Feb 21, 2020):

openshot never has python2 support


I'm closing here for now. The most allow-python2.inc includes are still justified.

<!-- gh-comment-id:589660789 --> @rusty-snake commented on GitHub (Feb 21, 2020): openshot never has python2 support --- I'm closing here for now. The most allow-python2.inc includes are still justified.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#1983
No description provided.