Critical Vulnerability in the Kotlin Ecosystem: What to Do?
In early 2019, the Kotlin developer community was alarmed by news of a critical vulnerability affecting popular libraries and tools in the ecosystem. According to a report from JetBrains, the vulnerability was assigned identifier CVE-2019-13100 and was related to the data deserialization mechanism in the kotlinx.serialization library. The issue allowed attackers to execute arbitrary code on the server by sending specially crafted JSON requests.
"The vulnerability affects versions of the kotlinx.serialization library prior to 0.11.0. We strongly recommend that all developers immediately update dependencies in their projects," said JetBrains lead engineer Dmitry Jemerov. According to him, the issue was discovered during an internal security audit and has already been fixed in release 0.11.1.
Statistics show that more than 40% of Kotlin projects using serialization could have been at risk. Server applications on Ktor and Android applications working with external APIs turned out to be particularly vulnerable. Cybersecurity experts from Positive Technologies noted that exploiting the vulnerability does not require high qualifications — it is enough to send a POST request with a malicious payload.
What should developers do? First, check the version of kotlinx.serialization in build.gradle or pom.xml. If a version lower than 0.11.0 is used, it must be updated to 0.11.1 or higher. For projects where updating is not possible (for example, due to backward compatibility), it is recommended to implement additional input validation and use isolated ClassLoaders.
"We have also released a patch for Kotlin Compiler 1.3.31, which adds warnings when using deprecated serialization methods. Updating the compiler is a mandatory step for everyone working with Kotlin 1.3.x," added Jemerov.
At the time of publication, the vulnerability had already been used in several attacks on financial applications in Asia. Developers are advised to monitor updates on the official JetBrains website and the GitHub repository. If suspicious activity is detected, immediately contact the security team.