Vulnerabilities

3 via 23 paths

Dependencies

26

Source

GitHub

Commit

917ae8c1

Find, fix and prevent vulnerabilities in your code.

Severity
  • 2
  • 1
Status
  • 3
  • 0
  • 0

medium severity

Denial of Service (DoS)

  • Vulnerable module: com.squareup.okio:okio
  • Introduced through: com.squareup.okhttp3:okhttp@4.11.0, com.squareup.okhttp3:logging-interceptor@4.11.0 and others

Detailed paths

  • Introduced through: marklogic/java-client-api@marklogic/java-client-api#917ae8c1ac8b99f3677298111bc27d89ec5fc34e com.squareup.okhttp3:okhttp@4.11.0 com.squareup.okio:okio@3.2.0
    Remediation: Upgrade to com.squareup.okhttp3:okhttp@4.12.0.
  • Introduced through: marklogic/java-client-api@marklogic/java-client-api#917ae8c1ac8b99f3677298111bc27d89ec5fc34e com.squareup.okhttp3:logging-interceptor@4.11.0 com.squareup.okhttp3:okhttp@4.11.0 com.squareup.okio:okio@3.2.0
    Remediation: Upgrade to com.squareup.okhttp3:logging-interceptor@4.12.0.
  • Introduced through: marklogic/java-client-api@marklogic/java-client-api#917ae8c1ac8b99f3677298111bc27d89ec5fc34e io.github.rburgst:okhttp-digest@2.7 com.squareup.okhttp3:okhttp@4.11.0 com.squareup.okio:okio@3.2.0

Overview

Affected versions of this package are vulnerable to Denial of Service (DoS) due to improper exception handling by the GzipSource class when parsing a malformed gzip buffer.

This vulnerability can be exploited on the Okio client when handling a crafted GZIP archive.

PoC

val gzBuf: Buffer = Buffer()
    try {
        val gzByteString: ByteString = ("1f8b41ff424242424343ffff").decodeHex()
        gzBuf.write(gzByteString)
        val gz: GzipSource = GzipSource(gzBuf)
        val sinkBuf: Buffer = Buffer()
        gz.read(sinkBuf, 5)
    }
    catch(e: IOException) {
        println("got error: " + e.toString())
    }

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 com.squareup.okio:okio to version 1.17.6, 3.4.0 or higher.

References

medium severity

Denial of Service (DoS)

  • Vulnerable module: com.squareup.okio:okio-jvm
  • Introduced through: com.squareup.okhttp3:okhttp@4.11.0, com.squareup.okhttp3:logging-interceptor@4.11.0 and others

Detailed paths

  • Introduced through: marklogic/java-client-api@marklogic/java-client-api#917ae8c1ac8b99f3677298111bc27d89ec5fc34e com.squareup.okhttp3:okhttp@4.11.0 com.squareup.okio:okio@3.2.0 com.squareup.okio:okio-jvm@3.2.0
    Remediation: Upgrade to com.squareup.okhttp3:okhttp@4.12.0.
  • Introduced through: marklogic/java-client-api@marklogic/java-client-api#917ae8c1ac8b99f3677298111bc27d89ec5fc34e com.squareup.okhttp3:logging-interceptor@4.11.0 com.squareup.okhttp3:okhttp@4.11.0 com.squareup.okio:okio@3.2.0 com.squareup.okio:okio-jvm@3.2.0
    Remediation: Upgrade to com.squareup.okhttp3:logging-interceptor@4.12.0.
  • Introduced through: marklogic/java-client-api@marklogic/java-client-api#917ae8c1ac8b99f3677298111bc27d89ec5fc34e io.github.rburgst:okhttp-digest@2.7 com.squareup.okhttp3:okhttp@4.11.0 com.squareup.okio:okio@3.2.0 com.squareup.okio:okio-jvm@3.2.0

Overview

Affected versions of this package are vulnerable to Denial of Service (DoS) due to improper exception handling by the GzipSource class when parsing a malformed gzip buffer.

This vulnerability can be exploited on the Okio client when handling a crafted GZIP archive.

PoC

val gzBuf: Buffer = Buffer()
    try {
        val gzByteString: ByteString = ("1f8b41ff424242424343ffff").decodeHex()
        gzBuf.write(gzByteString)
        val gz: GzipSource = GzipSource(gzBuf)
        val sinkBuf: Buffer = Buffer()
        gz.read(sinkBuf, 5)
    }
    catch(e: IOException) {
        println("got error: " + e.toString())
    }

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 com.squareup.okio:okio-jvm to version 3.4.0 or higher.

References

low severity

Information Exposure

  • Vulnerable module: org.jetbrains.kotlin:kotlin-stdlib
  • Introduced through: com.squareup.okhttp3:okhttp@4.11.0, com.squareup.okhttp3:logging-interceptor@4.11.0 and others

Detailed paths

  • Introduced through: marklogic/java-client-api@marklogic/java-client-api#917ae8c1ac8b99f3677298111bc27d89ec5fc34e com.squareup.okhttp3:okhttp@4.11.0 org.jetbrains.kotlin:kotlin-stdlib@1.6.20
  • Introduced through: marklogic/java-client-api@marklogic/java-client-api#917ae8c1ac8b99f3677298111bc27d89ec5fc34e com.squareup.okhttp3:okhttp@4.11.0 org.jetbrains.kotlin:kotlin-stdlib-jdk8@1.6.20 org.jetbrains.kotlin:kotlin-stdlib@1.6.20
  • Introduced through: marklogic/java-client-api@marklogic/java-client-api#917ae8c1ac8b99f3677298111bc27d89ec5fc34e com.squareup.okhttp3:logging-interceptor@4.11.0 org.jetbrains.kotlin:kotlin-stdlib-jdk8@1.6.20 org.jetbrains.kotlin:kotlin-stdlib@1.6.20
  • Introduced through: marklogic/java-client-api@marklogic/java-client-api#917ae8c1ac8b99f3677298111bc27d89ec5fc34e com.squareup.okhttp3:logging-interceptor@4.11.0 com.squareup.okhttp3:okhttp@4.11.0 org.jetbrains.kotlin:kotlin-stdlib@1.6.20
  • Introduced through: marklogic/java-client-api@marklogic/java-client-api#917ae8c1ac8b99f3677298111bc27d89ec5fc34e io.github.rburgst:okhttp-digest@2.7 com.squareup.okhttp3:okhttp@4.11.0 org.jetbrains.kotlin:kotlin-stdlib@1.6.20
  • Introduced through: marklogic/java-client-api@marklogic/java-client-api#917ae8c1ac8b99f3677298111bc27d89ec5fc34e com.squareup.okhttp3:okhttp@4.11.0 org.jetbrains.kotlin:kotlin-stdlib-jdk8@1.6.20 org.jetbrains.kotlin:kotlin-stdlib-jdk7@1.6.20 org.jetbrains.kotlin:kotlin-stdlib@1.6.20
  • Introduced through: marklogic/java-client-api@marklogic/java-client-api#917ae8c1ac8b99f3677298111bc27d89ec5fc34e com.squareup.okhttp3:logging-interceptor@4.11.0 org.jetbrains.kotlin:kotlin-stdlib-jdk8@1.6.20 org.jetbrains.kotlin:kotlin-stdlib-jdk7@1.6.20 org.jetbrains.kotlin:kotlin-stdlib@1.6.20
  • Introduced through: marklogic/java-client-api@marklogic/java-client-api#917ae8c1ac8b99f3677298111bc27d89ec5fc34e com.squareup.okhttp3:logging-interceptor@4.11.0 com.squareup.okhttp3:okhttp@4.11.0 org.jetbrains.kotlin:kotlin-stdlib-jdk8@1.6.20 org.jetbrains.kotlin:kotlin-stdlib@1.6.20
  • Introduced through: marklogic/java-client-api@marklogic/java-client-api#917ae8c1ac8b99f3677298111bc27d89ec5fc34e io.github.rburgst:okhttp-digest@2.7 com.squareup.okhttp3:okhttp@4.11.0 org.jetbrains.kotlin:kotlin-stdlib-jdk8@1.6.20 org.jetbrains.kotlin:kotlin-stdlib@1.6.20
  • Introduced through: marklogic/java-client-api@marklogic/java-client-api#917ae8c1ac8b99f3677298111bc27d89ec5fc34e com.squareup.okhttp3:logging-interceptor@4.11.0 com.squareup.okhttp3:okhttp@4.11.0 org.jetbrains.kotlin:kotlin-stdlib-jdk8@1.6.20 org.jetbrains.kotlin:kotlin-stdlib-jdk7@1.6.20 org.jetbrains.kotlin:kotlin-stdlib@1.6.20
  • Introduced through: marklogic/java-client-api@marklogic/java-client-api#917ae8c1ac8b99f3677298111bc27d89ec5fc34e io.github.rburgst:okhttp-digest@2.7 com.squareup.okhttp3:okhttp@4.11.0 org.jetbrains.kotlin:kotlin-stdlib-jdk8@1.6.20 org.jetbrains.kotlin:kotlin-stdlib-jdk7@1.6.20 org.jetbrains.kotlin:kotlin-stdlib@1.6.20
  • Introduced through: marklogic/java-client-api@marklogic/java-client-api#917ae8c1ac8b99f3677298111bc27d89ec5fc34e com.squareup.okhttp3:okhttp@4.11.0 com.squareup.okio:okio@3.2.0 com.squareup.okio:okio-jvm@3.2.0 org.jetbrains.kotlin:kotlin-stdlib-jdk8@1.6.20 org.jetbrains.kotlin:kotlin-stdlib@1.6.20
  • Introduced through: marklogic/java-client-api@marklogic/java-client-api#917ae8c1ac8b99f3677298111bc27d89ec5fc34e com.squareup.okhttp3:okhttp@4.11.0 com.squareup.okio:okio@3.2.0 com.squareup.okio:okio-jvm@3.2.0 org.jetbrains.kotlin:kotlin-stdlib-jdk8@1.6.20 org.jetbrains.kotlin:kotlin-stdlib-jdk7@1.6.20 org.jetbrains.kotlin:kotlin-stdlib@1.6.20
  • Introduced through: marklogic/java-client-api@marklogic/java-client-api#917ae8c1ac8b99f3677298111bc27d89ec5fc34e com.squareup.okhttp3:logging-interceptor@4.11.0 com.squareup.okhttp3:okhttp@4.11.0 com.squareup.okio:okio@3.2.0 com.squareup.okio:okio-jvm@3.2.0 org.jetbrains.kotlin:kotlin-stdlib-jdk8@1.6.20 org.jetbrains.kotlin:kotlin-stdlib@1.6.20
  • Introduced through: marklogic/java-client-api@marklogic/java-client-api#917ae8c1ac8b99f3677298111bc27d89ec5fc34e io.github.rburgst:okhttp-digest@2.7 com.squareup.okhttp3:okhttp@4.11.0 com.squareup.okio:okio@3.2.0 com.squareup.okio:okio-jvm@3.2.0 org.jetbrains.kotlin:kotlin-stdlib-jdk8@1.6.20 org.jetbrains.kotlin:kotlin-stdlib@1.6.20
  • Introduced through: marklogic/java-client-api@marklogic/java-client-api#917ae8c1ac8b99f3677298111bc27d89ec5fc34e com.squareup.okhttp3:logging-interceptor@4.11.0 com.squareup.okhttp3:okhttp@4.11.0 com.squareup.okio:okio@3.2.0 com.squareup.okio:okio-jvm@3.2.0 org.jetbrains.kotlin:kotlin-stdlib-jdk8@1.6.20 org.jetbrains.kotlin:kotlin-stdlib-jdk7@1.6.20 org.jetbrains.kotlin:kotlin-stdlib@1.6.20
  • Introduced through: marklogic/java-client-api@marklogic/java-client-api#917ae8c1ac8b99f3677298111bc27d89ec5fc34e io.github.rburgst:okhttp-digest@2.7 com.squareup.okhttp3:okhttp@4.11.0 com.squareup.okio:okio@3.2.0 com.squareup.okio:okio-jvm@3.2.0 org.jetbrains.kotlin:kotlin-stdlib-jdk8@1.6.20 org.jetbrains.kotlin:kotlin-stdlib-jdk7@1.6.20 org.jetbrains.kotlin:kotlin-stdlib@1.6.20

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

There is no fixed version for org.jetbrains.kotlin:kotlin-stdlib.

References