Kotlin Jackson default typing: unsafe deserialization
Rule ID: vetkit.kotlin.deserialization.jackson-default-typing
Jackson polymorphic typing accepts arbitrary class names from JSON input (unsafe deserialization).
Last updated:
Suite: Security
kotlin
Jackson polymorphic typing accepts arbitrary class names from JSON input (unsafe deserialization).
Category: SECURITY · Engine rule severity: WARNING
How to fix it
Remove default typing and @JsonTypeInfo(use = Id.CLASS) on Any-typed properties; use Id.NAME with registered subtypes, or activateDefaultTyping with a BasicPolymorphicTypeValidator allow-list.
References
Source: packages/engine/rules/sast/kotlin.yml.
Related checks
Check your own repository for this
vetkit runs this rule as part of a repository audit, alongside secret scanning, dependency vulnerabilities, code quality and AI code risk checks. It reads a temporary checkout and never executes your code.
Start with the free Security Quick Scan · See how the platform works
Generated from shipped rule definitions at build time. Matching is a review signal, not proof of exploitability. “generic” denotes text matching, not complete language or framework coverage. Runtime configuration and available tools affect whether a rule runs.