[MIR] promote python3-tornado as a pcs dependency

Bug #1990191 reported by Athos Ribeiro
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-tornado (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

[Availability]
The package python-tornado is already in Ubuntu universe.
The package python-tornado build for the architectures it is designed to work on.
It currently builds and works for architetcures: amd64, arm64, armhf, ppc64el, riscv64, s390x
Link to package https://launchpad.net/ubuntu/+source/python-tornado

[Rationale]
The package python-tornado is required in Ubuntu main for pcs.
The package python-rotnado will not generally be useful for a large part of our user base, but is important/helpful still because pcs requires it and is in the MIR process to substitute crmsh.
pcs MIR link: https://bugs.launchpad.net/ubuntu/+source/pcs/+bug/1953341

The package python-tornado is required in Ubuntu main through the same scheduled requested for the pcs promotion, since pcs depends on it.

[Security]
python-tornado had 3 related security issues in the past:
* https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-2374
* https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-9720
* https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-2099
  through https://github.com/tornadoweb/tornado/issues/799

These are all listed in https://ubuntu.com/security/cves?package=python-tornado

which were dealt with upstream.

- no `suid` or `sgid` binaries
- no executables in `/sbin` and `/usr/sbin`
- Package does not install services, timers or recurring jobs
- Package does not open privileged ports (ports < 1024). Still, a user could configure a script to run tornado with a privileged port (this is not a default behavior).

[Quality assurance - function/usage]
- The package works well right after install

[Quality assurance - maintenance]
- The package is maintained well in Debian/Ubuntu and has not too many
  and long term critical bugs open
  - Ubuntu https://bugs.launchpad.net/ubuntu/+source/python-tornado/+bug
  - Debian https://bugs.debian.org/cgi-bin/pkgreport.cgi?src=python-tornado
- The package does not deal with exotic hardware we cannot support

[Quality assurance - testing]
- The package runs a test suite on build time, if it fails it makes the build fail, link to build log: https://launchpadlibrarian.net/612368988/buildlog_ubuntu-kinetic-amd64.python-tornado_6.2.0-1_BUILDING.txt.gz

- The package runs an autopkgtest, and is currently passing on this [amd64, arm64, armhf, ppc64el, s390x] list of architectures, link to test logs: https://autopkgtest.ubuntu.com/packages/p/python-tornado/kinetic.

- The package does have not failing autopkgtests right now

[Quality assurance - packaging]
- debian/watch is present and works

- debian/control defines a correct Maintainer field

This package does not yield massive lintian Warnings, Errors. It does throw a few warnings regarding documentation and shpped tests and examples, which should be OK.

Link to a recent build log of the package: https://launchpadlibrarian.net/612368988/buildlog_ubuntu-kinetic-amd64.python-tornado_6.2.0-1_BUILDING.txt.gz

The lintian output for a recent local build is attached.

Lintian overrides are present, but ok because they refer to warnings regarding testing data. Each override entry is explained through comments in the overrides files.

- This package does not rely on obsolete or about to be demoted packages.
- This package has no python2 or GTK2 dependencies

- The package will not be installed by default

- Packaging and build is easy, link to d/rules https://git.launchpad.net/ubuntu/+source/python-tornado/tree/debian/rules

[UI standards]
Application is not end-user facing (does not need translation)

[Dependencies]
- No further depends or recommends dependencies that are not yet in main

[Standards compliance]
This package correctly follows FHS and Debian Policy

[Maintenance/Owner]
- Team is not yet, but will subscribe to the package before promotion

- This does not use static builds

- This does not use vendored code

- This package is not rust based

The package successfully built during the most recent test rebuild
https://launchpad.net/ubuntu/+archive/test-rebuild-20220914-kinetic/+build/24441578

[Background information]
The Package description explains the package well
Upstream Name is tornado
Link to upstream project https://www.tornadoweb.org/

This package was once in main due to being a build-dependency of python-urllib3.
This is the python-urllib3 MIR from back then: https://bugs.launchpad.net/ubuntu/+source/python-urllib3/+bug/1047400
and this is the former python-tornado MIR: https://bugs.launchpad.net/ubuntu/+source/python-tornado/+bug/1047432.

The package was demoted back to universe after xenial since it is not a python-urllib3 runtime dependency.

Tags: sec-1350
Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :
Changed in python-tornado (Ubuntu):
assignee: nobody → Lukas Märdian (slyon)
Revision history for this message
Lukas Märdian (slyon) wrote :
Download full text (4.9 KiB)

Review for Package: src:python-tornado

[Summary]
TornadoWeb is python web framework specializing on websocket communications.

MIR team ACK under the constraint to resolve the below listed
required TODOs and as much as possible having a look at the
recommended TODOs.

This does need a security review, so I'll assign ubuntu-security

List of specific binary packages to be promoted to main: python3-tornado, python3-tornado-doc
Specific binary packages built, but NOT to be promoted to main: <None>

Notes:
- This package is processing arbitrary web-content. Therefore, I'm requiring a
  security review.

Required TODOs:
#0 The package should get a team bug subscriber before being promoted (Server team?)

Recommended TODOs:
#1 lintian-overrides warnings, probably due to recent changes in lintian,
   please work with the Debian maintainers to get the overrides adopted
#2 warnings during the build (see below).
   - Please work with upstream to avoid using deprecated setup.py
   - Please work with Debian to avoid unused substitution variables in d/control

[Duplication]
TornadoWeb is basically yet another python web framework, like Django or Flask,
both of which are already in main. But Tornado is mostly addressing the
websockets niche and optimizing for that and seems to be better supported than
other alternatives (from universe, like python3-websockets, flask-socketio,
django-channels). Therefore, I think it's okay to add it as an additional python
web framework.

There is no other package in main providing the same (niche) functionality.

[Dependencies]
OK:
- no other Dependencies to MIR due to this
  - SRCPKG checked with `check-mir`
  - all dependencies can be found in `seeded-in-ubuntu` (already in main)
  - none of the (potentially auto-generated) dependencies (Depends
    and Recommends) that are present after build are not in main
- no -dev/-debug/-doc packages that need exclusion
- No dependencies in main that are only superficially tested requiring
  more tests now.

Problems: None

[Embedded sources and static linking]
OK:
- no embedded source present
- no static linking
- does not have unexpected Built-Using entries
- not a go package, no extra constraints to consider in that regard
- not a rust package, no extra constraints to consider in that regard

Problems: None

[Security]
OK:
- history of CVEs does not look concerning (3 low/medium CVEs, handled upstream)
- does not run a daemon as root
- does not use webkit1,2
- does not use lib*v8 directly
- does not use centralized online accounts
- does not integrate arbitrary javascript into the desktop
- does not deal with system authentication (eg, pam), etc)
- does not deal with security attestation (secure boot, tpm, signatures)
- does not deal with cryptography (en-/decryption, certificates, signing, ...)

Problems:
- parses data formats (network packets/websocket) from an untrusted source.
- opens a port for web(-socket) communication
- processes arbitrary web content

[Common blockers]
OK:
- does not FTBFS currently
- does have a test suite that runs at build time
  - test suite fails will fail the build upon error.
- does have a non-trivial test suite that runs as autopkgtest
- no new...

Read more...

Changed in python-tornado (Ubuntu):
assignee: Lukas Märdian (slyon) → Ubuntu Security Team (ubuntu-security)
Steve Beattie (sbeattie)
tags: added: sec-1350
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Thanks for the review Lukas! The Server team will be subscribed to the team before its promotion.

Revision history for this message
Mark Esler (eslerm) wrote :
Download full text (3.2 KiB)

I reviewed python-tornado 6.2.0-1 as checked into kinetic. This shouldn't be
considered a full audit but rather a quick gauge of maintainability.

> Tornado is a Python web framework and asynchronous networking library

- CVE History:
  - CVE-2012-2374, CVE-2013-2099, and CVE-2014-9720
    - developers responded swiftly
  - CVE-2020-28476 was misassigned and revoked
  - silent vulnerability fixes https://github.com/tornadoweb/tornado/issues/799
    - https://github.com/tornadoweb/tornado/releases/tag/v6.2.0
    - downstream cannot apply security fixes that they do not know about!
  - release notes are only tracked by GitHub tags
    - previously kept on project's website
    - difficult to track history
- Build-Depends?
  - notably python3-pycurl and python3-twisted
  - optional python3-pycares not included in package
- pre/post inst/rm scripts?
  - yes
    - postinst compiles code
    - prerm cleans up compiled code
- init scripts?
  - none
- systemd units?
  - none
- dbus services?
  - none
- setuid binaries?
  - none
- binaries in PATH?
  - none
- sudo fragments?
  - none
- polkit files?
  - none
- udev rules?
  - none
- unit tests / autopkgtests?
  - 1,167 build tests for functionality
  - some autopkgtests
    - i386 failing due to dependencies
- cron jobs?
  - none
- Build logs:
  - trivial lintian warnings, needs cleaning

- Processes spawned?
  - most are in tests
  - exec_in's exec() seems fine, see bandit
  - Popen in autoreload.py and process.py are okay--isolated from user
- Memory management?
  - appears fine
- File IO?
  - mostly in tests or demos
  - web.py's get_content() reads absolute paths
  - WebSocketHandler class has its own open function
  - file reads in templaye.py, options.py, process.py, locale.py are fine
- Logging?
  - many functions to log or raise errors, warnings, and debugging
  - httputil.py defines many error functions
  - logging is well defined in tornado documentation
- Environment variable usage?
  - mostly in wsgi.py
    - WSGIContainer defines it's own environ()
  - autoreload.py calls os.environ["PYTHONPATH"]
- Use of privileged functions?
  - none
- Use of cryptography / random number sources etc?
  - http goes through python3-pycurl
  - websocket.py's magic value is part of standard
  - uses of SHA-1 in ETags and Sec-WebSocket-Accept are fine
  - uses of random in ETags, Sec-WebScoket-Accept, xsrf, and jitter are fine
- Use of temp files?
  - none
  - templates.py writes lines to temp buffer
- Use of networking?
  - http goes through python3-pycurl
  - heavy use
  - lots of inline comments
  - appears to comply with standards, is defensively written, and covers edgecases
- Use of WebKit?
  - none
- Use of PolicyKit?
  - none

- Any significant cppcheck results?
  - none
- Any significant Coverity results?
  - none
- Any significant shellcheck results?
  - none
- Any significant bandit results?
  - _HTTPRequestContext class defaults to listening on 0.0.0.0 instead of localhost. Unsafe default.

This package should use dh_python.

Downstream developers using Tornado could easily create vulnerabilities in their projects via Tornado templates and exec calls. Dependents of Tornado should be audited for t...

Read more...

Changed in python-tornado (Ubuntu):
assignee: Ubuntu Security Team (ubuntu-security) → nobody
status: New → In Progress
Revision history for this message
Mark Esler (eslerm) wrote (last edit ):

Please note that the follow python-tornado build dependencies are not in lunar main and do not have an open MIR: (1) dh-python, (2) python-mock, and (3) sphinxcontrib-asyncio.

edit: these dependencies are only required for build and do not require an MIR

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Showing up in component mismatch now as planned.

Changed in python-tornado (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Promoted together with the full PCS stack, details see https://bugs.launchpad.net/ubuntu/+source/pcs/+bug/1953341/comments/13

Changed in python-tornado (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.