[MIR] Promote ruby-eventmachine to main as a pcs indirect dependency

Bug #1990580 reported by Lucas Kanashiro
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ruby-eventmachine (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

[Availability]

The package ruby-eventmachine is already in Ubuntu universe.

The package ruby-eventmachine build for the architectures it is designed to work on.

It currently builds and works for architectures: amd64, arm64, armhf, pcc64el, riscv64, s390x.

Link to package [[https://launchpad.net/ubuntu/+source/ruby-eventmachine|ruby-eventmachine]]

[Rationale]

The package ruby-eventmachine is required in Ubuntu main for thin promotion which is a runtime dependency of pcs (the main reason for this promotion).

Ideally, we expect that ruby-eventmachine (and pcs) will be promoted in the "L" development cycle. The idea is to promote only the ruby-eventmachine binary.

[Security]

Required links:

https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=ruby-eventmachine

Nothing was found searching for the package name. If you look for the gem name:

https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=eventmachine

6 CVEs are reported but all of them in other pieces of software, using
eventmachine in an insecure way.

Nothing was found searching in the OSS security mailing list archive.

https://ubuntu.com/security/cves?package=ruby-eventmachine

Also nothing found in the Ubuntu security tracker.

No `suid` or `sgid` binaries.

No executables in `/sbin` and `/usr/sbin`.

Package does not install services, timers or recurring jobs.

Packages does not open privileged ports (ports < 1024).

Packages does not contain extensions to security-sensitive software
(filters, scanners, plugins, UI skins, ...).

[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/ruby-eventmachine/+bug
- Debian https://bugs.debian.org/cgi-bin/pkgreport.cgi?src=ruby-eventmachine

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/587653106/buildlog_ubuntu-jammy-amd64.ruby-eventmachine_1.3~pre20201020-b50c135-5_BUILDING.txt.gz

The package runs an autopkgtest, and is currently passing on
this list of architectures: amd64, arm64, armhf, ppc64el, s390x.

Link to test logs:

https://autopkgtest.ubuntu.com/packages/ruby-eventmachine

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.

Output of `lintian --pedantic` against the source package present in Kinetic:

P: ruby-eventmachine source: hyphen-in-upstream-part-of-debian-changelog-version 1.3~pre20201020-b50c135
P: ruby-eventmachine source: update-debian-copyright 2011 vs 2022 [debian/copyright:10]

Lintian overrides are present:

$ cat /usr/share/lintian/overrides/ruby-eventmachine
# It is dual licensed under Ruby's license or GPL
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=591979
ruby-eventmachine: possible-gpl-code-linked-with-openssl

The reason is documented in the bug mentioned.

This package does not rely on obsolete or about to be demoted packages.

The package will not be installed by default.

Packaging and build is easy, link to d/rules:

https://git.launchpad.net/~git-ubuntu-import/ubuntu/+source/ruby-eventmachine/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]

Owning Team will be Server.

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 has been built in the archive more recently than the last
test rebuild.

[Background information]

The Package description explains the package well.

Upstream Name is: eventmachine.

Link to upstream project: https://github.com/eventmachine/eventmachine

Tags: sec-1499
description: updated
Changed in ruby-eventmachine (Ubuntu):
assignee: nobody → Ioanna Alifieraki (joalif)
Revision history for this message
Ioanna Alifieraki (joalif) wrote :
Download full text (3.7 KiB)

Review for Package: ruby-eventmachine

[Summary]
The review is based on the 1.3~pre20220315-df4ab006 version currently
in lunar-proposed.

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, but I will not assign to security team yet
until the required TODOs are addressed.
List of specific binary packages to be promoted to main: ruby-eventmachine

Notes:
Required TODOs:
1. Please check what happens with the verisoning of this package.
Ubuntu/debian version is 1.3~pre20220315-df4ab006, however if we look
at the gitlog of the upstream project (https://github.com/eventmachine/eventmachine)
this does not reflect anywhere. Also from here https://rubygems.org/gems/eventmachine/versions,
and here https://rubygems.org/gems/eventmachine the reported latest version is 1.2.7.

The package should get a team bug subscriber before being promoted

[Duplication]
There is no other package in main providing the same functionality.

[Dependencies]
OK:
- no other Dependencies to MIR due to this
  - ruby-event-machine 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
- Does not include vendored code

Problems: None

[Security]
OK:
- history of CVEs does not look concerning
- does not run a daemon as root
- does not use webkit1,2
- does not use lib*v8 directly
- does not parse data formats (files [images, video, audio,
  xml, json, asn.1], network packets, structures, ...) from
  an untrusted source.
- does not process arbitrary web content
- 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:
- does open a port/socket

[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 python2 dependency

Problems: None

[Packaging red flags]
OK:
- Ubuntu does not carry a delta (patches come from debian)
- symbols tracking not applicable for this kind of code.
- d/watch is present and looks ok (if needed, e.g. non-native)
- Upstream update history is good
- Debian/Ubuntu update history is good/slow/sporadic
- promoting this does not seem to cause issues for MOTUs that so far
  maintained the package
- no massive Lintian wa...

Read more...

Changed in ruby-eventmachine (Ubuntu):
assignee: Ioanna Alifieraki (joalif) → nobody
status: New → Incomplete
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Thanks for the review Ioanna.

Regarding the version string confusion: this is a pre release snapshot, the next upstream release will be 1.3, it was taken at 2022-03-15 and the head commit was df4ab006 (which was made 14th March, one day before the snapshot):

https://github.com/eventmachine/eventmachine/commit/df4ab006

So merging all that we have 1.3~pre20220315-df4ab006-3. I hope the explanation above clarifies everything for you.

Moreover, I'll make sure the server team will be subscribed to the package before its promotion.

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

Thanks, I tihnk it is enough but Ioanna will have a look.

If it is enough, assign security as they will be next to process it
If it is not enough - tell Lucas what is missing still

Changed in ruby-eventmachine (Ubuntu):
status: Incomplete → New
assignee: nobody → Ioanna Alifieraki (joalif)
Revision history for this message
Ioanna Alifieraki (joalif) wrote :

Ok, sounds good to me, thanks Lucas.
Moving to security team queue.

Changed in ruby-eventmachine (Ubuntu):
assignee: Ioanna Alifieraki (joalif) → Ubuntu Security Team (ubuntu-security)
Steve Beattie (sbeattie)
tags: added: sec-1499
Revision history for this message
Mark Esler (eslerm) wrote :
Download full text (8.3 KiB)

I reviewed ruby-eventmachine 1.3~pre20201020-b50c135-5 as checked into kinetic. This shouldn't be considered a full audit but rather a quick gauge of maintainability.

> EventMachine is an event-driven I/O and lightweight concurrency library for Ruby. It provides event-driven I/O using the Reactor pattern, much like JBoss Netty, Apache MINA, Python's Twisted, Node.js, libevent and libev.

- CVE History:
  - https://lwn.net/Vulnerabilities/694784/
    - DoS by too many parallel connections
    - https://bugs.mageia.org/show_bug.cgi?id=18988
    - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=678512
    - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=696015
  - TEMP-0678512-2E167C
    - "remotely executable crash" of Ruby VM if too many file descriptors used
    - https://security-tracker.debian.org/tracker/TEMP-0678512-2E167C
  - Eventmachine does not verify the identity of a TLS server
    - https://blog.jcoglan.com/2020/07/31/missing-tls-verification-in-faye/
      - "This has been a requested feature in EventMachine for many years now; see for example #275, #378, and #814. In June 2020, em-http-request published an advisory related to this problem and fixed it by implementing TLS verification in their own codebase"
    - EM::Connection#start_tls creates a non-verified TLS session
    - if verify_peer is set, EM::Connection#ssl_verify_peer will accept a method _from the caller_ to verify the peer
    - https://github.com/eventmachine/eventmachine/issues/814
    - six downstream projects were assigned CVEs in 2020 for MITM attacks
- Build-Depends?
  - lunar main
     - debhelper-compat (debhelper)
     - iproute2
     - libssl-dev
     - rake
  - lunar universe
     - gem2deb
     - ruby-rspec
     - rake-compiler
     - ruby-test-unit
- pre/post inst/rm scripts?
  - none
- 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?
  - contains build tests
    - logs state that the SSLv3 test_any_to_v3 is supposed to fail
  - has autopkgtests
  - autopkgtests fails for focal and earlier
    - Debian/Ubuntu's Ruby 2.7 may be linking to the wrong malloc
      - https://github.com/eventmachine/eventmachine/issues/965
      - https://bugs.ruby-lang.org/issues/18650
- cron jobs?
  - none
- Build logs:
  - many unused result build warnings
  - deprecated ssl build warnings

- Processes spawned?
  - EM::popen
    - see t_invoke_popen(), evma_popen, and EventMachine_t::Socketpair which ultimately calls execvp()
    - calls to this function should not use untrusted data
    - open bug from 2010: "Ability to close write stream from EM.popen handler #87"
      - https://github.com/eventmachine/eventmachine/issues/87
    - "EM::system is a simple wrapper for EM::popen. It is similar to Kernel::system, but requires a single string argument for the command and performs no shell expansion."
    - EM::DeferrableChildProcess is another EM::popen wrapper
    - grep for `EventMachine.popen`, `EM.popen`, `EM.DeferrableChildProcess`, etc or similar in downstream projects
    - com...

Read more...

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

    - Debian/Ubuntu's Ruby 2.7 may be linking to the wrong malloc
      - https://github.com/eventmachine/eventmachine/issues/965
      - https://bugs.ruby-lang.org/issues/18650

This ^ is not a problem since in lunar (where we want to promote it) we have ruby 3.0 and we are transitioning to ruby 3.1.

Revision history for this message
Mark Esler (eslerm) wrote :

pcs is replacing thin (which depends on ruby-eventmachine) with puma https://github.com/ClusterLabs/pcs/pull/632

Removing Ubuntu Security Team assignment until there is a new need to complete this MIR.

Changed in ruby-eventmachine (Ubuntu):
assignee: Ubuntu Security Team (ubuntu-security) → nobody
Changed in ruby-eventmachine (Ubuntu):
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers