CVE-2026-13502: antlr ANTLR4 Maven Plugin unsafe deserialization in GrammarDependencies

CVE-2026-13502 · Severity: medium · CVSS 4.5 · Published 2026-06-28

A security vulnerability exists in the ANTLR4 Maven Plugin, a tool used by developers to generate code from language grammars during the software build process. The plugin improperly handles certain temporary files, allowing a local attacker or a compromised build process to execute malicious code on the developer's machine or build server. This could lead to a full system takeover, theft of credentials, or disruption of the software development pipeline.

Vendors: ANTLR.

Quick answers

Is CVE-2026-13502 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-13502 being exploited in the wild.
How severe is CVE-2026-13502?
Medium severity, with a CVSS score of 4.5, published 28 June 2026.
Which products and versions are affected?
ANTLR4 Maven Plugin up to 4.13.2.
Is there a fix for CVE-2026-13502?
No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.
How is CVE-2026-13502 attacked?
It is attacked with local access, in a software library.
Am I affected by CVE-2026-13502?
Check whether you run ANTLR4 Maven Plugin at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

The ANTLR4 Maven plugin's `GrammarDependencies.java` component utilizes `ObjectInputStream.readObject()` to deserialize a grammar dependency status file (typically located in the `target/` directory) without implementing an `ObjectInputFilter`. This lack of filtering allows for the instantiation of arbitrary classes present on the Maven classpath, enabling gadget chain attacks (e.g., via CommonsCollections). An attacker with local write access to the build directory—potentially through shared CI caches or compromised local processes—can place a serialized malicious object in the status file. When a user executes `mvn antlr4:antlr4`, the plugin deserializes the file, leading to Remote Code Execution (RCE) in the context of the build user. The vulnerability also involves a Time-of-Check Time-of-Use (TOCTOU) race condition during the file existence check.

Affected products

  • antlr ANTLR4 Maven Plugin up to 4.13.2

Timeline

  • 2026-05-26: disclosed: Initial vulnerability report date
  • 2026-06-28: advisory: NVD/VulDB publication date

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.