CVE-2021-22097 — spring-amqp
MEDIUMCVE-2021-22097 is a medium-severity (CVSS 6.5) Deserialization of Untrusted Data vulnerability in org.springframework.amqp:spring-amqp. A fix is available for org.springframework.amqp:spring-amqp — see the affected versions and patch details below.
Deserialization of Untrusted Data in Spring AMQP
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
org.springframework.amqp:spring-amqp☕org.springframework.amqp:spring-amqpReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Maven packages — download data is not available via public APIs for these ecosystems.
Description
In Spring AMQP versions 2.2.0 - 2.2.18 and 2.3.0 - 2.3.10, the Spring AMQP Message object, in its toString() method, will deserialize a body for a message with content type application/x-java-serialized-object. It is possible to construct a malicious java.util.Dictionary object that can cause 100% CPU usage in the application if the toString() method is called.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| ☕Maven | org.springframework.amqp:spring-amqp | ≥ 2.2.0&&< 2.2.19 | 2.2.19org.springframework.amqp:spring-amqp:2.2.19 |
| ☕Maven | org.springframework.amqp:spring-amqp | ≥ 2.3.0&&< 2.3.11 | 2.3.11org.springframework.amqp:spring-amqp:2.3.11 |
Affected Products
spring advanced message queuing protocolvmwareDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for org.springframework.amqp:spring-amqp, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update org.springframework.amqp:spring-amqp to 2.2.19 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-22097 is resolved across your whole dependency graph.
Workarounds
Do not deserialise data from untrusted sources: where the format allows it, restrict deserialisation to an explicit allowlist of expected types, and prefer a data-only format (JSON, Protobuf) over one that can reconstruct arbitrary objects until you can upgrade.
Frequently Asked Questions
Is CVE-2021-22097 in your dependencies?
Find it across Maven, including transitive dependencies.