Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft malicious grammar with injected action block
-
DeliveryIntroduce grammar via supply chain or repo compromise
-
ExploitCI/CD pipeline invokes ANTLR4 tool
-
ExecutionOutputFile.java processes action block unsanitized
-
PersistArbitrary code executes in build environment
-
ImpactAttacker achieves RCE on developer machine or CI runner
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires that the target system run ANTLR4 version 4.13.2 or earlier against a grammar file (.g4) containing a maliciously crafted action block in the Grammar Action Block Handler. The attacker must control or influence the grammar file content - either directly (supply chain injection, repository compromise, malicious open-source contribution) or indirectly (social engineering a developer into processing a shared grammar). The CVSS 4.0 vector includes UI:N, suggesting the tool processes the grammar without explicit per-block user confirmation, which is consistent with automated build pipeline operation. Exploitation is limited to environments where ANTLR4 is actually invoked as a build or code-generation tool; runtime deployments of ANTLR4-generated parsers that do not invoke the ANTLR4 generator itself are not directly affected. No authentication to the target system is required by the attacker - the prerequisite is delivery of a malicious grammar file, not credential access. |
| Impact | The provided CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/E:P) scores 6.9, but the low impact metrics (L/L/L) appear inconsistent with the RCE and Code Injection tags assigned to this vulnerability. Code injection during parser generation typically results in full compromise of the host, not partial impact, suggesting the CVSS impact metrics may be understated. No EPSS score was provided, and the vulnerability is not listed in the CISA KEV catalog, so widespread automated exploitation has not been confirmed. However, a public POC exists on GitHub, which meaningfully elevates the practical threat above zero. The real-world risk is amplified by ANTLR4's common use in CI/CD pipelines: a malicious grammar file introduced via a supply-chain vector (e.g., a dependency's grammar file in a shared build system) could yield RCE on build infrastructure without interactive user awareness. The lack of any vendor response further elevates risk since no official patch timeline exists. Priority should be elevated for teams processing untrusted or third-party grammar files. |
| Exploit ScenarioDerived | An attacker contributes or compromises a repository containing an ANTLR4 grammar file and embeds a malicious action block within it. When a developer or automated CI/CD pipeline runs the ANTLR4 tool to regenerate parsers, OutputFile.java processes the grammar action block without adequate sanitization, causing the injected code to execute in the context of the build process. A public POC on GitHub (https://github.com/wooyun123/wooyun/issues/4) demonstrates the technique, lowering the barrier for exploitation. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jun 28, 2026
Code injection in ANTLR4's Grammar Action Block Handler allows remote attackers to execute arbitrary code by supplying a crafted grammar file processed by the tool. All versions up to and including 4.13.2 are affected via the OutputFile.java code generation pathway. A public proof-of-concept exploit exists on GitHub (no KEV listing), though the vendor has not acknowledged or patched the issue, leaving users without an official fix.
RemediationAI
No vendor-released patch has been identified at time of analysis, and the vendor did not respond to the coordinated disclosure. Until a patch is available, organizations should avoid processing untrusted or externally-sourced ANTLR4 grammar files (.g4) through any ANTLR4 toolchain at or below version 4.13.2. Specific compensating controls include: restricting ANTLR4 execution to isolated CI/CD sandbox environments with no network egress, so that any injected code cannot beacon out; enforcing cryptographic integrity checks (e.g., checksums or signed commits) on all grammar files before they enter the build pipeline to detect unauthorized modifications; and pinning grammar file sources to trusted internal repositories rather than pulling from public registries. Note that sandbox isolation does not prevent code injection into generated parser output files, which may then be compiled and executed downstream - downstream build steps should also be reviewed. Monitor the VulDB tracking page at https://vuldb.com/vuln/374495 and the ANTLR4 GitHub releases for an official patch release.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
ANTLR4 (Another Tool for Language Recognition, version 4) is a widely-used Java-based parser generator that compiles grammar files (.g4) into lexers and parsers. Grammar action blocks are Java code snippets embedded directly in grammar files; ANTLR4 processes these blocks via OutputFile.java during the code generation phase and interpolates them into generated source files. CWE-94 (Improper Control of Generation of Code / Code Injection) covers scenarios where user-controlled input - here, a grammar action block - is incorporated into generated code or interpreted in a privileged context without sufficient sanitization. The CPE (cpe:2.3:a:antlr:antlr4:*:*:*:*:*:*:*:*) confirms the entire ANTLR4 product family up to 4.13.2 is in scope. Because ANTLR4 typically runs in developer or CI/CD environments with elevated local privileges, successful exploitation yields code execution in a highly sensitive context.
Know when Antlr4 gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:P
UI:R because a developer or pipeline must actively process the malicious grammar file; S:C and C:H/I:H/A:H reflect full code execution on the host.
AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
Primary rating from Vendor (VulDB).
CVSS VectorVendor: VulDB
Lifecycle Timeline
1DescriptionCVE.org
A weakness has been identified in antlr ANTLR4 up to 4.13.2. Affected is an unknown function of the file tool/src/org/antlr/v4/codegen/model/OutputFile.java of the component Grammar Action Block Handler. Executing a manipulation can lead to code injection. The attack may be launched remotely. The exploit has been made available to the public and could be used for attacks. The vendor was contacted early about this disclosure but did not respond in any way.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Path traversal in ANTLR4 up to 4.13.2 exposes arbitrary file read via the tokenVocab grammar option handler. The vulnera
Command injection in ANTLR4's Go code generation target (GoTarget.java) allows a local low-privilege attacker to execute
Time-of-check time-of-use (TOCTOU) race condition in antlr4-maven-plugin up to version 4.13.2 allows a local low-privile
Same weakness CWE-94 – Code Injection
View allVendor StatusVendor
SUSE
Severity: Important| Product | Status |
|---|---|
| SUSE Linux Enterprise Module for Package Hub 15 SP7 | Affected |
| SUSE Linux Enterprise Module for Package Hub 15 SP5 | Affected |
| SUSE Linux Enterprise Module for Package Hub 15 SP6 | Affected |
| openSUSE Leap 15.3 | Affected |
| openSUSE Leap 15.4 | Affected |
| openSUSE Leap 15.5 | Affected |
| openSUSE Leap 15.6 | Affected |
EUVD-2026-39998
GHSA-m64j-m5c8-f58p
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB