Bug 29018 - lib3mf new security issue CVE-2021-21772
Summary: lib3mf new security issue CVE-2021-21772
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: Security (show other bugs)
Version: 8
Hardware: All Linux
Priority: Normal critical
Target Milestone: ---
Assignee: QA Team
QA Contact: Sec team
URL:
Whiteboard: MGA8-64-OK
Keywords: advisory, validated_update
Depends on:
Blocks:
 
Reported: 2021-05-29 19:38 CEST by David Walser
Modified: 2021-07-25 10:35 CEST (History)
6 users (show)

See Also:
Source RPM: lib3mf-1.8.1-2.mga8.src.rpm
CVE: CVE-2021-21772
Status comment:


Attachments

Description David Walser 2021-05-29 19:38:06 CEST
Fedora has issued an advisory on March 22:
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/thread/WDGGB65YBQL662M3MOBNNJJNRNURW4TG/

The issue is fixed upstream in 2.0.1.

Mageia 8 is also affected.
David Walser 2021-05-29 19:38:20 CEST

Status comment: (none) => Fixed upstream in 2.0.1
Whiteboard: (none) => MGA8TOO

Comment 1 Nicolas Lécureuil 2021-07-19 02:51:45 CEST
New version pushed in cauldron.

Status comment: Fixed upstream in 2.0.1 => (none)
CC: (none) => mageia
Version: Cauldron => 8

Comment 2 Nicolas Lécureuil 2021-07-19 02:55:36 CEST
adding back cauldron as long as it does not build.

Version: 8 => Cauldron

David Walser 2021-07-19 03:12:33 CEST

Status comment: (none) => Fixed upstream in 2.0.1

Comment 3 David Walser 2021-07-19 21:57:58 CEST
lib3mf-2.1.1-2.mga9 uploaded for Cauldron by Jani.

For Mageia 8, there's:
lib3mf2-2.1.1-1.mga8
lib3mf-devel-2.1.1-1.mga8

from lib3mf-2.1.1-1.mga8.src.rpm

Status comment: Fixed upstream in 2.0.1 => (none)
Version: Cauldron => 8
CC: (none) => jani.valimaa
Assignee: geiger.david68210 => qa-bugs
Whiteboard: MGA8TOO => (none)

Comment 4 Nicolas Lécureuil 2021-07-19 22:17:07 CEST
we need to have openscad rebuilded now.
Comment 5 Aurelien Oudelet 2021-07-19 22:56:30 CEST
Advisory:
========================

Updated lib3mf packages fix a security vulnerability:

A use-after-free vulnerability exists in the NMR::COpcPackageReader::releaseZIP() functionality of 3MF Consortium lib3mf 2.0.0. A specially crafted 3MF file can lead to code execution. An attacker can provide a malicious file to trigger this vulnerability (CVE-2021-21772).

References:
 - https://bugs.mageia.org/show_bug.cgi?id=29018
 - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-21772
 - https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/thread/WDGGB65YBQL662M3MOBNNJJNRNURW4TG/
========================

Updated packages in core/updates_testing:
========================
lib(64)3mf2-2.1.1-1.mga8
lib(64)3mf-devel-2.1.1-1.mga8

from lib3mf-2.1.1-1.mga8.src.rpm

CC: (none) => ouaurelien

David Walser 2021-07-19 23:06:28 CEST

Assignee: qa-bugs => mageia
Status comment: (none) => openscad needs to be rebuilt against the updated library

Comment 6 Jani Välimaa 2021-07-20 15:59:48 CEST
A new pkg, act, was also imported to mga8 to be able to build lib3mf.
Comment 7 Jani Välimaa 2021-07-20 17:05:15 CEST
(In reply to Jani Välimaa from comment #6)
> A new pkg, act, was also imported to mga8 to be able to build lib3mf.

SRPM/RPM:
act-1.6.0-4.mga8
Comment 8 Jani Välimaa 2021-07-20 17:06:06 CEST
(In reply to Nicolas Lécureuil from comment #4)
> we need to have openscad rebuilded now.

Pushed a rebuild. SRPMS/RPMS:
openscad-2021.01-1.2.mga8
David Walser 2021-07-20 17:16:07 CEST

Status comment: openscad needs to be rebuilt against the updated library => (none)
Assignee: mageia => qa-bugs

Comment 9 Aurelien Oudelet 2021-07-20 22:07:12 CEST
Addendum to Comment 5:

A new package 'act' is introduced to build newer version of lib3mf.
Also, openscad is rebuilt against this updated library.


Updated packages in core/updates_testing:
========================
act-1.6.0-4.mga8
lib(64)3mf2-2.1.1-1.mga8
lib(64)3mf-devel-2.1.1-1.mga8
openscad-2021.01-1.2.mga8

from SRPMs:
lib3mf-2.1.1-1.mga8.src.rpm
act-1.6.0-4.mga8.src.rpm
openscad-2021.01-1.2.mga8.src.rpm
Comment 10 Len Lawrence 2021-07-22 20:08:14 CEST
mga8, x64

Installed the pre-testing packages.  Note lib643mf1.

Found no PoC for the CVE.
openscad and freecad are the main users of the library.  openscad is script based, freecad more of a framework with a server, gui and cli.

openscad tutorial: https://en.wikibooks.org/wiki/OpenSCAD_Tutorial
$ FreeCAD
starts the freecad gui, which was unresponsive here.
$ FreeCADCmd
starts the python interpreter.

Updated the packages and installed act.
FreeCAD was again unresponsive after displaying the logo, just an empty frame.
At a guess it needs a configuration file so that is a no-go.
FreeCADCmd launches the interactive python session OK.
None of this tests the library so it is tutorial time.
OpenSCAD launches from the Graphics menu with links to the examples in /usr/share/openscad which display a 3D solid when requested.
Closed it and ran it under strace.
$ strace -o scad.trace openscad
Opened an example, which provided another window with a code column, design area and a customizer and parameters section.
Selected new file, which cleared the board.
Selected new file.  Typed "code(10)" in the editor, pressed preview button in the design area and the render button to use the mouse to rotate the 3D view.
Saved the file newcube.scad to the user's home directory and exited.
That caused a segfault - did not go very far into the tutorial.
$ grep 3mf scad.trace | grep -v qa
openat(AT_FDCWD, "/lib64/lib3mf.so.2", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib64/lib3mf.so.2.1.1.0", O_RDONLY) = 25
openat(AT_FDCWD, "/usr/lib64/lib3mf.so.2.1.1.0", O_RDONLY) = 32

That is encouraging.  Passing this for 64-bits.

CC: (none) => tarazed25
Whiteboard: (none) => MGA8-64-OK

Comment 11 Thomas Andrews 2021-07-23 13:29:28 CEST
Validating. Advisory in Comment 5, with an addition in Comment 9.

Keywords: (none) => validated_update
CC: (none) => andrewsfarm, sysadmin-bugs

Aurelien Oudelet 2021-07-23 22:52:43 CEST

Keywords: (none) => advisory
CVE: (none) => CVE-2021-21772

Comment 12 Mageia Robot 2021-07-25 10:35:25 CEST
An update for this issue has been pushed to the Mageia Updates repository.

https://advisories.mageia.org/MGASA-2021-0368.html

Resolution: (none) => FIXED
Status: NEW => RESOLVED


Note You need to log in before you can comment on or make changes to this bug.