Bug 29806 - htmldoc new security issue CVE-2021-40985
Summary: htmldoc new security issue CVE-2021-40985
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: Security (show other bugs)
Version: 8
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: QA Team
QA Contact: Sec team
URL:
Whiteboard: MGA8-64-OK
Keywords: advisory, validated_update
Depends on:
Blocks:
 
Reported: 2021-12-23 17:41 CET by David Walser
Modified: 2022-01-15 09:11 CET (History)
8 users (show)

See Also:
Source RPM: htmldoc-1.9.8-1.2.mga8.src.rpm
CVE: CVE-2021-40985
Status comment:


Attachments

Description David Walser 2021-12-23 17:41:13 CET
SUSE has issued an advisory today (December 23):
https://lists.suse.com/pipermail/sle-security-updates/2021-December/009935.html

The issue is fixed upstream in 1.9.12.

Mageia 8 is also affected.
David Walser 2021-12-23 17:41:34 CET

Whiteboard: (none) => MGA8TOO
Status comment: (none) => Fixed upstream in 1.9.12
CC: (none) => nicolas.salguero

Comment 1 Lewis Smith 2021-12-23 20:28:03 CET
This SRPM has had various packagers, of whom NicolasS has done several recent CVEs, so assigning to you.

Assignee: bugsquad => nicolas.salguero

Comment 2 David Walser 2021-12-24 14:29:38 CET
Nicolas patched it again:
htmldoc-nogui-1.9.8-1.3.mga8
htmldoc-1.9.8-1.3.mga8

from htmldoc-1.9.8-1.3.mga8.src.rpm

We really should at least update Cauldron to 1.9.12.

Status comment: Fixed upstream in 1.9.12 => (none)
Whiteboard: MGA8TOO => (none)
Version: Cauldron => 8
Assignee: nicolas.salguero => qa-bugs

Comment 3 Nicolas Salguero 2021-12-24 14:33:41 CET
Suggested advisory:
========================

The updated packages fix a security vulnerability:

Buffer overflow vulnerability in htmldoc before 1.9.12, allows attackers to cause a denial of service via a crafted BMP image to image_load_bmp. (CVE-2021-40985)

References:
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-40985
https://lists.suse.com/pipermail/sle-security-updates/2021-December/009935.html
========================

Updated packages in core/updates_testing:
========================
htmldoc-nogui-1.9.8-1.3.mga8
htmldoc-1.9.8-1.3.mga8

from SRPM:
htmldoc-1.9.8-1.3.mga8.src.rpm

Status: NEW => ASSIGNED

Nicolas Salguero 2021-12-24 14:33:51 CET

CVE: (none) => CVE-2021-40985

Nicolas Salguero 2021-12-24 14:34:11 CET

Source RPM: htmldoc-1.9.8-3.mga9.src.rpm => htmldoc-1.9.8-1.2.mga8.src.rpm

Comment 4 Hugues Detavernier 2021-12-25 12:56:20 CET
Mageia 8 X64 Gnome

Installed without any problem.

I tried to generate a pdf file with GUI HTMLDOC but I've got always this error:

Segmentation Error (core dumped)

Maybe I don't use the good options.

No problem with cli.

I generate a pdf and a epub files from a complex html page.

CC: (none) => hdetavernier

Comment 5 Herman Viaene 2021-12-27 10:45:17 CET
MGA8-64 Plasma on Lenovo B50 in Dutch
No installation issues
I can confirm the issue Hugues reported above with GUI: I launched the htmldoc from the CLI and I can define all settings in the different tabs of the interface, but as I click "Generate" the program s aborted and the Segmentation error is on the feedbackin the CLI.

CC: (none) => herman.viaene

Comment 6 Thomas Andrews 2022-01-07 23:10:21 CET
Hugues, Herman, did either of you try the htmldoc gui BEFORE installing the update?

Installed htmldoc and dependency:

The following 3 packages are going to be installed:

- htmldoc-1.9.8-1.2.mga8.x86_64
- htmldoc-nogui-1.9.8-1.2.mga8.x86_64
- lib64fltk1.3-1.3.5-2.mga8.x86_64

After installation, I tried converting a simple html file into a pdf, but when I hit the "Generate" button I get the same segmentation error you guys are reporting with the update.

Last update was in late June/early July, bug 29101 and bug 29161. Nobody reported anything like that at that time. Am I doing something wrong?

Could someone try a new install of the current version and confirm what I'm seeing?

CC: (none) => andrewsfarm

Comment 7 Len Lawrence 2022-01-08 01:36:27 CET
@TJ, referring to comment 6

Yes, before updating htmldoc segfaults with the same test.

CC: (none) => tarazed25

Comment 8 Len Lawrence 2022-01-08 01:55:34 CET
Continuing from comment 7:
The updated version behaves in the same way - segfault -> gui vanishes.
Comment 9 Thomas Andrews 2022-01-08 02:26:26 CET
Sending it back to Nicolas because of the segfault when the "Generate" button is pressed in the gui.

Since this problem exists in the current version and the proposed update for Mageia 8, I believe Cauldron should be examined, too.

Assignee: qa-bugs => nicolas.salguero

Comment 10 Len Lawrence 2022-01-08 09:48:15 CET
Just tried the same test on htmldoc in Cauldron and it failed with a segfault on Generate.  For the record:
Add a user HTML file
Select it
Open it
Check pdf
No compression
Generate

Back in mga8 repeated the test under strace.
$ tail htmldoc.trace
read(4, "d0 Macron\nf6d1 cyrBreve\nf6d2 cyr"..., 4096) = 2668
read(4, "", 4096)                       = 0
close(4)                                = 0
openat(AT_FDCWD, "/usr/share/htmldoc/data/iso-8859-1", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0444, st_size=2292, ...}) = 0
read(4, "0x20 0x0020\n0x21 0x0021\n0x22 0x0"..., 4096) = 2292
read(4, "", 4096)                       = 0
close(4)                                = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x78} ---
+++ killed by SIGSEGV (core dumped) +++
Comment 11 Nicolas Lécureuil 2022-01-10 00:20:06 CET
if the segfault exists even before the patch maybe this should not block the update but in parallel we should open a new bugreport.

CC: (none) => mageia

Comment 12 David Walser 2022-01-10 00:27:07 CET
Agreed.

Assignee: nicolas.salguero => qa-bugs

Comment 13 Thomas Andrews 2022-01-11 23:26:10 CET
(In reply to Nicolas Lécureuil from comment #11)
> if the segfault exists even before the patch maybe this should not block the
> update but in parallel we should open a new bugreport.

Giving this bug an OK then, and validating. Advisory in Comment 3.

I suppose the new bug report should probably be opened against Cauldron, with an MGA8TOO in the whiteboard. I would do that, but I don't presently have a Cauldron install so I have not personally observed the problem there. 

Would one of you care to take care of it?

Whiteboard: (none) => MGA8-64-OK
Keywords: (none) => validated_update
CC: (none) => sysadmin-bugs

Dave Hodgins 2022-01-14 22:32:19 CET

CC: (none) => davidwhodgins
Keywords: (none) => advisory

Comment 14 Mageia Robot 2022-01-15 09:11:16 CET
An update for this issue has been pushed to the Mageia Updates repository.

https://advisories.mageia.org/MGASA-2022-0014.html

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


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