google / google/magika

[Misdetection] BASE64 (text/plain) file misdetected as PS1

Open
#1,146 1 comment 0 reactions 0 assignees View on GitHub
misdetection
Dominant language
Rust
Stars
18.6k
Forks
1.2k
Avg merge
3d 12h
Merged PRs (30d)
20

Description

**What should the file have been detected as? What has the file been misdetected as?**
This BASE64-encoded file is incorrectly detected by Magika as PowerShell (PS1), whereas it should be seen at least as text/plain (since BASE64 has no dedicated mimetype), or better with a label such as "BASE64-encoded file".

Note: the original file that was encoded in BASE64 is a simple text file (UTF-16LE), not PS1.

**Please link or attach the misdetected file below** (Do NOT upload PII!)

[ALERT.MSG](https://github.com/user-attachments/files/22624180/ALERT.MSG)

**Additional context**
Magika output:
```
$ magika --version
magika 0.1.2 standard_v3_3
$ magika --json ALERT.MSG
[
{
"path": "ALERT.MSG",
"result": {
"status": "ok",
"value": {
"dl": {
"description": "Powershell source",
"extensions": [
"ps1"
],
"group": "code",
"is_text": true,
"label": "powershell",
"mime_type": "application/x-powershell"
},
"output": {
"description": "Powershell source",
"extensions": [
"ps1"
],
"group": "code",
"is_text": true,
"label": "powershell",
"mime_type": "application/x-powershell"
},
"score": 0.906000018119812
}
}
}
]
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the report with the attached ALERT.MSG using the documented `magika --json ALERT.MSG` command and inspect the file-type classification path that distinguishes BASE64 content from PowerShell. Done means the file is no longer classified as PS1 and is reported as text/plain or with a BASE64-encoded-file label.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
devtools, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.