Path Equivalence: 'filename.' (Trailing Dot)

Incomplete Variant
Structure: Simple
Description

This vulnerability occurs when a system accepts file or directory paths that end with a dot (like 'file.txt.' or 'folder.') without properly checking them. Attackers can exploit this to bypass security checks, potentially accessing files or directories they shouldn't be able to reach.

Extended Description

Many operating systems, particularly Windows, treat a trailing dot in a path as functionally equivalent to the same path without the dot. For example, 'secret.txt.' might resolve to 'secret.txt'. This happens because the file system APIs often normalize the path by stripping the trailing dot before processing it. However, security checks—like those verifying file extensions or path permissions—might be performed before this normalization, or might treat 'file.txt' and 'file.txt.' as different strings. This creates a mismatch where the security logic sees one path, but the underlying system accesses another. As a developer, you can prevent this by consistently normalizing and canonicalizing all file paths before using them in any security-critical operations. Always use the same system APIs for both validation and the final file access. Never rely on simple string comparison for path validation. Implement strict allow-lists for permitted file extensions and directories, and ensure your validation logic accounts for all possible operating system path equivalencies.

Common Consequences 1
Scope: Access Control

Impact: Bypass Protection Mechanism

Observed Examples 7
CVE-2000-1114Source code disclosure using trailing dot
CVE-2002-1986Source code disclosure using trailing dot
CVE-2004-2213Source code disclosure using trailing dot
CVE-2005-3293Source code disclosure using trailing dot
CVE-2004-0061Bypass directory access restrictions using trailing dot in URL
CVE-2000-1133Bypass directory access restrictions using trailing dot in URL
CVE-2001-1386Bypass check for ".lnk" extension using ".lnk."
Applicable Platforms
Languages:
Not Language-Specific : Undetermined
Modes of Introduction
Implementation
Functional Areas
  1. File Processing
Affected Resources
  1. File or Directory
Taxonomy Mapping
  • PLOVER
  • Software Fault Patterns