Hash: SHA256

             AUSCERT External Security Bulletin Redistribution

                     Multiple vulnerabilities in Ruby
                               6 April 2021


        AusCERT Security Bulletin Summary

Product:           Ruby
Publisher:         Ruby
Operating System:  UNIX variants (UNIX, Linux, OSX)
Impact/Access:     Create Arbitrary Files -- Remote/Unauthenticated      
                   Reduced Security       -- Remote with User Interaction
Resolution:        Patch/Upgrade
CVE Names:         CVE-2021-28966 CVE-2021-28965 

Reference:         ESB-2019.2958

Original Bulletin: 

Comment: This bulletin contains two (2) Ruby security advisories.

- --------------------------BEGIN INCLUDED TEXT--------------------

CVE-2021-28965: XML round-trip vulnerability in REXML

Posted by mame on 5 Apr 2021

There is an XML round-trip vulnerability in REXML gem bundled with Ruby. This
vulnerability has been assigned the CVE identifier CVE-2021-28965 . We strongly
recommend upgrading the REXML gem.


When parsing and serializing a crafted XML document, REXML gem (including the
one bundled with Ruby) can create a wrong XML document whose structure is
different from the original one. The impact of this issue highly depends on
context, but it may lead to a vulnerability in some programs that are using

Please update REXML gem to version 3.2.5 or later.

If you are using Ruby 2.6 or later:

  o Please use Ruby 2.6.7, 2.7.3, or 3.0.1.
  o Alternatively, you can use gem update rexml to update it. If you are using
    bundler, please add gem "rexml", ">= 3.2.5" to your Gemfile .

If you are using Ruby 2.5.8 or prior:

  o Please use Ruby 2.5.9.
  o You cannot use gem update rexml for Ruby 2.5.8 or prior.
  o Note that Ruby 2.5 series is now EOL, so please consider upgrading Ruby to
    2.6.7 or later as soon as possible.

Affected versions

  o Ruby 2.5.8 or prior (You can NOT use gem upgrade rexml for this version.)
  o Ruby 2.6.7 or prior
  o Ruby 2.7.2 or prior
  o Ruby 3.0.1 or prior
  o REXML gem 3.2.4 or prior


Thanks to Juho Nurminen for discovering this issue.


  o Originally published at 2021-04-05 12:00:00 (UTC)

- --------------------------------------------------------------------------------

CVE-2021-28966: Path traversal in Tempfile on Windows

Posted by mame on 5 Apr 2021

There is an unintentional directory creation vulnerability in tmpdir library
bundled with Ruby on Windows. And there is also an unintentional file creation
vulnerability in tempfile library bundled with Ruby on Windows, because it uses
tmpdir internally. This vulnerability has been assigned the CVE identifier
CVE-2021-28966 .


Dir.mktmpdir method introduced by tmpdir library accepts the prefix and the
suffix of the directory which is created as the first parameter. The prefix can
contain relative directory specifiers "..\\" , so this method can be used to
target any directory. So, if a script accepts an external input as the prefix,
and the targeted directory has inappropriate permissions or the ruby process
has inappropriate privileges, the attacker can create a directory or a file at
any directory.

This is the same issue as CVE-2018-6914 , but the previous fix was incomplete
on Windows.

All users running an affected release should upgrade immediately.

Affected versions

  o Ruby 2.7.2 or prior
  o Ruby 3.0.0


Thanks to Bugdiscloseguys for discovering this issue.


  o Originally published at 2021-04-05 12:00:00 (UTC)

- --------------------------END INCLUDED TEXT--------------------

You have received this e-mail bulletin as a result of your organisation's
registration with AusCERT. The mailing list you are subscribed to is
maintained within your organisation, so if you do not wish to continue
receiving these bulletins you should contact your local IT manager. If
you do not know who that is, please send an email to auscert@auscert.org.au
and we will forward your request to the appropriate person.

NOTE: Third Party Rights
This security bulletin is provided as a service to AusCERT's members.  As
AusCERT did not write the document quoted above, AusCERT has had no control
over its content. The decision to follow or act on information or advice
contained in this security bulletin is the responsibility of each user or
organisation, and should be considered in accordance with your organisation's
site policies and procedures. AusCERT takes no responsibility for consequences
which may arise from following or acting on information or advice contained in
this security bulletin.

NOTE: This is only the original release of the security bulletin.  It may
not be updated when updates to the original are made.  If downloading at
a later date, it is recommended that the bulletin is retrieved directly
from the author's website to ensure that the information is still current.

Contact information for the authors of the original document is included
in the Security Bulletin above.  If you have any questions or need further
information, please contact them directly.

Previous advisories and external security bulletins can be retrieved from:


Australian Computer Emergency Response Team
The University of Queensland
Qld 4072

Internet Email: auscert@auscert.org.au
Facsimile:      (07) 3365 7031
Telephone:      (07) 3365 4417 (International: +61 7 3365 4417)
                AusCERT personnel answer during Queensland business hours
                which are GMT+10:00 (AEST).
                On call after hours for member emergencies only.
Comment: http://www.auscert.org.au/render.html?it=1967