Find, fix and prevent vulnerabilities in your code.
medium severity
- Vulnerable module: io.vertx:vertx-core
- Introduced through: io.vertx:vertx-core@3.9.0, io.vertx:vertx-codetrans@3.5.4 and others
Detailed paths
-
Introduced through: Stwissel/vertx-sfdc-platformevents@Stwissel/vertx-sfdc-platformevents#af302fd2568ec3dcbc66d46e0b65f9979ba43f90 › io.vertx:vertx-core@3.9.0Remediation: Upgrade to io.vertx:vertx-core@3.9.4.
-
Introduced through: Stwissel/vertx-sfdc-platformevents@Stwissel/vertx-sfdc-platformevents#af302fd2568ec3dcbc66d46e0b65f9979ba43f90 › io.vertx:vertx-codetrans@3.5.4 › io.vertx:vertx-core@3.9.0Remediation: Upgrade to io.vertx:vertx-codetrans@3.9.4.
-
Introduced through: Stwissel/vertx-sfdc-platformevents@Stwissel/vertx-sfdc-platformevents#af302fd2568ec3dcbc66d46e0b65f9979ba43f90 › io.vertx:vertx-lang-groovy@3.5.4 › io.vertx:vertx-core@3.9.0Remediation: Upgrade to io.vertx:vertx-lang-groovy@3.9.4.
-
Introduced through: Stwissel/vertx-sfdc-platformevents@Stwissel/vertx-sfdc-platformevents#af302fd2568ec3dcbc66d46e0b65f9979ba43f90 › io.vertx:vertx-lang-js@3.5.4 › io.vertx:vertx-core@3.9.0Remediation: Upgrade to io.vertx:vertx-lang-js@3.9.4.
-
Introduced through: Stwissel/vertx-sfdc-platformevents@Stwissel/vertx-sfdc-platformevents#af302fd2568ec3dcbc66d46e0b65f9979ba43f90 › io.vertx:vertx-lang-ruby@3.5.4 › io.vertx:vertx-core@3.9.0Remediation: Upgrade to io.vertx:vertx-lang-ruby@3.9.4.
-
Introduced through: Stwissel/vertx-sfdc-platformevents@Stwissel/vertx-sfdc-platformevents#af302fd2568ec3dcbc66d46e0b65f9979ba43f90 › io.vertx:vertx-redis-client@3.9.0 › io.vertx:vertx-core@3.9.0Remediation: Upgrade to io.vertx:vertx-redis-client@3.9.4.
-
Introduced through: Stwissel/vertx-sfdc-platformevents@Stwissel/vertx-sfdc-platformevents#af302fd2568ec3dcbc66d46e0b65f9979ba43f90 › io.vertx:vertx-rx-java@3.5.4 › io.vertx:vertx-core@3.9.0Remediation: Upgrade to io.vertx:vertx-rx-java@3.9.4.
-
Introduced through: Stwissel/vertx-sfdc-platformevents@Stwissel/vertx-sfdc-platformevents#af302fd2568ec3dcbc66d46e0b65f9979ba43f90 › io.vertx:vertx-rx-java2@3.5.4 › io.vertx:vertx-core@3.9.0Remediation: Upgrade to io.vertx:vertx-rx-java2@3.9.4.
-
Introduced through: Stwissel/vertx-sfdc-platformevents@Stwissel/vertx-sfdc-platformevents#af302fd2568ec3dcbc66d46e0b65f9979ba43f90 › net.wissel.salesforce:vertx-sfdc-core@0.3.5 › io.vertx:vertx-core@3.9.0
Overview
io.vertx:vertx-core is a tool-kit for building reactive applications on the JVM.
Affected versions of this package are vulnerable to Directory Traversal. StaticHandler doesn't correctly processes backslashes on Windows Operating systems, allowing, escape the webroot folder to the current working directory.
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 io.vertx:vertx-core
to version 3.9.4 or higher.
References
medium severity
- Vulnerable module: org.jetbrains.kotlin:kotlin-stdlib
- Introduced through: io.vertx:vertx-codetrans@3.5.4 and org.jetbrains.kotlin:kotlin-stdlib-jre8@1.2.20
Detailed paths
-
Introduced through: Stwissel/vertx-sfdc-platformevents@Stwissel/vertx-sfdc-platformevents#af302fd2568ec3dcbc66d46e0b65f9979ba43f90 › io.vertx:vertx-codetrans@3.5.4 › org.jetbrains.kotlin:kotlin-stdlib@1.2.20Remediation: Upgrade to io.vertx:vertx-codetrans@3.7.1.
-
Introduced through: Stwissel/vertx-sfdc-platformevents@Stwissel/vertx-sfdc-platformevents#af302fd2568ec3dcbc66d46e0b65f9979ba43f90 › org.jetbrains.kotlin:kotlin-stdlib-jre8@1.2.20 › org.jetbrains.kotlin:kotlin-stdlib@1.2.20
-
Introduced through: Stwissel/vertx-sfdc-platformevents@Stwissel/vertx-sfdc-platformevents#af302fd2568ec3dcbc66d46e0b65f9979ba43f90 › org.jetbrains.kotlin:kotlin-stdlib-jre8@1.2.20 › org.jetbrains.kotlin:kotlin-stdlib-jre7@1.2.20 › org.jetbrains.kotlin:kotlin-stdlib@1.2.20
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
low severity
- Vulnerable module: org.jetbrains.kotlin:kotlin-stdlib
- Introduced through: io.vertx:vertx-codetrans@3.5.4 and org.jetbrains.kotlin:kotlin-stdlib-jre8@1.2.20
Detailed paths
-
Introduced through: Stwissel/vertx-sfdc-platformevents@Stwissel/vertx-sfdc-platformevents#af302fd2568ec3dcbc66d46e0b65f9979ba43f90 › io.vertx:vertx-codetrans@3.5.4 › org.jetbrains.kotlin:kotlin-stdlib@1.2.20
-
Introduced through: Stwissel/vertx-sfdc-platformevents@Stwissel/vertx-sfdc-platformevents#af302fd2568ec3dcbc66d46e0b65f9979ba43f90 › org.jetbrains.kotlin:kotlin-stdlib-jre8@1.2.20 › org.jetbrains.kotlin:kotlin-stdlib@1.2.20
-
Introduced through: Stwissel/vertx-sfdc-platformevents@Stwissel/vertx-sfdc-platformevents#af302fd2568ec3dcbc66d46e0b65f9979ba43f90 › org.jetbrains.kotlin:kotlin-stdlib-jre8@1.2.20 › org.jetbrains.kotlin:kotlin-stdlib-jre7@1.2.20 › org.jetbrains.kotlin:kotlin-stdlib@1.2.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
.