Failure to Resolve Case Sensitivity
Weakness ID: 178 (Weakness Base)Status: Incomplete
+ Description

Description Summary

The software does not properly account for differences in case sensitivity when accessing or determining the properties of a resource, leading to inconsistent results.

Extended Description

Improperly handled case sensitive data can lead to several possible consequences, including:

  • case-insensitive passwords reducing the size of the key space, making brute force attacks easier

  • bypassing filters or access controls using alternate names

  • multiple interpretation errors using alternate names.

+ Time of Introduction
  • Implementation
+ Applicable Platforms

Languages

All

+ Demonstrative Examples

Example 1

In the following example, an XSS sanitization routine only checks for the lower-case "script" string, which can be easily defeated using tags such as SCRIPT or ScRiPt.

(Bad Code)
Example Language: Java 
public String sanitize(String input, String mask) {
return input.replaceAll("script", mask);
}
+ Observed Examples
ReferenceDescription
CVE-2000-0499Application server allows attackers to bypass execution of a jsp page and read the source code using an upper case JSP extension in the request.
CVE-2000-0497The server is case sensitive, so filetype handlers treat .jsp and .JSP as different extensions. JSP source code may be read because .JSP defaults to the filetype "text".
CVE-2000-0498The server is case sensitive, so filetype handlers treat .jsp and .JSP as different extensions. JSP source code may be read because .JSP defaults to the filetype "text".
CVE-2001-0766A URL that contains some characters whose case is not matched by the server's filters may bypass access restrictions because the case-insensitive file system will then handle the request after it bypasses the case sensitive filter.
CVE-2001-0795
CVE-2001-1238
CVE-2003-0411chain: Code was ported from a case-sensitive Unix platform to a case-insensitive Windows platform where filetype handlers treat .jsp and .JSP as different extensions. JSP source code may be read because .JSP defaults to the filetype "text".
CVE-2002-0485Leads to interpretation error
CVE-1999-0239Directories may be listed because lower case web requests are not properly handled by the server.
CVE-2005-0269
CVE-2004-1083
CVE-2002-2119Case insensitive passwords lead to search space reduction.
CVE-2004-2214HTTP server allows bypass of access restrictions using URIs with mixed case.
CVE-2004-2154Mixed upper/lowercase allows bypass of ACLs.
CVE-2005-4509Bypass malicious script detection by using tokens that aren't case sensitive.
CVE-2002-1820Mixed case problem allows "admin" to have "SecurityDatabase\User\Admin" rights (alternate name property).
CVE-2007-3365Chain: uppercase file extensions causes web server to return script source code instead of executing the script.
+ Potential Mitigations

Avoid making decisions based on names of resources (e.g. files) if those resources can have alternate names.

Phase: Architecture and Design

Assume all input is malicious. Use a standard input validation mechanism to validate all input for length, type, syntax, and business rules before accepting the data to be displayed or stored. Use an "accept known good" validation strategy.

Use and specify a strong output encoding (such as ISO 8859-1 or UTF 8).

Do not rely exclusively on blacklist validation to detect malicious input or to encode output. There are too many variants to encode a character; you're likely to miss some variants.

Inputs should be decoded and canonicalized to the application's current internal representation before being validated. Make sure that your application does not decode the same input twice. Such errors could be used to bypass whitelist schemes by introducing dangerous inputs after they have been checked.

+ Relationships
NatureTypeIDNameView(s) this relationship pertains toView(s)
ChildOfCategoryCategory171Cleansing, Canonicalization, and Comparison Errors
Development Concepts (primary)699
ChildOfCategoryCategory632Weaknesses that Affect Files or Directories
Resource-specific Weaknesses (primary)631
ChildOfWeakness ClassWeakness Class706Use of Incorrectly-Resolved Name or Reference
Research Concepts (primary)1000
CanPrecedeWeakness VariantWeakness Variant289Authentication Bypass by Alternate Name
Research Concepts1000
CanPrecedeWeakness VariantWeakness Variant433Unparsed Raw Web Content Delivery
Research Concepts1000
+ Research Gaps

These are probably under-studied in Windows and Mac environments, where file names are case-insensitive and thus are subject to equivalence manipulations involving case.

+ Affected Resources
  • File/Directory
+ Functional Areas
  • File Processing, Credentials
+ Taxonomy Mappings
Mapped Taxonomy NameNode IDFitMapped Node Name
PLOVERCase Sensitivity (lowercase, uppercase, mixed case)
+ Content History
Submissions
Submission DateSubmitterOrganizationSource
PLOVERExternally Mined
Modifications
Modification DateModifierOrganizationSource
2008-07-01Sean EidemillerCigitalExternal
added/updated demonstrative examples
2008-07-01Eric DalciCigitalExternal
updated Potential Mitigations, Time of Introduction
2008-09-08CWE Content TeamMITREInternal
updated Description, Relationships, Observed Example, Taxonomy Mappings
2008-10-14CWE Content TeamMITREInternal
updated Observed Examples
2008-11-24CWE Content TeamMITREInternal
updated Observed Examples
2009-03-10CWE Content TeamMITREInternal
updated Description
2009-07-27CWE Content TeamMITREInternal
updated Potential Mitigations
Previous Entry Names
Change DatePrevious Entry Name
2008-04-11Case Sensitivity (Lowercase, Uppercase, Mixed Case)