Vulnerabilities

12 via 60 paths

Dependencies

40

Source

GitHub

Commit

8a02ea8a

Find, fix and prevent vulnerabilities in your code.

Issue type
  • 12
  • 4
Severity
  • 1
  • 11
  • 4
Status
  • 16
  • 0
  • 0

high severity

Uncontrolled Recursion

  • Vulnerable module: org.apache.commons:commons-lang3
  • Introduced through: com.github.shyiko:ktlint@0.31.0

Detailed paths

  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-model@3.3.9 org.apache.commons:commons-lang3@3.4
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-model-builder@3.3.9 org.apache.commons:commons-lang3@3.4
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-aether-provider@3.3.9 org.apache.commons:commons-lang3@3.4
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-model-builder@3.3.9 org.apache.maven:maven-model@3.3.9 org.apache.commons:commons-lang3@3.4
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-aether-provider@3.3.9 org.apache.maven:maven-model@3.3.9 org.apache.commons:commons-lang3@3.4
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-model-builder@3.3.9 org.apache.maven:maven-artifact@3.3.9 org.apache.commons:commons-lang3@3.4
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-model-builder@3.3.9 org.apache.maven:maven-builder-support@3.3.9 org.apache.commons:commons-lang3@3.4
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-aether-provider@3.3.9 org.apache.maven:maven-model-builder@3.3.9 org.apache.commons:commons-lang3@3.4
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-aether-provider@3.3.9 org.apache.maven:maven-model-builder@3.3.9 org.apache.maven:maven-model@3.3.9 org.apache.commons:commons-lang3@3.4
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-aether-provider@3.3.9 org.apache.maven:maven-model-builder@3.3.9 org.apache.maven:maven-artifact@3.3.9 org.apache.commons:commons-lang3@3.4
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-aether-provider@3.3.9 org.apache.maven:maven-model-builder@3.3.9 org.apache.maven:maven-builder-support@3.3.9 org.apache.commons:commons-lang3@3.4

Overview

Affected versions of this package are vulnerable to Uncontrolled Recursion via the ClassUtils.getClass function. An attacker can cause the application to terminate unexpectedly by providing excessively long input values.

Remediation

Upgrade org.apache.commons:commons-lang3 to version 3.18.0 or higher.

References

medium severity

Deserialization of Untrusted Data

  • Vulnerable module: com.google.guava:guava
  • Introduced through: com.github.shyiko:ktlint@0.31.0

Detailed paths

  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 com.google.guava:guava@18.0
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-model-builder@3.3.9 com.google.guava:guava@18.0
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-aether-provider@3.3.9 org.apache.maven:maven-model-builder@3.3.9 com.google.guava:guava@18.0

Overview

com.google.guava:guava is a set of core libraries that includes new collection types (such as multimap and multiset,immutable collections, a graph library, functional types, an in-memory cache and more.

Affected versions of this package are vulnerable to Deserialization of Untrusted Data. During deserialization, two Guava classes accept a caller-specified size parameter and eagerly allocate an array of that size:

  • AtomicDoubleArray (when serialized with Java serialization)
  • CompoundOrdering (when serialized with GWT serialization)

An attacker may be able to send a specially crafted request which with then cause the server to allocate all it's memory, without validation whether the data size is reasonable.

Details

Serialization is a process of converting an object into a sequence of bytes which can be persisted to a disk or database or can be sent through streams. The reverse process of creating object from sequence of bytes is called deserialization. Serialization is commonly used for communication (sharing objects between multiple hosts) and persistence (store the object state in a file or a database). It is an integral part of popular protocols like Remote Method Invocation (RMI), Java Management Extension (JMX), Java Messaging System (JMS), Action Message Format (AMF), Java Server Faces (JSF) ViewState, etc.

Deserialization of untrusted data (CWE-502), is when the application deserializes untrusted data without sufficiently verifying that the resulting data will be valid, letting the attacker to control the state or the flow of the execution.

Java deserialization issues have been known for years. However, interest in the issue intensified greatly in 2015, when classes that could be abused to achieve remote code execution were found in a popular library (Apache Commons Collection). These classes were used in zero-days affecting IBM WebSphere, Oracle WebLogic and many other products.

An attacker just needs to identify a piece of software that has both a vulnerable class on its path, and performs deserialization on untrusted data. Then all they need to do is send the payload into the deserializer, getting the command executed.

Developers put too much trust in Java Object Serialization. Some even de-serialize objects pre-authentication. When deserializing an Object in Java you typically cast it to an expected type, and therefore Java's strict type system will ensure you only get valid object trees. Unfortunately, by the time the type checking happens, platform code has already created and executed significant logic. So, before the final type is checked a lot of code is executed from the readObject() methods of various objects, all of which is out of the developer's control. By combining the readObject() methods of various classes which are available on the classpath of the vulnerable application, an attacker can execute functions (including calling Runtime.exec() to execute local OS commands).

Remediation

Upgrade com.google.guava:guava to version 24.1.1, 24.1.1-jre or higher.

References

medium severity

Directory Traversal

  • Vulnerable module: org.apache.httpcomponents:httpclient
  • Introduced through: com.github.shyiko:ktlint@0.31.0

Detailed paths

  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.eclipse.aether:aether-transport-http@1.1.0 org.apache.httpcomponents:httpclient@4.3.5

Overview

org.apache.httpcomponents:httpclient is a HttpClient component of the Apache HttpComponents project.

Affected versions of this package are vulnerable to Directory Traversal. String input by user is not validated for the presence of leading character / and is passed to the constructor as path information, resulting in a Directory Traversal vulnerability.

Details

A Directory Traversal attack (also known as path traversal) aims to access files and directories that are stored outside the intended folder. By manipulating files with "dot-dot-slash (../)" sequences and its variations, or by using absolute file paths, it may be possible to access arbitrary files and directories stored on file system, including application source code, configuration, and other critical system files.

Directory Traversal vulnerabilities can be generally divided into two types:

  • Information Disclosure: Allows the attacker to gain information about the folder structure or read the contents of sensitive files on the system.

st is a module for serving static files on web pages, and contains a vulnerability of this type. In our example, we will serve files from the public route.

If an attacker requests the following URL from our server, it will in turn leak the sensitive private key of the root user.

curl http://localhost:8080/public/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/root/.ssh/id_rsa

Note %2e is the URL encoded version of . (dot).

  • Writing arbitrary files: Allows the attacker to create or replace existing files. This type of vulnerability is also known as Zip-Slip.

One way to achieve this is by using a malicious zip archive that holds path traversal filenames. When each filename in the zip archive gets concatenated to the target extraction folder, without validation, the final path ends up outside 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 malicious 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

Remediation

Upgrade org.apache.httpcomponents:httpclient to version 4.5.3 or higher.

References

medium severity

Improper Input Validation

  • Vulnerable module: org.apache.httpcomponents:httpclient
  • Introduced through: com.github.shyiko:ktlint@0.31.0

Detailed paths

  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.eclipse.aether:aether-transport-http@1.1.0 org.apache.httpcomponents:httpclient@4.3.5

Overview

org.apache.httpcomponents:httpclient is a HttpClient component of the Apache HttpComponents project.

Affected versions of this package are vulnerable to Improper Input Validation. Apache HttpClient can misinterpret malformed authority component in request URIs passed to the library as java.net.URI object and pick the wrong target host for request execution.

Remediation

Upgrade org.apache.httpcomponents:httpclient to version 4.5.13 or higher.

References

medium severity

Directory Traversal

  • Vulnerable module: org.codehaus.plexus:plexus-utils
  • Introduced through: com.github.shyiko:ktlint@0.31.0

Detailed paths

  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-model@3.3.9 org.codehaus.plexus:plexus-utils@3.0.22
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-model-builder@3.3.9 org.codehaus.plexus:plexus-utils@3.0.22
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-repository-metadata@3.3.9 org.codehaus.plexus:plexus-utils@3.0.22
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-aether-provider@3.3.9 org.codehaus.plexus:plexus-utils@3.0.22
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-model-builder@3.3.9 org.apache.maven:maven-model@3.3.9 org.codehaus.plexus:plexus-utils@3.0.22
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-aether-provider@3.3.9 org.apache.maven:maven-model@3.3.9 org.codehaus.plexus:plexus-utils@3.0.22
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-model-builder@3.3.9 org.apache.maven:maven-artifact@3.3.9 org.codehaus.plexus:plexus-utils@3.0.22
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-model-builder@3.3.9 org.apache.maven:maven-builder-support@3.3.9 org.codehaus.plexus:plexus-utils@3.0.22
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-aether-provider@3.3.9 org.apache.maven:maven-model-builder@3.3.9 org.codehaus.plexus:plexus-utils@3.0.22
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-aether-provider@3.3.9 org.apache.maven:maven-repository-metadata@3.3.9 org.codehaus.plexus:plexus-utils@3.0.22
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-aether-provider@3.3.9 org.apache.maven:maven-model-builder@3.3.9 org.apache.maven:maven-model@3.3.9 org.codehaus.plexus:plexus-utils@3.0.22
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-aether-provider@3.3.9 org.apache.maven:maven-model-builder@3.3.9 org.apache.maven:maven-artifact@3.3.9 org.codehaus.plexus:plexus-utils@3.0.22
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-aether-provider@3.3.9 org.apache.maven:maven-model-builder@3.3.9 org.apache.maven:maven-builder-support@3.3.9 org.codehaus.plexus:plexus-utils@3.0.22

Overview

An attacker could access arbitrary files and directories stored on the file system by manipulating files with dot-dot-slash (../) sequences and their variations or by using absolute file paths.

Note:

There is no indication that access to the filesystem beyond that of the application user can be achieved. So typical deployments will have only limited confidentiality impact from this vulnerability.

References

medium severity

Improper Locking

  • Vulnerable module: org.jetbrains.kotlin:kotlin-stdlib
  • Introduced through: com.github.shyiko:ktlint@0.31.0 and org.jetbrains.kotlin:kotlin-stdlib-jdk8@2.3.0

Detailed paths

  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.jetbrains.kotlin:kotlin-stdlib@1.3.21
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 org.jetbrains.kotlin:kotlin-stdlib-jdk8@2.3.0 org.jetbrains.kotlin:kotlin-stdlib@1.3.21
    Remediation: Upgrade to org.jetbrains.kotlin:kotlin-stdlib-jdk8@2.3.0.
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 org.jetbrains.kotlin:kotlin-stdlib-jdk8@2.3.0 org.jetbrains.kotlin:kotlin-stdlib-jdk7@2.3.0 org.jetbrains.kotlin:kotlin-stdlib@1.3.21
    Remediation: Upgrade to org.jetbrains.kotlin:kotlin-stdlib-jdk8@2.3.0.
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 com.github.shyiko.ktlint:ktlint-core@0.31.0 org.jetbrains.kotlin:kotlin-compiler-embeddable@1.3.21 org.jetbrains.kotlin:kotlin-stdlib@1.3.21
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 com.github.shyiko.ktlint:ktlint-core@0.31.0 org.jetbrains.kotlin:kotlin-compiler-embeddable@1.3.21 org.jetbrains.kotlin:kotlin-reflect@1.3.21 org.jetbrains.kotlin:kotlin-stdlib@1.3.21

Overview

org.jetbrains.kotlin:kotlin-stdlib is a Kotlin Standard Library for JVM.

Affected versions of this package are vulnerable to Improper Locking due to inability to lock dependencies for Multiplatform Gradle Projects.

Remediation

Upgrade org.jetbrains.kotlin:kotlin-stdlib to version 1.6.0 or higher.

References

medium severity

Denial of Service (DoS)

  • Vulnerable module: org.apache.httpcomponents:httpclient
  • Introduced through: com.github.shyiko:ktlint@0.31.0

Detailed paths

  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.eclipse.aether:aether-transport-http@1.1.0 org.apache.httpcomponents:httpclient@4.3.5

Overview

org.apache.httpcomponents:httpclient is a HttpClient component of the Apache HttpComponents project.

Affected versions of this package are vulnerable to Denial of Service (DoS) via the http/conn/ssl/SSLConnectionSocketFactory.java class. It ignores the http.socket.timeout configuration setting during an SSL handshake, which allows remote attackers to cause a denial of service (HTTPS call hang) via unspecified vectors.

Details

Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its intended and legitimate users.

Unlike other vulnerabilities, DoS attacks usually do not aim at breaching security. Rather, they are focused on making websites and services unavailable to genuine users resulting in downtime.

One popular Denial of Service vulnerability is DDoS (a Distributed Denial of Service), an attack that attempts to clog network pipes to the system by generating a large volume of traffic from many machines.

When it comes to open source libraries, DoS vulnerabilities allow attackers to trigger such a crash or crippling of the service by using a flaw either in the application code or from the use of open source libraries.

Two common types of DoS vulnerabilities:

  • High CPU/Memory Consumption- An attacker sending crafted requests that could cause the system to take a disproportionate amount of time to process. For example, commons-fileupload:commons-fileupload.

  • Crash - An attacker sending crafted requests that could cause the system to crash. For Example, npm ws package

Remediation

Upgrade org.apache.httpcomponents:httpclient to version 4.3.6 or higher.

References

medium severity

XML External Entity (XXE) Injection

  • Vulnerable module: org.codehaus.plexus:plexus-utils
  • Introduced through: com.github.shyiko:ktlint@0.31.0

Detailed paths

  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-model@3.3.9 org.codehaus.plexus:plexus-utils@3.0.22
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-model-builder@3.3.9 org.codehaus.plexus:plexus-utils@3.0.22
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-repository-metadata@3.3.9 org.codehaus.plexus:plexus-utils@3.0.22
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-aether-provider@3.3.9 org.codehaus.plexus:plexus-utils@3.0.22
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-model-builder@3.3.9 org.apache.maven:maven-model@3.3.9 org.codehaus.plexus:plexus-utils@3.0.22
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-aether-provider@3.3.9 org.apache.maven:maven-model@3.3.9 org.codehaus.plexus:plexus-utils@3.0.22
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-model-builder@3.3.9 org.apache.maven:maven-artifact@3.3.9 org.codehaus.plexus:plexus-utils@3.0.22
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-model-builder@3.3.9 org.apache.maven:maven-builder-support@3.3.9 org.codehaus.plexus:plexus-utils@3.0.22
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-aether-provider@3.3.9 org.apache.maven:maven-model-builder@3.3.9 org.codehaus.plexus:plexus-utils@3.0.22
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-aether-provider@3.3.9 org.apache.maven:maven-repository-metadata@3.3.9 org.codehaus.plexus:plexus-utils@3.0.22
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-aether-provider@3.3.9 org.apache.maven:maven-model-builder@3.3.9 org.apache.maven:maven-model@3.3.9 org.codehaus.plexus:plexus-utils@3.0.22
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-aether-provider@3.3.9 org.apache.maven:maven-model-builder@3.3.9 org.apache.maven:maven-artifact@3.3.9 org.codehaus.plexus:plexus-utils@3.0.22
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-aether-provider@3.3.9 org.apache.maven:maven-model-builder@3.3.9 org.apache.maven:maven-builder-support@3.3.9 org.codehaus.plexus:plexus-utils@3.0.22

Overview

org.codehaus.plexus:plexus-utils is a collection of various utility classes to ease working with strings, files, command lines, XML and more.

Affected versions of this package are vulnerable to XML External Entity (XXE) Injection. org.codehaus.plexus.util.xml.XmlWriterUtil#writeComment fails to sanitize comments for a --> sequence. This means that text contained in the command string could be interpreted as XML and allow for XML injection.

Remediation

Upgrade org.codehaus.plexus:plexus-utils to version 3.0.24 or higher.

References

medium severity

EPL-1.0 license

  • Module: org.eclipse.aether:aether-connector-basic
  • Introduced through: com.github.shyiko:ktlint@0.31.0

Detailed paths

  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.eclipse.aether:aether-connector-basic@1.1.0

EPL-1.0 license

medium severity

EPL-1.0 license

  • Module: org.eclipse.aether:aether-transport-file
  • Introduced through: com.github.shyiko:ktlint@0.31.0

Detailed paths

  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.eclipse.aether:aether-transport-file@1.1.0

EPL-1.0 license

medium severity

EPL-1.0 license

  • Module: org.eclipse.aether:aether-transport-http
  • Introduced through: com.github.shyiko:ktlint@0.31.0

Detailed paths

  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.eclipse.aether:aether-transport-http@1.1.0

EPL-1.0 license

medium severity

LGPL-2.1 license

  • Module: org.jetbrains.intellij.deps:trove4j
  • Introduced through: com.github.shyiko:ktlint@0.31.0

Detailed paths

  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 com.github.shyiko.ktlint:ktlint-core@0.31.0 org.jetbrains.kotlin:kotlin-compiler-embeddable@1.3.21 org.jetbrains.intellij.deps:trove4j@1.0.20181211

LGPL-2.1 license

low severity

Information Exposure

  • Vulnerable module: commons-codec:commons-codec
  • Introduced through: com.github.shyiko:ktlint@0.31.0

Detailed paths

  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.eclipse.aether:aether-transport-http@1.1.0 org.apache.httpcomponents:httpclient@4.3.5 commons-codec:commons-codec@1.6

Overview

commons-codec:commons-codec is a package that contains simple encoder and decoders for various formats such as Base64 and Hexadecimal.

Affected versions of this package are vulnerable to Information Exposure. When there is no byte array value that can be encoded into a string the Base32 implementation does not reject it, and instead decodes it into an arbitrary value which can be re-encoded again using the same implementation. This allows for information exposure exploits such as tunneling additional information via seemingly valid base 32 strings.

Remediation

Upgrade commons-codec:commons-codec to version 1.14 or higher.

References

low severity

Creation of Temporary File in Directory with Insecure Permissions

  • Vulnerable module: com.google.guava:guava
  • Introduced through: com.github.shyiko:ktlint@0.31.0

Detailed paths

  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 com.google.guava:guava@18.0
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-model-builder@3.3.9 com.google.guava:guava@18.0
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-aether-provider@3.3.9 org.apache.maven:maven-model-builder@3.3.9 com.google.guava:guava@18.0

Overview

com.google.guava:guava is a set of core libraries that includes new collection types (such as multimap and multiset,immutable collections, a graph library, functional types, an in-memory cache and more.

Affected versions of this package are vulnerable to Creation of Temporary File in Directory with Insecure Permissions due to the use of Java's default temporary directory for file creation in FileBackedOutputStream. Other users and apps on the machine with access to the default Java temporary directory can access the files created by this class. This more fully addresses the underlying issue described in CVE-2020-8908, by deprecating the permissive temp file creation behavior.

NOTE: Even though the security vulnerability is fixed in version 32.0.0, the maintainers recommend using version 32.0.1, as version 32.0.0 breaks some functionality under Windows.

Remediation

Upgrade com.google.guava:guava to version 32.0.0-android, 32.0.0-jre or higher.

References

low severity

Information Disclosure

  • Vulnerable module: com.google.guava:guava
  • Introduced through: com.github.shyiko:ktlint@0.31.0

Detailed paths

  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 com.google.guava:guava@18.0
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-model-builder@3.3.9 com.google.guava:guava@18.0
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.apache.maven:maven-aether-provider@3.3.9 org.apache.maven:maven-model-builder@3.3.9 com.google.guava:guava@18.0

Overview

com.google.guava:guava is a set of core libraries that includes new collection types (such as multimap and multiset,immutable collections, a graph library, functional types, an in-memory cache and more.

Affected versions of this package are vulnerable to Information Disclosure. The file permissions on the file created by com.google.common.io.Files.createTempDir allow an attacker running a malicious program co-resident on the same machine to steal secrets stored in this directory. This is because, by default, on unix-like operating systems the /tmp directory is shared between all users, so if the correct file permissions aren't set by the directory/file creator, the file becomes readable by all other users on that system.

PoC

File guavaTempDir = com.google.common.io.Files.createTempDir();
System.out.println("Guava Temp Dir: " + guavaTempDir.getName());
runLS(guavaTempDir.getParentFile(), guavaTempDir); // Prints the file permissions -> drwxr-xr-x
File child = new File(guavaTempDir, "guava-child.txt");
child.createNewFile();
runLS(guavaTempDir, child); // Prints the file permissions -> -rw-r--r--

For Android developers, choosing a temporary directory API provided by Android is recommended, such as context.getCacheDir(). For other Java developers, we recommend migrating to the Java 7 API java.nio.file.Files.createTempDirectory() which explicitly configures permissions of 700, or configuring the Java runtime's java.io.tmpdir system property to point to a location whose permissions are appropriately configured.

Remediation

There is no fix for com.google.guava:guava. However, in version 30.0 and above, the vulnerable functionality has been deprecated. In oder to mitigate this vulnerability, upgrade to version 30.0 or higher and ensure your dependencies don't use the createTempDir or createTempFile methods.

References

low severity

Information Exposure

  • Vulnerable module: org.jetbrains.kotlin:kotlin-stdlib
  • Introduced through: com.github.shyiko:ktlint@0.31.0 and org.jetbrains.kotlin:kotlin-stdlib-jdk8@2.3.0

Detailed paths

  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 org.jetbrains.kotlin:kotlin-stdlib@1.3.21
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 org.jetbrains.kotlin:kotlin-stdlib-jdk8@2.3.0 org.jetbrains.kotlin:kotlin-stdlib@1.3.21
    Remediation: Upgrade to org.jetbrains.kotlin:kotlin-stdlib-jdk8@2.3.0.
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 org.jetbrains.kotlin:kotlin-stdlib-jdk8@2.3.0 org.jetbrains.kotlin:kotlin-stdlib-jdk7@2.3.0 org.jetbrains.kotlin:kotlin-stdlib@1.3.21
    Remediation: Upgrade to org.jetbrains.kotlin:kotlin-stdlib-jdk8@2.3.0.
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 com.github.shyiko.ktlint:ktlint-core@0.31.0 org.jetbrains.kotlin:kotlin-compiler-embeddable@1.3.21 org.jetbrains.kotlin:kotlin-stdlib@1.3.21
  • Introduced through: masssh/leetcode@masssh/leetcode#8a02ea8a63a0e9dbf14e0e1c955bc5d8c8ee85b0 com.github.shyiko:ktlint@0.31.0 com.github.shyiko.ktlint:ktlint-core@0.31.0 org.jetbrains.kotlin:kotlin-compiler-embeddable@1.3.21 org.jetbrains.kotlin:kotlin-reflect@1.3.21 org.jetbrains.kotlin:kotlin-stdlib@1.3.21

Overview

org.jetbrains.kotlin:kotlin-stdlib is a Kotlin Standard Library for JVM.

Affected versions of this package are vulnerable to Information Exposure. A Kotlin application using createTempDir or createTempFile and placing sensitive information within either of these locations would be leaking this information in a read-only way to other users also on this system.

Note: As of version 1.4.21, the vulnerable functions have been marked as deprecated. Due to still being usable, this advisory is kept as "unfixed".

PoC by JLLeitschuh

package org.jlleitschuh.sandbox

import org.junit.jupiter.api.Test
import java.io.BufferedReader
import java.io.File
import java.io.IOException
import java.io.InputStreamReader
import java.nio.file.Files

class KotlinTempDirectoryPermissionCheck {
    @Test
    fun `kotlin check default directory permissions`() {
        val dir = createTempDir()
        runLS(dir.parentFile, dir) // Prints drwxr-xr-x
    }

    @Test
    fun `Files check default directory permissions`() {
        val dir = Files.createTempDirectory("random-directory")
        runLS(dir.toFile().parentFile, dir.toFile()) // Prints drwx------
    }

    @Test
    fun `kotlin check default file permissions`() {
        val file = createTempFile()
        runLS(file.parentFile, file) // Prints -rw-r--r--
    }

    @Test
    fun `Files check default file permissions`() {
        val file = Files.createTempFile("random-file", ".txt")
        runLS(file.toFile().parentFile, file.toFile()) // Prints -rw-------
    }

    private fun runLS(file: File, lookingFor: File) {
        val processBuilder = ProcessBuilder()
        processBuilder.command("ls", "-l", file.absolutePath)
        try {
            val process = processBuilder.start()
            val output = StringBuilder()
            val reader = BufferedReader(
                InputStreamReader(process.inputStream)
            )
            reader.lines().forEach { line ->
                if (line.contains("total")) {
                    output.append(line).append('\n')
                }
                if (line.contains(lookingFor.name)) {
                    output.append(line).append('\n')
                }
            }
            val exitVal = process.waitFor()
            if (exitVal == 0) {
                println("Success!")
                println(output)
            } else {
                //abnormal...
            }
        } catch (e: IOException) {
            e.printStackTrace()
        } catch (e: InterruptedException) {
            e.printStackTrace()
        }
    }
}

Remediation

Upgrade org.jetbrains.kotlin:kotlin-stdlib to version 2.1.0 or higher.

References