[MIR] Promote ruby-childprocess as a pcs dependency

Bug #1991839 reported by Lucas Kanashiro
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ruby-childprocess (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

[Availability]

The package ruby-childprocess is already in Ubuntu universe.

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

It currently builds and works for architectures: amd64 (arch:all)

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

[Rationale]

ruby-childprocess promotion to main is needed because of the
[[https://bugs.launchpad.net/ubuntu/+source/pcs/+bug/1953341|pcs promotion]]. It is one of its runtime dependencies in universe.

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

[Security]

Required links:

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

I looked for "childprocess" which brings a single unrelated CVE: CVE-2021-23352. This CVE is affecting another software which is not childprocess.

Nothing was found in the oss-security mailing list related to childprocess.

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

Nothing in the Ubuntu security tracker as well.

No CVEs/security issues in this software in the past.

This is a ruby library which does not provide any executable, nor systemd files.

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

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/543453300/buildlog_ubuntu-impish-amd64.ruby-childprocess_4.1.0-1_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-childprocess

The package does not have failing autopkgtests right now. Only in i386, where
some dependencies are not installable.

[Quality assurance - packaging]

debian/watch is present and works.

debian/control defines a correct Maintainer field.

Lintian overrides are not present. Here is the output of `lintian --pedantic` against Kinetic version:

W: ruby-childprocess source: unknown-field Ruby-Versions
P: ruby-childprocess source: update-debian-copyright 2012 vs 2021 [debian/copyright:28]

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/ubuntu/+source/ruby-childprocess/tree/debian/rules

[UI standards]

Application is not end-user facing (does not need translation).

[Dependencies]

There are further dependencies that are not yet in main, MIR for them
is at:

- ruby-ffi MIR bug: https://bugs.launchpad.net/ubuntu/+source/ruby-ffi/+bug/1990570

[Standards compliance]

This package correctly follows FHS and Debian Policy.

[Maintenance/Owner]

The 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 successfully built during the most recent test rebuild.

[Background information]

The Package description explains the package well.

Upstream Name is: childprocess

Link to upstream project: https://github.com/enkessler/childprocess

Tags: sec-1343

CVE References

description: updated
Changed in ruby-childprocess (Ubuntu):
assignee: nobody → Lukas Märdian (slyon)
Revision history for this message
Lukas Märdian (slyon) wrote :
Download full text (3.3 KiB)

Review for Package: src:ruby-childprocess

[Summary]
ruby-childprocess is a widely used ruby gem for inter process communication
between parent/child processes.

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: ruby-childprocess
Specific binary packages built, but NOT to be promoted to main: <None>

Notes:
- This is handling process IO between unknown/untrused processes. Therefore,
  I'll subscribe ~ubuntu-security

Required TODOs:
#0 get ruby-ffi promoted, MIR bug #1990570
#1 The server team still needs to subscribe to the package before promotion

Recommended TODOs:
- None

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

[Dependencies]
OK:
- no -dev/-debug/-doc packages that need exclusion
- No dependencies in main that are only superficially tested requiring
  more tests now.

Problems:
- needs ruby-ffi MIR: bug #1990570

[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
- does not run a daemon as root
- does not use webkit1,2
- does not use lib*v8 directly
- 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:
- opens an IPC channel (pipe) between parent and child processes
- parses generic process input/ouput (stdin/stdout/stderr)

[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
- not a python package
- not a go package

Problems: None

[Packaging red flags]
OK:
- Ubuntu does not carry a delta
- symbols tracking not applicable for this kind of code.
  (it's a ruby module/gem, not a binary library)
- d/watch is present and looks ok (if needed, e.g. non-native)
- Upstream update history is slow, but OK for this type of software
- Debian/Ubuntu update history is slow, but OK for this type of software
- the current release is packaged
- promoting this does not seem to cause issues for MOTUs that so far
  maintained the package
- no massive Lintian warnings
- d/rules is rather clean
- It is not on the lto-disabled list

Problems: None

[Upstream red flags]
OK:
- no Errors/warnings during the build
- no incautious use of malloc/sprintf (as far as we can check it)
- no use of sudo, gksu, pkexec, or LD_LIBRARY_PATH (usage is OK inside tests)
- no use of user nobody
- no use of setuid
- no important open bugs (c...

Read more...

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

Thanks for the review Lukas!

#0 ruby-ffi got ACKed by the MIR team.

#1 Server team will be subscribed before its promotion.

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

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

> Cross-platform Ruby library for managing child processes.

- CVE History:
  - none
    - CVE-2021-23352 is not related to Ruby or ruby-childprocess
  - upstream GitHub issue tracker is extremely well maintained
  - no Security Policy and no contact info in README
- Build-Depends?
  - lunar main
     - debhelper-compat (debhelper)
     - glibc (locales-all)
     - procps
  - lunar universe
     - gem2deb
     - ruby-rspec
     - ruby-coveralls
     - ruby-ffi
     - yard
- 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?
  - has autopkgtests
    - passing for >= jammy
  - contains some build tests
- cron jobs?
  - cron
- Build logs:
  - nothing significant

- Processes spawned?
  - childprocess has many process functions
    - e.g.,
      - ./lib/childprocess.rb defines close_on_exec()
      - ./lib/childprocess/unix/fork_exec_process.rb
      - ./lib/childprocess/unix/posix_spawn_process.rb
  - exit result checks could be added
    - e.g., will a forked process run properly if @io or @cwd are false?
      - these modules _should_ exist, what happens when `if` statements are removed
  - generator.rb's execute() compiles arbitrary C code
    - assuming this is trusted input
    - downstream MIRs must be check if input is safe
  - otherwise looks okay
- Memory management?
  - heavy use of FFI
  - commit d9b1580 is for Rubinus only
  - allocating memory size appears safe
- File IO?
  - FileActions class wraps file IO functions
    - part of library
  - PosixSpawnProcess and Generator class' file use looks safe
- Logging?
  - raises FFI errors where pertinent
  - errors defined in lib/childprocess/errors.rb
- Environment variable usage?
  - env variables are managed when forking processes
  - generator reads CC
- Use of privileged functions?
  - none
- Use of cryptography / random number sources etc?
  - none
- Use of temp files?
  - none
- Use of networking?
  - none
- 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?
  - none
- Any significant rubocop results?
  - none
    - rubocop complains about eval in spec files

Project is well maintained. Some error message include a url asking users to file GitHub issues, +1

Many functions, such as close_on_exec(), support using jruby. jruby is listed as a requirement in upstream's README. It is not part of the d/control. Files dedicated to jruby in ruby-childprocess require java. Comments in the code mention that jruby has edgecases that need to be handled. jruby exclusive code was not reviewed. I tested a patch that removed lib/childprocess/jruby* and it built--no further testing was attempting. Please consider removing jruby.

ruby-childprocess' generator.rb i...

Read more...

Changed in ruby-childprocess (Ubuntu):
assignee: Ubuntu Security Team (ubuntu-security) → nobody
status: New → In Progress
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Showing up in component mismatch now as planned.

Changed in ruby-childprocess (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 ruby-childprocess (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.