Bug 28141 - ruby-nokogiri new security issues CVE-2019-5477 and CVE-2020-26247
Summary: ruby-nokogiri new security issues CVE-2019-5477 and CVE-2020-26247
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: Security (show other bugs)
Version: 7
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: QA Team
QA Contact: Sec team
URL: https://nvd.nist.gov/vuln/detail/CVE-...
Whiteboard: MGA7-64-OK
Keywords: advisory, validated_update
Depends on:
Blocks:
 
Reported: 2021-01-17 12:05 CET by Zombie Ryushu
Modified: 2021-02-04 14:41 CET (History)
6 users (show)

See Also:
Source RPM: ruby-nokogiri-1.10.1-1.mga7.src.rpm
CVE: CVE-2019-5477, CVE-2020-26247
Status comment:


Attachments
A few basic commands for nokogiri in a ruby script (953 bytes, application/x-ruby)
2021-02-02 19:22 CET, Len Lawrence
Details
Specimen XML file (791 bytes, text/xml)
2021-02-02 19:38 CET, Len Lawrence
Details
Script with some basic commands for ruby nokogiri (949 bytes, application/x-ruby)
2021-02-02 20:03 CET, Len Lawrence
Details

Description Zombie Ryushu 2021-01-17 12:05:38 CET
Nokogiri is a Rubygem providing HTML, XML, SAX, and Reader parsers with XPath and CSS selector support. In Nokogiri before version 1.11.0.rc4 there is an XXE vulnerability. XML Schemas parsed by Nokogiri::XML::Schema are trusted by default, allowing external resources to be accessed over the network, potentially enabling XXE or SSRF attacks. This behavior is counter to the security policy followed by Nokogiri maintainers, which is to treat all input as untrusted by default whenever possible. This is fixed in Nokogiri version 1.11.0.rc4.
Zombie Ryushu 2021-01-17 12:05:54 CET

CVE: (none) => CVE-2020-26247

Comment 1 David Walser 2021-01-17 17:40:24 CET
https://cve.mitre.org/cgi-bin/cvename.cgi?name=2020-26247
https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-vr8q-g5c7-m54m
https://ubuntu.com/security/CVE-2020-26247
https://bugzilla.redhat.com/show_bug.cgi?id=1912487

Whiteboard: (none) => MGA7TOO
Summary: ruby-nokogiri security issue CVE-2020-26247 => ruby-nokogiri new security issue CVE-2020-26247

David Walser 2021-01-17 19:00:51 CET

Status comment: (none) => Patch available from upstream

Comment 2 Nicolas Lécureuil 2021-01-17 19:21:39 CET
Freeze push asked

CC: (none) => mageia

Comment 3 Lewis Smith 2021-01-17 21:53:21 CET
Checked not a duplicate.
Assigning to Pascal as the main committer of this; NicolasL is alreadyy CC'd.

Assignee: bugsquad => pterjan

Comment 4 Nicolas Lécureuil 2021-01-19 09:23:30 CET
fixed in cauldron

Version: Cauldron => 7
Whiteboard: MGA7TOO => (none)

Comment 5 David Walser 2021-01-19 15:19:24 CET
Fixed in ruby-nokogiri-1.11.1-1.mga8.
Comment 6 David Walser 2021-01-26 05:43:25 CET
SUSE has issued an advisory for this today (January 25):
https://lists.suse.com/pipermail/sle-security-updates/2021-January/008244.html

It also fixes another CVE, fixed upstream in 1.10.4.

Summary: ruby-nokogiri new security issue CVE-2020-26247 => ruby-nokogiri new security issues CVE-2019-5477 and CVE-2020-26247
Status comment: Patch available from upstream => Patches available from upstream
Source RPM: ruby-nokogiri-1.10.10-1.mga8.src.rpm => ruby-nokogiri-1.10.1-1.mga7.src.rpm

Pascal Terjan 2021-01-27 21:45:44 CET

Status: NEW => ASSIGNED

Comment 7 Pascal Terjan 2021-01-27 21:52:31 CET
Given that there are a few behaviour changes / removed methods in 1.11.0 I will go with 1.10.10 + patch for CVE-2020-26247 for Mageia 7
Comment 8 Pascal Terjan 2021-01-29 19:27:55 CET
ruby-nokogiri-1.10.10-1.mga7 is in core/updates_testing
Comment 9 David Walser 2021-01-29 20:05:44 CET
Advisory:
========================

Updated ruby-nokogiri packages fix security vulnerabilities:

A command injection vulnerability in Nokogiri v1.10.3 and earlier allows
commands to be executed in a subprocess via Ruby's `Kernel.open` method.
Processes are vulnerable only if the undocumented method
`Nokogiri::CSS::Tokenizer#load_file` is being called with unsafe user input as
the filename (CVE-2019-5477).

In Nokogiri before version 1.11.0.rc4 there is an XXE vulnerability. XML
Schemas parsed by Nokogiri::XML::Schema are trusted by default, allowing
external resources to be accessed over the network, potentially enabling XXE or
SSRF attacks. This behavior is counter to the security policy followed by
Nokogiri maintainers, which is to treat all input as untrusted by default
whenever possible (CVE-2020-26247).

The ruby-nokogiri package has been updated to version 1.10.10 to fix
CVE-2019-5477 and patched to fix CVE-2020-26247.

References:
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-5477
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-26247
https://github.com/sparklemotion/nokogiri/releases/
https://lists.suse.com/pipermail/sle-security-updates/2021-January/008244.html
========================

Updated packages in core/updates_testing:
========================
ruby-nokogiri-1.10.10-1.mga7
ruby-nokogiri-doc-1.10.10-1.mga7

from ruby-nokogiri-1.10.10-1.mga7.src.rpm

Status comment: Patches available from upstream => (none)
Assignee: pterjan => qa-bugs
CC: (none) => pterjan

Comment 10 Len Lawrence 2021-02-02 19:22:55 CET
Created attachment 12300 [details]
A few basic commands for nokogiri in a ruby script

The channels.xspf file should be replaced by whatever XML file is to hand.

CC: (none) => tarazed25

Comment 11 Len Lawrence 2021-02-02 19:33:50 CET
mga7, x86_64

Installed nokogiri and updated the two packages because there is no easy way to demonstrate an exploit.

Consulted https://nokogiri.org/tutorials/parsing_an_html_xml_document.html for help running a few basic commands - see the attached script.

$ ruby nokogiri_trial.rb
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body><h1>Mr. Belvedere Fan Club</h1></body></html>

<?xml version="1.0"?>
<root>
  <aliens>
    <alien>
      <name>Alf</name>
    </alien>
  </aliens>
</root>
<?xml version="1.0" encoding="UTF-8"?>
<playlist xmlns="http://xspf.org/ns/0/" xmlns:vlc="http://www.videolan.org/vlc/playlist/ns/0/" version="1">
	<title>DVB Playlist</title>
	<creator>w_scan2-1.0.9</creator>
	<info>https://github.com/stefantalpalaru/w_scan2</info>
	<trackList>
		<track>
			<title>0001. STV</title>
			<location>dvb-t://frequency=498000000</location>
			<extension application="http://www.videolan.org/vlc/playlist/0">

Al Bundy
Bud Bundy
Marcy Darcy
Larry Appleton
Balki Bartokomous
John "Hannibal" Smith
Templeton "Face" Peck
"B.A." Baracus
"Howling Mad" Murdock

shows.xml was copied from the tutorial site.

There is a lot more to the parser than this but it is too big a job to take this any further so it can be sent on.
Comment 12 Len Lawrence 2021-02-02 19:38:07 CET
Created attachment 12301 [details]
Specimen XML file

This was copied from the tutorial pages at https://nokogiri.org/tutorials/parsing_an_html_xml_document.html

The web_doc.html file is written on the fly.
Len Lawrence 2021-02-02 19:38:28 CET

Whiteboard: (none) => MGA7-64-OK

Comment 13 Len Lawrence 2021-02-02 20:03:18 CET
Created attachment 12302 [details]
Script with some basic commands for ruby nokogiri
Comment 14 Thomas Andrews 2021-02-04 02:07:57 CET
Validating. Advisory in Comment 9.

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

Comment 15 Aurelien Oudelet 2021-02-04 13:53:08 CET
Advisory commited to SVN.

Keywords: (none) => advisory
CVE: CVE-2020-26247 => CVE-2019-5477, CVE-2020-26247
CC: (none) => ouaurelien

Comment 16 Mageia Robot 2021-02-04 14:41:38 CET
An update for this issue has been pushed to the Mageia Updates repository.

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

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


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