Bug 30882 - batik new security issues CVE-2022-38398, CVE-2022-38648, CVE-2022-40146, CVE-2022-41704, CVE-2022-42890
Summary: batik new security issues CVE-2022-38398, CVE-2022-38648, CVE-2022-40146, CVE...
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: Security (show other bugs)
Version: 9
Hardware: All Linux
Priority: Normal major
Target Milestone: ---
Assignee: QA Team
QA Contact: Sec team
URL:
Whiteboard: MGA9-64-OK
Keywords: advisory, validated_update
Depends on:
Blocks:
 
Reported: 2022-09-23 17:56 CEST by David Walser
Modified: 2024-03-16 17:29 CET (History)
5 users (show)

See Also:
Source RPM: batik-1.14-4.mga9.src.rpm
CVE: CVE-2022-38398, CVE-2022-38648, CVE-2022-40146, CVE-2022-41704, CVE-2022-42890
Status comment:


Attachments
SVG generator java script (1.31 KB, text/plain)
2024-03-15 15:20 CET, Len Lawrence
Details

David Walser 2022-09-23 17:57:05 CEST

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

Comment 1 David Walser 2022-10-25 14:33:53 CEST
Apache has issued advisories today (October 25):
https://www.openwall.com/lists/oss-security/2022/10/25/2
https://www.openwall.com/lists/oss-security/2022/10/25/3

The issues are fixed upstream in 1.16.

Summary: batik new security issues CVE-2022-38398, CVE-2022-38648, CVE-2022-40146 => batik new security issues CVE-2022-38398, CVE-2022-38648, CVE-2022-40146, CVE-2022-41704, CVE-2022-42890
Status comment: Fixed upstream in 1.15 => Fixed upstream in 1.16

Comment 2 David Walser 2022-10-31 15:08:00 CET
(In reply to David Walser from comment #1)
> Apache has issued advisories today (October 25):
> https://www.openwall.com/lists/oss-security/2022/10/25/2
> https://www.openwall.com/lists/oss-security/2022/10/25/3
> 
> The issues are fixed upstream in 1.16.

Debian has issued an advisory for this on October 29:
https://www.debian.org/security/2022/dsa-5264
Comment 3 David Walser 2023-06-20 14:48:13 CEST
Ubuntu has issued an advisory for this on May 30:
https://ubuntu.com/security/notices/USN-6117-1
Comment 4 Nicolas Salguero 2024-03-14 11:34:51 CET
Suggested advisory:
========================

The updated packages fix security vulnerabilities:

Server-Side Request Forgery (SSRF) vulnerability in Batik of Apache XML Graphics allows an attacker to load a url thru the jar protocol. (CVE-2022-38398)

Server-Side Request Forgery (SSRF) vulnerability in Batik of Apache XML Graphics allows an attacker to fetch external resources. (CVE-2022-38648)

Server-Side Request Forgery (SSRF) vulnerability in Batik of Apache XML Graphics allows an attacker to access files using a Jar url. (CVE-2022-40146)

A vulnerability in Batik of Apache XML Graphics allows an attacker to run untrusted Java code from an SVG. (CVE-2022-41704)

A vulnerability in Batik of Apache XML Graphics allows an attacker to run Java code from untrusted SVG via JavaScript. (CVE-2022-42890)

References:
https://www.openwall.com/lists/oss-security/2022/09/22/2
https://www.openwall.com/lists/oss-security/2022/09/22/3
https://www.openwall.com/lists/oss-security/2022/09/22/4
https://www.openwall.com/lists/oss-security/2022/10/25/2
https://www.openwall.com/lists/oss-security/2022/10/25/3
https://www.debian.org/security/2022/dsa-5264
https://ubuntu.com/security/notices/USN-6117-1
========================

Updated packages in core/updates_testing:
========================
batik-1.14-4.1.mga9
batik-css-1.14-4.1.mga9
batik-demo-1.14-4.1.mga9
batik-javadoc-1.14-4.1.mga9
batik-rasterizer-1.14-4.1.mga9
batik-slideshow-1.14-4.1.mga9
batik-squiggle-1.14-4.1.mga9
batik-svgpp-1.14-4.1.mga9
batik-ttf2svg-1.14-4.1.mga9
batik-util-1.14-4.1.mga9

from SRPM:
batik-1.14-4.1.mga9.src.rpm

Whiteboard: MGA8TOO => (none)
Assignee: java => qa-bugs
Version: Cauldron => 9
Source RPM: batik-1.14-2.mga9.src.rpm => batik-1.14-4.mga9.src.rpm
CVE: (none) => CVE-2022-38398, CVE-2022-38648, CVE-2022-40146, CVE-2022-41704, CVE-2022-42890
Status: NEW => ASSIGNED
Status comment: Fixed upstream in 1.16 => (none)
CC: (none) => nicolas.salguero

katnatek 2024-03-14 19:57:18 CET

Keywords: (none) => advisory

Comment 5 Len Lawrence 2024-03-15 12:53:17 CET
Having a look at this.

CC: (none) => tarazed25

Comment 6 Herman Viaene 2024-03-15 14:05:48 CET
MGA9-64 Plasma Wayland on HP-Pavillion
No installation issues
Previous update 28439 concluded this requires specialized knowledge and OK'ed on clean install.
I wonder whether Len can come up with something more conclusive.

CC: (none) => herman.viaene

Comment 7 Len Lawrence 2024-03-15 15:20:56 CET
Created attachment 14460 [details]
SVG generator  java script

File from
https://xmlgraphics.apache.org/batik/using/svg-generator.html
which might be useful.
It does not compile as it stands - needs something extra which might be obvious to a java expert.
Comment 8 Len Lawrence 2024-03-15 15:35:10 CET
Not really Herman.
Apache Batik SVG toolkit

CVE-2022-38398
https://issues.apache.org/jira/browse/BATIK-1331
test.svg
No indication of how to use it.  It displays as a blank rectangle in a browser and with display.  In a browser it appears as a black rectangle which turns blue when clicked on.
"Jar url should be blocked by DefaultExternalResourceSecurity"
The file contains such a link.
The general idea is that it should be run via batik but cannot figure out how.
Presumably it would fail after the update because it contains a suspicious link.

Tried to get to grips with the attached script to use batik but that refused to compile.  I have little experience of java.
$ javac generator.java
generator.java:14: error: class TestSVGGen is public, should be declared in a file named TestSVGGen.java
public class TestSVGGen {
       ^
generator.java:8: error: package org.apache.batik.svggen does not exist
import org.apache.batik.svggen.SVGGraphics2D;
                              ^
generator.java:9: error: package org.apache.batik.dom does not exist
import org.apache.batik.dom.GenericDOMImplementation
                           ^
[...]
6 errors

Did not investigate the other CVEs.

Updated the packages without issues.  Unless any java experts want to have a go we should give this the OK.
Comment 9 Len Lawrence 2024-03-15 16:11:28 CET
Tried the jar file in /usr/share/java, after updating.
 java -jar /usr/share/java/batik-all.jar
WARNING: A terminally deprecated method in java.lang.System has been called
WARNING: System::setSecurityManager has been called by org.apache.batik.util.ApplicationSecurityEnforcer (file:/usr/share/java/batik-all.jar)
....

This displayed a Squiggle information panel, which may be all that it is designed to do.
The batik directory in that tree contains many jar files which look like utilities but as before, they cannot be run on their own, they need a main framework or something.
Comment 10 katnatek 2024-03-16 04:56:58 CET
VM mageia 9 x86_64
install current versions, update to testing versions and remove packages

LC_ALL=C urpmi batik batik-css batik-demo batik-javadoc batik-rasterizer batik-slideshow batik-squiggle batik-svgpp batik-ttf2svg batik-util
To satisfy dependencies, the following packages are going to be installed:
  Package                        Version      Release       Arch    
(medium "Core Release")
  apache-commons-io              2.11.0       3.mga9        noarch  
  apache-commons-logging         1.2          18.mga9       noarch  
  batik                          1.14         4.mga9        noarch  
  batik-css                      1.14         4.mga9        noarch  
  batik-demo                     1.14         4.mga9        noarch  
  batik-javadoc                  1.14         4.mga9        noarch  
  batik-rasterizer               1.14         4.mga9        noarch  
  batik-slideshow                1.14         4.mga9        noarch  
  batik-squiggle                 1.14         4.mga9        noarch  
  batik-svgpp                    1.14         4.mga9        noarch  
  batik-ttf2svg                  1.14         4.mga9        noarch  
  batik-util                     1.14         4.mga9        noarch  
  javapackages-tools             6.1.0        2.mga9        noarch  
  x11-font-type1                 1.0.0        17.mga9       noarch  
  x11-font-xfree86-type1         1.0.4        10.mga9       noarch  
  xalan-j2                       2.7.2        13.mga9       noarch  
  xerces-j2                      2.12.2       1.mga9        noarch  
  xml-commons-apis               1.4.01       39.mga9       noarch  
  xml-commons-resolver           1.2          38.mga9       noarch  
  xmlgraphics-commons            2.7          1.mga9        noarch  
(medium "Core Updates")
  java-17-openjdk                17.0.10.0.7  1.mga9        x86_64  
145MB of additional disk space will be used.
14MB of packages will be retrieved.
Proceed with the installation of the 21 packages? (Y/n) y


    https://mirrors.kernel.org/mageia/distrib/9/x86_64/media/core/release/apache-commons-logging-1.2-18.mga9.noarch.rpm
    https://mirrors.kernel.org/mageia/distrib/9/x86_64/media/core/release/xalan-j2-2.7.2-13.mga9.noarch.rpm                  
    https://mirrors.kernel.org/mageia/distrib/9/x86_64/media/core/release/javapackages-tools-6.1.0-2.mga9.noarch.rpm         
    https://mirrors.kernel.org/mageia/distrib/9/x86_64/media/core/release/batik-util-1.14-4.mga9.noarch.rpm                  
    https://mirrors.kernel.org/mageia/distrib/9/x86_64/media/core/release/batik-demo-1.14-4.mga9.noarch.rpm                  
    https://mirrors.kernel.org/mageia/distrib/9/x86_64/media/core/release/x11-font-xfree86-type1-1.0.4-10.mga9.noarch.rpm    
    https://mirrors.kernel.org/mageia/distrib/9/x86_64/media/core/release/batik-css-1.14-4.mga9.noarch.rpm                   
    https://mirrors.kernel.org/mageia/distrib/9/x86_64/media/core/release/batik-rasterizer-1.14-4.mga9.noarch.rpm            
    https://mirrors.kernel.org/mageia/distrib/9/x86_64/media/core/release/batik-1.14-4.mga9.noarch.rpm                       
    https://mirrors.kernel.org/mageia/distrib/9/x86_64/media/core/release/batik-ttf2svg-1.14-4.mga9.noarch.rpm               
    https://mirrors.kernel.org/mageia/distrib/9/x86_64/media/core/release/xml-commons-apis-1.4.01-39.mga9.noarch.rpm         
    https://mirrors.kernel.org/mageia/distrib/9/x86_64/media/core/release/xerces-j2-2.12.2-1.mga9.noarch.rpm                 
    https://mirrors.kernel.org/mageia/distrib/9/x86_64/media/core/release/xmlgraphics-commons-2.7-1.mga9.noarch.rpm          
    https://mirrors.kernel.org/mageia/distrib/9/x86_64/media/core/release/x11-font-type1-1.0.0-17.mga9.noarch.rpm            
    https://mirrors.kernel.org/mageia/distrib/9/x86_64/media/core/release/batik-svgpp-1.14-4.mga9.noarch.rpm                 
    https://mirrors.kernel.org/mageia/distrib/9/x86_64/media/core/release/batik-javadoc-1.14-4.mga9.noarch.rpm               
    https://mirrors.kernel.org/mageia/distrib/9/x86_64/media/core/release/batik-squiggle-1.14-4.mga9.noarch.rpm              
    https://mirrors.kernel.org/mageia/distrib/9/x86_64/media/core/release/xml-commons-resolver-1.2-38.mga9.noarch.rpm        
    https://mirrors.kernel.org/mageia/distrib/9/x86_64/media/core/release/apache-commons-io-2.11.0-3.mga9.noarch.rpm         
    https://mirrors.kernel.org/mageia/distrib/9/x86_64/media/core/release/batik-slideshow-1.14-4.mga9.noarch.rpm             
    https://mirrors.kernel.org/mageia/distrib/9/x86_64/media/core/updates/java-17-openjdk-17.0.10.0.7-1.mga9.x86_64.rpm      
installing batik-css-1.14-4.mga9.noarch.rpm x11-font-xfree86-type1-1.0.4-10.mga9.noarch.rpm batik-rasterizer-1.14-4.mga9.noarch.rpm batik-ttf2svg-1.14-4.mga9.noarch.rpm batik-1.14-4.mga9.noarch.rpm xalan-j2-2.7.2-13.mga9.noarch.rpm apache-commons-logging-1.2-18.mga9.noarch.rpm batik-util-1.14-4.mga9.noarch.rpm javapackages-tools-6.1.0-2.mga9.noarch.rpm batik-demo-1.14-4.mga9.noarch.rpm java-17-openjdk-17.0.10.0.7-1.mga9.x86_64.rpm xml-commons-resolver-1.2-38.mga9.noarch.rpm apache-commons-io-2.11.0-3.mga9.noarch.rpm batik-slideshow-1.14-4.mga9.noarch.rpm xmlgraphics-commons-2.7-1.mga9.noarch.rpm x11-font-type1-1.0.0-17.mga9.noarch.rpm xerces-j2-2.12.2-1.mga9.noarch.rpm xml-commons-apis-1.4.01-39.mga9.noarch.rpm batik-svgpp-1.14-4.mga9.noarch.rpm batik-squiggle-1.14-4.mga9.noarch.rpm batik-javadoc-1.14-4.mga9.noarch.rpm from /var/cache/urpmi/rpms
Preparing...                     ###########################################################################################
     1/21: javapackages-tools    ###########################################################################################
     2/21: batik-util            ###########################################################################################
     3/21: xml-commons-apis      ###########################################################################################
     4/21: xml-commons-resolver  ###########################################################################################
     5/21: xerces-j2             ###########################################################################################
     6/21: xalan-j2              ###########################################################################################
     7/21: apache-commons-io     ###########################################################################################
     8/21: apache-commons-logging
                                 ###########################################################################################
     9/21: xmlgraphics-commons   ###########################################################################################
    10/21: batik-css             ###########################################################################################
    11/21: batik                 ###########################################################################################
    12/21: x11-font-xfree86-type1
                                 ###########################################################################################
    13/21: x11-font-type1        ###########################################################################################
    14/21: java-17-openjdk       ###########################################################################################
    15/21: batik-slideshow       ###########################################################################################
    16/21: batik-squiggle        ###########################################################################################
    17/21: batik-rasterizer      ###########################################################################################
    18/21: batik-ttf2svg         ###########################################################################################
    19/21: batik-demo            ###########################################################################################
    20/21: batik-svgpp           ###########################################################################################
    21/21: batik-javadoc         ###########################################################################################

LC_ALL=C urpmi --auto --auto-update
medium "QA Testing (64-bit)" is up-to-date
medium "Core Release" is up-to-date
medium "Core Updates" is up-to-date
medium "Nonfree Release" is up-to-date
medium "Nonfree Updates" is up-to-date
medium "Tainted Release" is up-to-date
medium "Tainted Updates" is up-to-date


installing batik-util-1.14-4.1.mga9.noarch.rpm batik-squiggle-1.14-4.1.mga9.noarch.rpm batik-demo-1.14-4.1.mga9.noarch.rpm batik-svgpp-1.14-4.1.mga9.noarch.rpm batik-css-1.14-4.1.mga9.noarch.rpm batik-rasterizer-1.14-4.1.mga9.noarch.rpm batik-slideshow-1.14-4.1.mga9.noarch.rpm batik-ttf2svg-1.14-4.1.mga9.noarch.rpm batik-1.14-4.1.mga9.noarch.rpm batik-javadoc-1.14-4.1.mga9.noarch.rpm from //home/qateam/qa-testing/x86_64
Preparing...                     ###########################################################################################
     1/10: batik-util            ###########################################################################################
     2/10: batik-css             ###########################################################################################
     3/10: batik                 ###########################################################################################
     4/10: batik-squiggle        ###########################################################################################
     5/10: batik-demo            ###########################################################################################
     6/10: batik-svgpp           ###########################################################################################
     7/10: batik-rasterizer      ###########################################################################################
     8/10: batik-slideshow       ###########################################################################################
     9/10: batik-ttf2svg         ###########################################################################################
    10/10: batik-javadoc         ###########################################################################################
     1/10: removing batik-slideshow-1:1.14-4.mga9.noarch
                                 ###########################################################################################
     2/10: removing batik-rasterizer-1:1.14-4.mga9.noarch
                                 ###########################################################################################
     3/10: removing batik-svgpp-1:1.14-4.mga9.noarch
                                 ###########################################################################################
     4/10: removing batik-squiggle-1:1.14-4.mga9.noarch
                                 ###########################################################################################
     5/10: removing batik-ttf2svg-1:1.14-4.mga9.noarch
                                 ###########################################################################################
     6/10: removing batik-demo-1:1.14-4.mga9.noarch
                                 ###########################################################################################
     7/10: removing batik-1:1.14-4.mga9.noarch
                                 ###########################################################################################
     8/10: removing batik-css-1:1.14-4.mga9.noarch
                                 ###########################################################################################
     9/10: removing batik-util-1:1.14-4.mga9.noarch
                                 ###########################################################################################
    10/10: removing batik-javadoc-1:1.14-4.mga9.noarch
                                 ###########################################################################################
writing /var/lib/rpm/installed-through-deps.list

LC_ALL=C urpme $(rpm -qa|grep batik)
removing batik-1.14-4.1.mga9.noarch batik-css-1.14-4.1.mga9.noarch batik-demo-1.14-4.1.mga9.noarch batik-javadoc-1.14-4.1.mga9.noarch batik-rasterizer-1.14-4.1.mga9.noarch batik-slideshow-1.14-4.1.mga9.noarch batik-squiggle-1.14-4.1.mga9.noarch batik-svgpp-1.14-4.1.mga9.noarch batik-ttf2svg-1.14-4.1.mga9.noarch batik-util-1.14-4.1.mga9.noarch
removing package batik-rasterizer-1:1.14-4.1.mga9.noarch
     1/10: removing batik-rasterizer-1:1.14-4.1.mga9.noarch
                                 ###########################################################################################
removing package batik-svgpp-1:1.14-4.1.mga9.noarch
     2/10: removing batik-svgpp-1:1.14-4.1.mga9.noarch
                                 ###########################################################################################
removing package batik-squiggle-1:1.14-4.1.mga9.noarch
     3/10: removing batik-squiggle-1:1.14-4.1.mga9.noarch
                                 ###########################################################################################
removing package batik-slideshow-1:1.14-4.1.mga9.noarch
     4/10: removing batik-slideshow-1:1.14-4.1.mga9.noarch
                                 ###########################################################################################
removing package batik-ttf2svg-1:1.14-4.1.mga9.noarch
     5/10: removing batik-ttf2svg-1:1.14-4.1.mga9.noarch
                                 ###########################################################################################
removing package batik-demo-1:1.14-4.1.mga9.noarch
     6/10: removing batik-demo-1:1.14-4.1.mga9.noarch
                                 ###########################################################################################
removing package batik-1:1.14-4.1.mga9.noarch
     7/10: removing batik-1:1.14-4.1.mga9.noarch
                                 ###########################################################################################
removing package batik-css-1:1.14-4.1.mga9.noarch
     8/10: removing batik-css-1:1.14-4.1.mga9.noarch
                                 ###########################################################################################
removing package batik-util-1:1.14-4.1.mga9.noarch
     9/10: removing batik-util-1:1.14-4.1.mga9.noarch
                                 ###########################################################################################
removing package batik-javadoc-1:1.14-4.1.mga9.noarch
    10/10: removing batik-javadoc-1:1.14-4.1.mga9.noarch
                                 ###########################################################################################

The following packages:
  apache-commons-io-2.11.0-3.mga9.noarch
  apache-commons-logging-1.2-18.mga9.noarch
  java-17-openjdk-17.0.10.0.7-1.mga9.x86_64
  javapackages-tools-6.1.0-2.mga9.noarch
  x11-font-type1-1.0.0-17.mga9.noarch
  x11-font-xfree86-type1-1.0.4-10.mga9.noarch
  xalan-j2-2.7.2-13.mga9.noarch
  xerces-j2-2.12.2-1.mga9.noarch
  xml-commons-apis-1.4.01-39.mga9.noarch
  xml-commons-resolver-1.2-38.mga9.noarch
  xmlgraphics-commons-2.7-1.mga9.noarch
are now orphaned, if you wish to remove them, you can use "urpme --auto-orphans"

LC_ALL=C urpme --auto-orphans --auto
removing apache-commons-io-2.11.0-3.mga9.noarch apache-commons-logging-1.2-18.mga9.noarch java-17-openjdk-17.0.10.0.7-1.mga9.x86_64 javapackages-tools-6.1.0-2.mga9.noarch x11-font-type1-1.0.0-17.mga9.noarch x11-font-xfree86-type1-1.0.4-10.mga9.noarch xalan-j2-2.7.2-13.mga9.noarch xerces-j2-2.12.2-1.mga9.noarch xml-commons-apis-1.4.01-39.mga9.noarch xml-commons-resolver-1.2-38.mga9.noarch xmlgraphics-commons-2.7-1.mga9.noarch
removing package xalan-j2-2.7.2-13.mga9.noarch
     1/11: removing xalan-j2-2.7.2-13.mga9.noarch
                                 ###########################################################################################
removing package xerces-j2-2.12.2-1.mga9.noarch
     2/11: removing xerces-j2-2.12.2-1.mga9.noarch
                                 ###########################################################################################
removing package xmlgraphics-commons-0:2.7-1.mga9.noarch
     3/11: removing xmlgraphics-commons-0:2.7-1.mga9.noarch
                                 ###########################################################################################
removing package xml-commons-resolver-0:1.2-38.mga9.noarch
     4/11: removing xml-commons-resolver-0:1.2-38.mga9.noarch
                                 ###########################################################################################
removing package java-17-openjdk-1:17.0.10.0.7-1.mga9.x86_64
     5/11: removing java-17-openjdk-1:17.0.10.0.7-1.mga9.x86_64
                                 ###########################################################################################
removing package x11-font-type1-1.0.0-17.mga9.noarch
     6/11: removing x11-font-type1-1.0.0-17.mga9.noarch
                                 ###########################################################################################
removing package x11-font-xfree86-type1-1.0.4-10.mga9.noarch
     7/11: removing x11-font-xfree86-type1-1.0.4-10.mga9.noarch
                                 ###########################################################################################
removing package javapackages-tools-6.1.0-2.mga9.noarch
     8/11: removing javapackages-tools-6.1.0-2.mga9.noarch
                                 ###########################################################################################
removing package apache-commons-io-1:2.11.0-3.mga9.noarch
     9/11: removing apache-commons-io-1:2.11.0-3.mga9.noarch
                                 ###########################################################################################
removing package apache-commons-logging-1.2-18.mga9.noarch
    10/11: removing apache-commons-logging-1.2-18.mga9.noarch
                                 ###########################################################################################
removing package xml-commons-apis-1.4.01-39.mga9.noarch
    11/11: removing xml-commons-apis-1.4.01-39.mga9.noarch
                                 ###########################################################################################
katnatek 2024-03-16 04:57:53 CET

CC: (none) => andrewsfarm

Comment 11 katnatek 2024-03-16 04:59:14 CET
Previous round https://bugs.mageia.org/show_bug.cgi?id=28439 was validated on base of clean install

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

Comment 12 katnatek 2024-03-16 04:59:46 CET
Let this to you Thomas
Comment 13 Thomas Andrews 2024-03-16 14:27:30 CET
Yes, Len gave it a good try in the last bug, too.

Validating.

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

Comment 14 Mageia Robot 2024-03-16 17:29:19 CET
An update for this issue has been pushed to the Mageia Updates repository.

https://advisories.mageia.org/MGASA-2024-0068.html

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


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