CAPEC-80 / ATTACK-PATTERN
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.
- Category
- CAPEC patterns
- Version / scope
- CAPEC 3.9; release 2023-01-24; publisher status Draft
- Affected / relevant technologies
- Publisher platform scope not separately specified
- Evidence
- Documentation: pinned-source excerpt checked. Execution: not tested. Editorial: curated reference.
Defensive analysis and explicitly authorized assessment only. This website performs no scans, exploitation, model calls or infrastructure changes. Indicators below are investigation opportunities, not proof of compromise or guaranteed detectors.
Mechanism and 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.
Potential impact
Confidentiality Access Control Authorization Bypass Protection Mechanism Confidentiality Integrity Availability Execute Unauthorized Commands Run Arbitrary Code Integrity Modify Data Availability Unreliable Execution
Versioned source scope
This record contains normalized, sometimes shortened source excerpts with editorial safety context. Markup and executable example blocks are omitted. Source-field verification does not establish device testing, a working detector or local applicability.
Publisher: MITRE. Release: CAPEC 3.9. Source checked: 2026-11-18.
Source object: CAPEC-80. Object modified: 2022-09-29.
Attribution and source terms (© The MITRE Corporation; reproduced with permission)Detection and investigation
- A web page that contains overly long UTF-8 codes constitute a protocol anomaly, and could be an indication that an attacker is attempting to exploit a vulnerability on the target host.
- An attacker can use a fuzzer in order to probe for a UTF-8 encoding vulnerability. The fuzzer should generate suspicious network activity noticeable by an intrusion detection system.
- An IDS filtering network traffic may be able to detect illegal UTF-8 characters.
Preserve source timestamps, asset identity and collection context. Correlate independent evidence before attributing malicious intent. In OT, review passive evidence with the process owner; do not induce failures, replay commands or write to controllers to test a hypothesis.
Mitigation and response
- The Unicode Consortium recognized multiple representations to be a problem and has revised the Unicode Standard to make multiple representations of the same code point with UTF-8 illegal. The UTF-8 Corrigendum lists the newly restricted UTF-8 range (See references). Many current applications may not have been revised to follow this rule. Verify that your application conform to the latest UTF-8 encoding specification. Pay extra attention to the filtering of illegal characters.
- The exact response required from an UTF-8 decoder on invalid input is not uniformly defined by the standards. In general, there are several ways a UTF-8 decoder might behave in the event of an invalid byte sequence: 1. Insert a replacement character (e.g. '?', ''). 2. Ignore the bytes. 3. Interpret the bytes according to a different character encoding (often the ISO-8859-1 character map). 4. Not notice and decode as if the bytes were some similar bit of UTF-8. 5. Stop decoding and report an error (possibly giving the caller the option to continue). It is possible for a decoder to behave in different ways for different types of invalid input. RFC 3629 only requires that UTF-8 decoders must not decode "overlong sequences" (where a character is encoded in more bytes than needed but still adheres to the forms above). The Unicode Standard requires a Unicode-compliant decoder to "...treat any ill-formed code unit sequence as an error condition. This guarantees that it will neither interpret nor emit an ill-formed code unit sequence." Overlong forms are one of the most troublesome types of UTF-8 data. The current RFC says they must not be decoded but older specifications for UTF-8 only gave a warning and many simpler decoders will happily decode them. Overlong forms have been used to bypass security validations in high profile products including Microsoft's IIS web server. Therefore, great care must be taken to avoid security issues if validation is performed before conversion from UTF-8, and it is generally much simpler to handle overlong forms before any input validation is […]
- For security reasons, a UTF-8 decoder must not accept UTF-8 sequences that are longer than necessary to encode a character. If you use a parser to decode the UTF-8 encoding, make sure that parser filter the invalid UTF-8 characters (invalid forms or overlong forms).
- Look for overlong UTF-8 sequences starting with malicious pattern. You can also use a UTF-8 decoder stress test to test your UTF-8 parser (See Markus Kuhn's UTF-8 and Unicode FAQ in reference section)
Apply changes through the asset owner's approved change and recovery process. Documentation review is separate from successful testing or verified production protection.
Related technical context
No protocol-specific mapping is asserted for this entry.
Publisher weakness and attack-pattern relationships
These relationships retain the publisher's source attributes and view context; they do not establish that an attack or weakness applies to a particular system.
- CAPEC-80 → ChildOf → CAPEC-267 Open related reference
- CAPEC-80 → PeerOf → CAPEC-64 Open related reference
- CAPEC-80 → PeerOf → CAPEC-71 Open related reference
- CAPEC-80 → Related_Weakness → CWE-172 Open related reference
- CAPEC-80 → Related_Weakness → CWE-173 Open related reference
- CAPEC-80 → Related_Weakness → CWE-180 Open related reference
- CAPEC-80 → Related_Weakness → CWE-181 Open related reference
- CAPEC-80 → Related_Weakness → CWE-20 Open related reference
- CAPEC-80 → Related_Weakness → CWE-692 Open related reference
- CAPEC-80 → Related_Weakness → CWE-697 Open related reference
- CAPEC-80 → Related_Weakness → CWE-73 Open related reference
- CAPEC-80 → Related_Weakness → CWE-74 Open related reference
- CWE-172 → Related_Attack_Pattern → CAPEC-80 Open related reference
- CWE-173 → Related_Attack_Pattern → CAPEC-80 Open related reference
- CWE-180 → Related_Attack_Pattern → CAPEC-80 Open related reference
- CWE-181 → Related_Attack_Pattern → CAPEC-80 Open related reference
- CWE-20 → Related_Attack_Pattern → CAPEC-80 Open related reference
- CWE-692 → Related_Attack_Pattern → CAPEC-80 Open related reference
- CWE-697 → Related_Attack_Pattern → CAPEC-80 Open related reference
- CWE-73 → Related_Attack_Pattern → CAPEC-80 Open related reference
- CWE-74 → Related_Attack_Pattern → CAPEC-80 Open related reference
Authoritative sources and attribution
Identifiers and source titles belong to OWASP, MITRE, the CVE Program, CISA, NIST or the cited vendor. Source excerpts are attributed and adapted under the linked publisher license; editorial context is separate. This is not an official framework mirror. Review baseline: 2026-11-18. Live documents can change; check exact current applicability.
- https://capec.mitre.org/data/definitions/80.html — Publisher link; not separately HTTP-checked
- capec — source accessed 2026-11-18
Source review supports bounded reference text. It is not execution evidence, a completeness claim, a CVSS assessment, a compliance certification or verification of production security.
