Join our Newsletter — 33% off our NHI Course
Threats, Abuse & Incident Response

Double Extension

← Back to Glossary
By NHI Mgmt Group Updated November 18, 2026 Domain: Threats, Abuse & Incident Response

Double extension is a file-naming trick that hides a file’s real type by placing a harmless-looking extension before the true one. It relies on operating systems, email clients, or users showing only the first extension, so a file such as report.pdf.exe may look like a document but still run as an executable.

How double extension works

Double extension is a simple but effective deception technique: the attacker places a harmless-looking extension first, then appends the real executable or script extension after it. Because many interfaces truncate long filenames, or users focus on the first visible extension, the file can appear to be a document, image, or archive while still being a runnable payload.

The trick depends on presentation gaps, not on a new file format. A name such as report.pdf.exe is still an executable, but the social cue can bias a hurried reviewer into treating it as a safe document. That makes double extension useful in phishing, file-sharing abuse, and any delivery path where filename trust matters more than file inspection.

Why double extension is dangerous

The main danger is that the filename creates a false trust signal. If the user or system shows only the left-most extension, the file may bypass casual scrutiny, be opened, or be allowed through a process that was intended to block executables. In practice, the risk is highest where extensions are used as a proxy for trust instead of validating file type by content or policy.

It is especially effective against users who rely on familiar names, such as invoices, resumes, or reports. The technique does not exploit a software bug on its own, but it can amplify other attack chains by increasing the chance that a malicious file will be downloaded, shared, or executed.

Where double extension shows up in attack paths

Double extension is commonly used as part of masquerading, where a file is made to resemble something benign. It often appears alongside other naming tricks, including right-to-left override characters, misleading icons, or renamed utilities, because the goal is the same: make the payload look ordinary long enough for the victim to act on it.

When it succeeds, the attacker gains an initial execution opportunity or a foothold for later stages. That can lead to malware installation, credential theft, script execution, or further social engineering. T1036 Masquerading Defensive Guide covers the detection logic and metadata checks that help spot this class of deception. For a real-world delivery pattern that has used similar file-naming tricks, see DarkGate Malware Guide.

How to reduce exposure to double extension tricks

Defence starts with making file type visible and enforceable. Systems should show full filenames, not hide secondary extensions, and mail or web filters should treat risky executable types by content and policy rather than by the first visible label. User awareness matters, but it should sit behind technical controls that reduce the chance of a mistaken click becoming execution.

Good handling also includes blocking or flagging executable formats in places where they should not appear, such as document-sharing workflows, and using content-aware scanning instead of extension-only logic. In environments where users frequently handle scripts or developer artifacts, clear file-type handling rules are especially important. Secrets in VS Code extensions 2025 shows how attacker misuse of trusted-looking files and packages can turn routine workflows into an exposure path.

Risk and Threat Considerations

Double extension is risky because it attacks human and interface trust at the same time. The file may look harmless in a preview, while the operating system still treats it as executable, creating a mismatch between what the user believes and what the platform will run.

Failure mechanism: Security decisions are made from the visible name rather than the actual file type, so a malicious payload can slip through review, filtering, or user judgment.

Impact: The result can be code execution, malware delivery, or a successful foothold that leads to broader compromise.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

MITRE ATT&CK addresses the attack and risk surface, while CIS Controls v8, NIST SP 800-53 Rev 5 and OWASP ASVS set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
MITRE ATT&CKT1036 — MasqueradingDouble extension is a masquerading technique used to hide a file's true type.
Recommendation — Map deceptive filenames to T1036 and hunt for masquerading indicators in your detection pipeline.
CIS Controls v8CIS-8 — Audit Log ManagementVisibility into file execution and downloads supports detection of deceptive file-name abuse.
Recommendation — Log file downloads, execution and email attachment handling to spot double-extension abuse.
NIST SP 800-53 Rev 5SI-3 — Malicious Code ProtectionContent-based inspection and executable blocking address payloads disguised by misleading extensions.
CM-7 — Least FunctionalityRestricting allowed file types reduces exposure to disguised executable content.
Recommendation — Use SI-3 controls to inspect content and block malicious executables hidden behind benign-looking names. Apply CM-7 to limit executable file handling in channels where it is not required.
OWASP ASVSV13 — ConfigurationSecure configuration must ensure file-type handling and upload/download controls do not rely on extension alone.
Recommendation — Configure file validation and download handling so the true file type governs processing, not the displayed suffix.

Practitioner Guidance

What to watch for: Treat any file whose apparent document, image, or archive type conflicts with its actual behaviour as suspicious. Pay special attention to filenames that contain multiple extensions, unusual spacing, or Unicode tricks that make the true type less obvious.

Governance implication: File-handling policy should require full-extension visibility, content-based inspection, and explicit controls for executable types in email, download, and collaboration channels. The goal is to remove filename ambiguity before it reaches users, not to rely on them to spot it perfectly.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 18, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org