Bug 2008914 (CVE-2021-41098)

Summary: CVE-2021-41098 rubygem-nokogiri: XEE on JRuby
Product: [Other] Security Response Reporter: Guilherme de Almeida Suckevicz <gsuckevi>
Component: vulnerabilityAssignee: Nobody <nobody>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: akarol, amackenz, amasferr, bbuckingham, bcourt, bkearney, chazlett, dmetzger, ehelms, extras-orphan, gmccullo, gparvin, gtanzill, jfrey, jhardy, jsherril, kaycoth, lzap, mhulan, mkudlej, mtasaka, nmoumoul, obarenbo, orabin, pahickey, pcreech, pvalena, rchan, ruby-maint, saroy, simaishi, smallamp, stcannon, tjochec, vanmeeuwen+fedora, vondruch
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: rubygem-nokogiri 1.12.5 Doc Type: If docs needed, set a value
Doc Text:
A XML External Entity Reference (XXE) vulnerability was found in RubyGem Nokogiri on JRuby (Java implementation of the Ruby). If attacker is able to insert untrusted XML input containing a reference to an external entity, it is processed by a weakly configured SAX parser, resulting disclosure of confidential data and server side request forgery. The highest threat from this vulnerability is to system confidentiality.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-10-01 13:28:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2008915, 2008916, 2009647    
Bug Blocks: 2008917    

Description Guilherme de Almeida Suckevicz 2021-09-29 13:40:00 UTC
Nokogiri is a Rubygem providing HTML, XML, SAX, and Reader parsers with XPath and CSS selector support. In Nokogiri v1.12.4 and earlier, on JRuby only, the SAX parser resolves external entities by default. Users of Nokogiri on JRuby who parse untrusted documents using any of these classes are affected: Nokogiri::XML::SAX::Parse, Nokogiri::HTML4::SAX::Parser or its alias Nokogiri::HTML::SAX::Parser, Nokogiri::XML::SAX::PushParser, and Nokogiri::HTML4::SAX::PushParser or its alias Nokogiri::HTML::SAX::PushParser. JRuby users should upgrade to Nokogiri v1.12.5 or later to receive a patch for this issue. There are no workarounds available for v1.12.4 or earlier. CRuby users are not affected.

Reference:
https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-2rr5-8q37-2w7h

Upstream patch:
https://github.com/sparklemotion/nokogiri/commit/5bf729ff3cc84709ee3c3248c981584088bf9f6d

Comment 1 Guilherme de Almeida Suckevicz 2021-09-29 13:40:24 UTC
Created rubygem-nokogiri tracking bugs for this issue:

Affects: epel-7 [bug 2008916]
Affects: fedora-all [bug 2008915]

Comment 2 Mamoru TASAKA 2021-09-29 13:56:36 UTC
Please look at the upstream info precisely.

> JRuby users should upgrade to Nokogiri v1.12.5 
> CRuby users are not affected.

Comment 3 juneau 2021-09-29 14:07:55 UTC
services-sources notaffected

Comment 7 Yadnyawalk Tale 2021-10-08 19:48:15 UTC
Haven't seen ManageIQ or Katello using JRuby. I do know theforeman project have some usage for Puppet client and server's Puppet module but JRuby not getting used in downstream. Thus, Red Hat CloudForms and Red Hat Satellite are not affected by this.