cn.hutool:hutool-core@4.0.8 vulnerabilities

Direct Vulnerabilities

Known vulnerabilities in the cn.hutool:hutool-core package. This does not include vulnerabilities belonging to this package’s dependencies.

Automatically find and fix vulnerabilities affecting your projects. Snyk scans for vulnerabilities and provides fixes for free.
Fix for free
Vulnerability Vulnerable Version
  • H
Resource Exhaustion

Affected versions of this package are vulnerable to Resource Exhaustion via the StrSplitter.splitByRegex function. An attacker can cause a system to become unresponsive by manipulating the first two parameters.

Note:

If the first two parameters are "", no matter how the last two parameters are set, the executing program will enter an infinite loop.

How to fix Resource Exhaustion?

Upgrade cn.hutool:hutool-core to version 5.8.24 or higher.

[,5.8.24)
  • H
Arbitrary Code Execution

Affected versions of this package are vulnerable to Arbitrary Code Execution via the XMLDecoder.readObject function when using XmlUtil.readObjectFromXml to interpret untrusted XML strings.

How to fix Arbitrary Code Execution?

Upgrade cn.hutool:hutool-core to version 5.8.12 or higher.

[,5.8.12)
  • H
Buffer Overflow

Affected versions of this package are vulnerable to Buffer Overflow via the JSONUtil.parse() function. An attacker can cause a heap buffer overflow by sending a specially crafted JSON string. This can lead to unexpected behavior or application crashes.

How to fix Buffer Overflow?

Upgrade cn.hutool:hutool-core to version 5.8.22 or higher.

[0,5.8.22)
  • H
Buffer Overflow

Affected versions of this package are vulnerable to Buffer Overflow in the jsonArray.add() function. An attacker can cause a crash by sending a specially crafted JSON object to trigger an OutOfMemoryError.

How to fix Buffer Overflow?

Upgrade cn.hutool:hutool-core to version 5.8.22 or higher.

[0,5.8.22)
  • M
XML External Entity (XXE) Injection

Affected versions of this package are vulnerable to XML External Entity (XXE) Injection via the readBySax function in XmlUtil.java of the component XML Parsing Module, which uses the SAXParserFactory.

How to fix XML External Entity (XXE) Injection?

Upgrade cn.hutool:hutool-core to version 5.8.20 or higher.

[,5.8.20)
  • H
Creation of Temporary File With Insecure Permissions

Affected versions of this package are vulnerable to Creation of Temporary File With Insecure Permissions in its use of the File.createTempFile() function in FileUtil.java, which does not sufficiently restrict permissions.

How to fix Creation of Temporary File With Insecure Permissions?

Upgrade cn.hutool:hutool-core to version 5.8.19 or higher.

[,5.8.19)
  • H
Denial of Service (DoS)

Affected versions of this package are vulnerable to Denial of Service (DoS) in cn.hutool.core.util.ZipUtil.java which can lead to resource consumption.

How to fix Denial of Service (DoS)?

Upgrade cn.hutool:hutool-core to version 5.8.11 or higher.

[0,5.8.11)
  • H
Arbitrary File Write via Archive Extraction (Zip Slip)

cn.hutool:hutool-core is a set of tools for java.

Affected versions of the package are vulnerable to Arbitrary File Write via Archive Extraction (AKA "Zip Slip").

It is exploited using a specially crafted zip archive, that holds path traversal filenames. When exploited, a filename in a malicious archive is concatenated to the target extraction directory, which results in the final path ending up outside of the target folder. For instance, a zip may hold a file with a "../../file.exe" location and thus break out of the target folder. If an executable or a configuration file is overwritten with a file containing malicious code, the problem can turn into an arbitrary code execution issue quite easily.

The following is an example of a zip archive with one benign file and one malicious file. Extracting the malicous file will result in traversing out of the target folder, ending up in /root/.ssh/ overwriting the authorized_keys file:


+2018-04-15 22:04:29 ..... 19 19 good.txt

+2018-04-15 22:04:42 ..... 20 20 ../../../../../../root/.ssh/authorized_keys

How to fix Arbitrary File Write via Archive Extraction (Zip Slip)?

Upgrade cn.hutool:hutool-core to version 4.1.12 or higher.

[,4.1.12)