Check File Extension Risk Level for Email Attachments
The file extension risk checker gives attachment filters, upload forms, and security reviews a consistent first-pass classification for a filename suffix.
Run — free
Enter an extension such as .exe, docm, or holiday.jpg and receive its normalized extension, category, risk level, active-content status, and a practical filtering recommendation. The check is deterministic and runs without network access. It is designed for policy triage rather than content inspection, so its result should complement MIME verification, malware scanning, archive inspection, and organizational allowlists.
Use the final extension as a fast screening signal
Attachment filtering often begins before a scanner opens the file. The visible filename suffix is inexpensive to inspect and can immediately separate common executable files, interpreter-driven scripts, macro-capable office documents, and familiar media formats. Submit either a bare suffix such as docm, a dotted extension such as .DOCM, or a complete filename such as quarterly-report.docm. The checker trims surrounding whitespace, ignores letter case, removes a URL query or fragment, and classifies the final suffix. That last-suffix behavior matters for names such as invoice.pdf.exe: the result follows .exe, not the harmless-looking text earlier in the name. The response includes a normalized dotted extension, the policy category, a plain risk level, whether the type normally supports active content, an explanation, and a recommended filtering action. This makes the output convenient for mail gateways, support portals, workflow rules, and human review queues that need one predictable vocabulary. It remains a screening signal, however, because attackers can rename files and honest files can have inaccurate suffixes.
Understand the four attachment risk categories
The executable category covers formats that can launch code directly or participate in program installation and system configuration. It receives a critical risk level and a block-by-default recommendation. The script category covers source or command files that a shell, interpreter, browser host, or automation runtime may execute; these receive a high rating. The document-macro-capable category identifies Office-family formats whose suffix explicitly permits macros or active add-ins, including docm, xlsm, and pptm. These also receive a high rating because a document can look routine while carrying executable logic. The safe media category contains commonly exchanged image, audio, and video suffixes that are not normally launched as programs, and it receives a low rating. “Safe” is relative to attachment policy, not a guarantee that bytes are benign: malformed images can exploit vulnerable decoders, SVG can contain complex content, and a suffix can disagree with the real format. For that reason, even low-risk results recommend content-type verification and ordinary malware scanning rather than unconditional trust.
Handle unknown types conservatively and combine checks
An attachment filter should not interpret an unfamiliar suffix as evidence of safety. When the checker does not recognize an extension, it returns recognized: false and places the value in the executable policy bucket with a critical risk level. This is a deliberate fail-safe choice: an administrator can quarantine the file, inspect it, and add a local rule instead of allowing a potentially active format by accident. In production, combine this result with several independent signals. Compare the declared MIME type with magic-byte detection, unpack archives in a restricted scanner, reject password-protected content when it cannot be inspected, scan for malware, and consider whether the sender and business process genuinely require the format. Maintain a narrow allowlist for workflows that accept only images or video, and do not broaden it merely because a file passes this extension check. Also record the normalized suffix and decision so policy changes can be audited. The API price is $0.002 per request, while browser execution can provide the same deterministic result without uploading the filename. Empty extensions are rejected because no meaningful suffix exists to classify.
What you can do with it
Screen inbound email attachments
Route executables, scripts, and macro-capable documents to quarantine before deeper malware analysis.
Validate support portal uploads
Apply a consistent first-pass policy to filenames before accepting customer-provided screenshots, videos, or documents.
Explain a blocked attachment
Return a stable category, rationale, and recommended action that an analyst can include in a review record.
FAQ
Does a low-risk result prove that a file is safe?
No. It only describes the usual behavior associated with the extension. Verify the actual file type and scan the content before trusting it.
What happens when the extension is unknown?
The result sets recognized to false and conservatively assigns the executable category and critical risk level, preventing an unfamiliar type from being treated as safe.
Can I enter a complete filename?
Yes. The checker uses the final suffix, so invoice.pdf.exe is classified by .exe. It also accepts a bare extension with or without a leading dot.
Why are macro-capable documents separate from scripts?
Their active logic is embedded in a familiar business document, so attachment policies commonly review or sanitize them differently from standalone script files.
What does the API request cost?
Each request costs $0.002. The check is deterministic and does not call a network service or an AI model.
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/security/file-extension-risk-check \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"extension":".docm"}'const res = await fetch("https://api.kit.forhosting.com/security/file-extension-risk-check", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"extension": ".docm"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/security/file-extension-risk-check",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"extension": ".docm"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/security/file-extension-risk-check", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"extension":".docm"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"extension":".docm"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/security/file-extension-risk-check", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"extension": ".docm"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "security.file_extension_risk_check",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |