CWE
Home > CWE List > CWE-173 Individual Dictionary Definition (Draft 9)   View the CWE List

CWE-173 Individual Dictionary Definition (Draft 9)

Failure to Handle Alternate Encoding
Weakness ID
Status: Draft

173 (Weakness Variant)

Description

Summary

The software does not properly handle when an input uses an alternate encoding that is valid for the control sphere to which the input is being sent.

Potential Mitigations

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

Assume all input is malicious. Use an appropriate combination of black lists and white lists to ensure only valid, expected and appropriate input is processed by the system. For example, valid input may be in the form of an absolute pathname(s). You can also limit pathnames to exist on selected drives, have the format specified to include only separator characters (forward or backward slashes) and alphanumeric characters, and follow a naming convention such as having a maximum of 32 characters followed by a '.' and ending with specified extensions.

Canonicalize the name to match that of the file system's representation of the name. This can sometimes be achieved with an available API (e.g. in Win32 the GetFullPathName function).

Relationships
NatureTypeIDName
ChildOfWeakness ClassWeakness ClassWeakness Class172Encoding Error
CanPrecedeWeakness VariantWeakness VariantWeakness Variant289Authentication Bypass by Alternate Name
Source Taxonomies

PLOVER - Alternate Encoding

Applicable Platforms

All

Related Attack Patterns
CAPEC-IDAttack Pattern Name
80Using UTF-8 Encoding to Bypass Validation Logic
79Using Slashes in Alternate Encoding
71Using Unicode Encoding to Bypass Validation Logic
53Postfix, Null Terminate, and Backslash
72URL Encoding
64Using Slashes and URL Encoding Combined to Bypass Validation Logic
3Using Leading 'Ghost' Character Sequences to Bypass Input Filters
78Using Escaped Slashes in Alternate Encoding
52Embedding NULL Bytes
Page Last Updated: April 21, 2008