A 90%-accurate model missed 93% of recent .NET malware
Update (26 October 2026): The "existing model" (M0) in this note is the Phase 1 model (EMBER 2018, 5 features); today's model is the native model trained on EMBER2024. 3.8% is the missed-malware rate of the specialist model M2 (with the shortcut), not a false-alarm rate: M2's overall false-alarm rate was 4.2%, ~26% on EXEs (see below). The native model's .NET measurement: README, "Native model". The text below is unchanged from 9 October.
In short: The first Chief-Sef model looked good overall. But on 120,000 .NET files from the last months of 2024, its accuracy fell to 53% and it missed 92.8% of the malware. The overall score was hiding the collapse. I built a specialist model, and it found a shortcut of its own: “a DLL means benign”.
The first hint: a subgroup inside the overall score
The model scored about 90% accuracy on EMBER 2018 data. Splitting the results by file type changed the picture: in cross-validation, 52% of .NET malware slipped through, against 11.5% for non-.NET files. Because .NET files are a small part of the data, the collapse was almost invisible in the overall average.
- .NET malwareEMBER 2018, cross-validation52%
- Non-.NET malwareEMBER 2018, cross-validation11.5%
On recent data: a coin toss
I asked a harder question: what does the model do with .NET malware that appeared six years after its training data? I used the .NET test set of the EMBER2024 dataset (September–December 2024, never seen in training). A side note: the documentation said this set held 60 thousand files; when I counted, it held 120,000. Not trusting a documented number is part of the job.
| Measurement (EMBER2024 .NET test) | Result |
|---|---|
| Accuracy | 53% |
| Missed malware | 92.8% |
| AUC | 0.63 |
An AUC of 0.63 is not much better than guessing. The misses included common families such as xworm, njrat, asyncrat, agenttesla, redline and clipbanker; between 83% and 99% of each family's samples slipped through.
Why is it blind?
The five features the model looks at come from the PE header. In .NET files the real code lives in the intermediate language and metadata read by the Common Language Runtime (CLR); from the header's point of view they all look alike: almost every one has a single import (mscoree.dll) and similar entropy. On top of that, the EMBER 2018 training data held few .NET malware samples (162). Adding an “is it .NET?” flag did not help either: the model without the flag was just as blind, and with the flag the miss rate went from 92.8% to 93.4%.
A specialist model: most of the gain comes from data
I tried a separate model for .NET files. I trained it on a 100-thousand-file sample from the first 52 weeks of EMBER2024's .NET training set and tested it on the last 12 weeks (a temporal split). Step by step:
| Model | Missed malware | AUC |
|---|---|---|
| M0: existing model | 92.8% | 0.63 |
| M1: new data, same five features | 12.3% | 0.94 |
| M2: + string features | 3.8% | 0.993 |
- M0: current modelEMBER 2018, 5 features92.8%
- M1: new datasame five features12.3%
- M2: + string featuresspecialist model3.8%
Most of the gain came from the new data; string features (counts of patterns such as URLs, base64 and cryptography terms in the readable text of a file) added another layer. M2's overall false-alarm rate was 4.2%. It looked too good.
The shortcut: “a DLL means benign”
I looked at the feature the model found most important: how many times the word “privilege” appears in the file. It was not a sign of maliciousness but a proxy for file type. The word appears in the manifest of executable (EXE) files, and in the dataset ~90% of benign files were DLLs while ~90% of malicious ones were EXEs. The model had learned the shortcut “be suspicious of EXEs”.
Splitting the results by type showed it: M2's false-alarm rate on EXE files was ~26%, hidden by the overall 4.2%. Removing the manifest words from the features did not fix it (21%): the type information had seeped into other features too.
The fix: balance within each type
For M2d, I built the training sample so that each file type is 50% malicious / 50% benign within itself, and gave the file type to the model explicitly as an input. The model still knows the type, but the type can no longer stand in for maliciousness.
| Measurement | M2 | M2d |
|---|---|---|
| EXE false alarms | 26.5% | 7.3% |
| EXE AUC | 0.966 | 0.979 |
| DLL AUC | 0.986 | 0.993 |
| EXE missed malware | 2.9% | 8.0% |
| Overall accuracy | 95.97% | 94.97% |
Overall accuracy dropped by a point. I do not see that as a loss: the test set carries the same type imbalance, so the shortcut was being rewarded there. The drop is the price of becoming realistic. In M2d the most important features are now content signals: URLs, the average length and entropy of strings, and cryptography and base64 patterns.
On real files
I also tested both models on real, benign .NET files from my own computer (500 EXEs, 500 DLLs). On EXEs, false alarms were 15.6% for M2 (95% confidence interval 12.7–19.0) and 1.6% for M2d (0.8–3.1); on DLLs both had 0 false alarms out of 500. The shortcut existed in the real world too, and M2d removes it. A caveat: this sample is not random (the first 500 in folder order) and contains many files from the same packages, so the real uncertainty is wider than the interval.
- M2
- M2d
- EXE false alarms, test setEMBER2024 .NETM226.5%M2d7.3%
- EXE false alarms, real files500 benign EXEs from my own computerM215.6%M2d1.6%
The cost
With the shortcut gone, the miss rate rose for some families: agenttesla from 7.0% to 11.1%, formbook from 2.8% to 6.2%, remcos from 3.2% to 6.9%. I am tracking these and will measure agenttesla separately when designing thresholds. M2d is still experimental and has not been merged into the main model.
Lessons
- Measure subgroups separately. File type, .NET, packed files: an overall score can hide one group collapsing.
- “The most important feature” may be a proxy. Ask what the feature at the top of the ranking really measures.
- Balance within each subgroup. Even if the classes are balanced overall, an imbalance inside a subgroup lets the model learn a shortcut there.
- Do not trust a documented number; count.
Transparency
I write the code for this project with AI, using Claude Code. The design of the measurements, the interpretation of the results and the decision about what to publish are mine. The scripts that ran these measurements (net_dogrulama.py, net_model.py) and the detailed notes are in the Chief-Sef repository (notes in Turkish).
References
- The EMBER2024 dataset (Hugging Face) and its feature extractor thrember (Apache-2.0); the string features here are computed exactly as in that code.
- H. S. Anderson, P. Roth. EMBER: An Open Dataset for Training Static PE Malware Machine Learning Models, 2018.
Turan Tech