CAPEC-80
Using UTF-8 Encoding to Bypass Validation Logic
This attack is a specific variation on leveraging alternate encodings to bypass validation logic. This attack leverages the possibility to encode potentially harmful input in UTF-8 and submit it to applications not expecting or effective at validating this encoding standard making input filtering difficult. UTF-8 (8-bit UCS/Unicode Transformation Format) is a variable-length character encoding for Unicode. Legal UTF-8 characters are one to four bytes long. However, early version of the UTF-8 specification got some entries wrong (in some cases it permitted overlong characters). UTF-8 encoders are supposed to use the "shortest possible" encoding, but naive decoders may accept encodings that are longer than necessary. According to the RFC 3629, a particularly subtle form of this attack can be carried out against a parser which performs security-critical validity checks against the UTF-8 encoded form of its input, but interprets certain illegal octet sequences as characters.
Abstraction
Detailed
Typical severity
High
Likelihood of attack
High
Understand the attack
What is this attack pattern?
Execution flow
How does the attack proceed, step by step?
Explore
Survey the application for user-controllable inputs
Techniques used
- Use a spidering tool to follow and record all links and analyze the web pages to find entry points. Make special note of any links that include parameters in the URL.
- Use a proxy tool to record all user input entry points visited during a manual traversal of the web application.
- Use a browser to manually explore the website and analyze how it is constructed. Many browsers' plugins are available to facilitate the analysis or automate the discovery.
Experiment
Probe entry points to locate vulnerabilities
Techniques used
- Try to use UTF-8 encoding of content in Scripts in order to bypass validation routines.
- Try to use UTF-8 encoding of content in HTML in order to bypass validation routines.
- Try to use UTF-8 encoding of content in CSS in order to bypass validation routines.
Requirements
What does the attack require?
Prerequisites
- The application's UTF-8 decoder accepts and interprets illegal UTF-8 characters or non-shortest format of UTF-8 encoding.
- Input filtering and validating is not done properly leaving the door open to harmful characters for the target host.
Skills required
- Low: An attacker can inject different representation of a filtered character in UTF-8 format.
- Medium: An attacker may craft subtle encoding of input data by using the knowledge that they have gathered about the target host.
Resources required
Not stated in the MITRE record.
Detection
What are the indicators of the attack?
Impact
What does a successful attack lead to?
Affected scopes: Confidentiality, Access Control, Authorization
Affected scopes: Confidentiality, Integrity, Availability
Affected scopes: Integrity
Affected scopes: Availability
Defence
How is it prevented and mitigated?
Real world