[MIR] libfprint

Bug #1745454 reported by Marco Trevisan (Treviño)
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libfprint (Ubuntu)
Fix Released
High
Unassigned

Bug Description

[Availability]

Already in universe, in sync with debian.

Built for all supported architectures.

[Rationale]

Ubuntu desktop team wants to enable fingerprint lockscreen unlock support by default in GNOME installations and this source package includes the library used by the fingerprint daemon (fprintd) and the devices drivers.

[Security]

No known security issues.

https://security-tracker.debian.org/tracker/source-package/libfprint
https://launchpad.net/libfprint/+cve

[Quality assurance]

- The Ubuntu Desktop bugs team is subscribed.

https://bugs.launchpad.net/ubuntu/+source/libfprint
https://bugs.debian.org/cgi-bin/pkgreport.cgi?src=libfprint
https://bugs.freedesktop.org/buglist.cgi?component=libfprint&product=libfprint

No upstream tests or autopkgtests.

[Dependencies]

No universe binary dependencies

[Standards compliance]

The package meets the FHS and Debian Policy standards (3.9.8)

[Maintenance]

- Maintened upstream. Last release was 0.7.0 in May
https://cgit.freedesktop.org/libfprint/libfprint/log/

Since new devices support has been added later, it might make sense to ask upstream a new release though.

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Looks generally good, some small things I need to get some clarification on:

[ required ]
- There is some lintian warning on the udev rule: udev-rule-missing-uaccess
* Check for a fix with upstream
* Override it in lintian with rationale

[ optional ]
- debian/copyright is clearly out of date, would be better to get it updated with latest copyright owners
- bonus point if you introduce dh_missing --fail-missing
- the -dev package ships a .la file that we normally strip on normal install

As for fprintd, I would like to get a security review on this one to confirm everything's fine.

Changed in libfprint (Ubuntu):
assignee: nobody → Canonical Security Team (canonical-security)
Changed in libfprint (Ubuntu):
assignee: Canonical Security Team (canonical-security) → Ubuntu Security Team (ubuntu-security)
Revision history for this message
Seth Arnold (seth-arnold) wrote :
Download full text (5.9 KiB)

I reviewed libfprint version 1:0.7.0-1 as checked into cosmic. This
shouldn't be considered a full security audit but rather a quick gauge of
maintainability.

- There are no CVEs for libfprint in our CVE database
- libfprint provides drivers to fingerprint readers, fingerprint storage,
  and manipulation
- Build-Depends: debhelper, libusb-1.0-0-dev, libglib2.0-dev,
  libpixman-1-dev, libxv-dev, libnss3-dev
- Does not daemonize
- Does not do networking
- Does not do cryptography
- postinst runs ~60 udevadm trigger commands for various hardware
  parameters, probably fine
- No initscripts
- No dbus services
- No systemd unit files
- No setuid files
- No binaries in usual bin/
- No sudo fragments
- Extensive udev rules, nodes set to 664, group plugdev
- No tests
- No cronjobs
- Build logs show deprecation warnings, unused variables warnings,
  misleading indentation
- Build logs show large number of lintian warnings and errors

- No subprocesses spawned
- Memory management frequently assumes no integer overflows in allocation
  requests, copy requests, etc. It's not up to modern quality.
- Some file IO, with names potentially coming from outside the library
- Logging functions looked okay
- Uses LIBFPRINT_DEBUG and HOME environment variables
- No privileged operations
- No cryptography
- No networking
- No temporary files
- No WebKit
- No JavaScript
- No PolicyKit
- ~six real issues found via cppcheck

This code is mixed quality. Some is pretty old and no longer up to modern
standards. Some is pretty good. Upstream authors mentioned insufficient
time to address issues due to faulty or malicious hardware. The things
I've found may very well only be issues in the face of malicious hardware.

However, malicious hardware abounds -- and people will pick anything that
looks like a USB mass storage device and plug it into their computer.

So I'm not thrilled about adding this attack surface to our distribution.

Furthermore, the Ubuntu security team is strongly of the opinion that
fingerprints themselves, even in an ideal world, are strictly *usernames*
and not suitable as passwords. Any configurations we support will adhere
to this. Screen unlocking via fingerprint is fine, because we also support
password-less logins and password-less unlocks if users choose to
configure their systems in such a fashion, and unlock-via-fingerprint is
not that different.

Here's some notes I took while reviewing the code base. There's a list of
lintian warnings and errors at the end:

- get_score_filename() assumes the listfile parameter NEVER receives "" as
  an input value. Also gives an inane error message if the outdir argument
  is "". I'm curious why basename does any strrchr() things, it feels like
  a mistake.

- fp_img_save_to_file() leaks 'fd' via r < 0 and r < write_size error
  return paths

- bz_load() leaks 'fd' via m != 3 && m != and m != nargs_expected return
  paths

- alloc_power_stats() multiple integer overflow possibilities; parameter
  'nstats' appears to come from outside the library in at least one code
  path, so this routine should handle large values properly: change the
  malloc() calls to calloc() calls.

- alloc_power_stats() leaks 'powm...

Read more...

Changed in libfprint (Ubuntu):
assignee: Ubuntu Security Team (ubuntu-security) → nobody
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for the review, the lintian warnings have been addressed in debian&cosmic with the changes from
https://launchpad.net/ubuntu/+source/libfprint/1:0.8.2-1

> W: libfprint-dev: priority-extra-is-replaced-by-priority-optional
> W: libfprint0: priority-extra-is-replaced-by-priority-optional

  * debian/control: Bump all the packages to priority optional, priority extra
    is now deprecated

> W: libfprint source: debian-rules-uses-unnecessary-dh-argument dh ... --parallel (line 7)

  * debian/rules: Do not explicitly pass --parallel to debhelper as it's the
    default now

> W: libfprint0: udev-rule-missing-uaccess lib/udev/rules.d/60-libfprint0.rules:2 user accessible device missing TAG+="uaccess"
> W: libfprint0: udev-rule-missing-uaccess lib/udev/rules.d/60-libfprint0.rules:6 user accessible device missing TAG+="uaccess"

  * debian/libfprint0.lintian-overrides: Overrides udev-rule-missing-uaccess,
    we don't want the readers to be accessible by unprivileged users

Changed in libfprint (Ubuntu):
importance: Undecided → High
status: New → Fix Committed
Revision history for this message
Matthias Klose (doko) wrote :

Override component to main
libfprint 1:0.8.2-2 in cosmic: universe/libs -> main
libfprint-dev 1:0.8.2-2 in cosmic amd64: universe/libdevel/extra/100% -> main
libfprint-dev 1:0.8.2-2 in cosmic arm64: universe/libdevel/extra/100% -> main
libfprint-dev 1:0.8.2-2 in cosmic armhf: universe/libdevel/extra/100% -> main
libfprint-dev 1:0.8.2-2 in cosmic i386: universe/libdevel/extra/100% -> main
libfprint-dev 1:0.8.2-2 in cosmic ppc64el: universe/libdevel/extra/100% -> main
libfprint-dev 1:0.8.2-2 in cosmic s390x: universe/libdevel/extra/100% -> main
libfprint-doc 1:0.8.2-2 in cosmic amd64: universe/doc/optional/100% -> main
libfprint-doc 1:0.8.2-2 in cosmic arm64: universe/doc/optional/100% -> main
libfprint-doc 1:0.8.2-2 in cosmic armhf: universe/doc/optional/100% -> main
libfprint-doc 1:0.8.2-2 in cosmic i386: universe/doc/optional/100% -> main
libfprint-doc 1:0.8.2-2 in cosmic ppc64el: universe/doc/optional/100% -> main
libfprint-doc 1:0.8.2-2 in cosmic s390x: universe/doc/optional/100% -> main
libfprint0 1:0.8.2-2 in cosmic amd64: universe/libs/extra/100% -> main
libfprint0 1:0.8.2-2 in cosmic arm64: universe/libs/extra/100% -> main
libfprint0 1:0.8.2-2 in cosmic armhf: universe/libs/extra/100% -> main
libfprint0 1:0.8.2-2 in cosmic i386: universe/libs/extra/100% -> main
libfprint0 1:0.8.2-2 in cosmic ppc64el: universe/libs/extra/100% -> main
libfprint0 1:0.8.2-2 in cosmic s390x: universe/libs/extra/100% -> main
19 publications overridden.

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