---
title: "CWE-176: Improper Handling of Unicode Encoding"
url: https://radicalnotion.ai/cwe/cwe-176
type: cwe
description: "The product does not properly handle when an input contains Unicode encoding."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-176: Improper Handling of Unicode Encoding

- **Abstraction:** Variant
- **Structure:** Simple
- **Status:** Draft
- **CVEs with this as primary weakness:** 37
- **Of those, in CISA KEV:** 1
- **New in 2026:** 25
- **CWE catalog version:** 4.21

## Description

The product does not properly handle when an input contains Unicode encoding.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | - |

## Applicable platforms

**Languages:** Python (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Integrity | Unexpected State | - |

## Potential mitigations

### Architecture and Design (Input Validation)

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

### Implementation (Input Validation)

Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.

When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."

Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.

### Implementation (Input Validation)

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

## Detection methods

### Automated Static Analysis

Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

## Demonstrative examples

### Example 1

Windows provides the MultiByteToWideChar(), WideCharToMultiByte(), UnicodeToBytes(), and BytesToUnicode() functions to convert between arbitrary multibyte (usually ANSI) character strings and Unicode (wide character) strings. The size arguments to these functions are specified in different units, (one in bytes, the other in characters) making their use prone to error.

Bad code:

```c
void getUserInfo(char *username, struct _USER_INFO_2 info){
    WCHAR unicodeUser[UNLEN+1];
    MultiByteToWideChar(CP_ACP, 0, username, -1, unicodeUser, sizeof(unicodeUser));
    NetUserGetInfo(NULL, unicodeUser, 2, (LPBYTE *)&info);
}
```

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2000-0884 | Server allows remote attackers to read documents outside of the web root, and possibly execute arbitrary commands, via malformed URLs that contain Unicode encoded characters. |
| CVE-2001-0709 | Server allows a remote attacker to obtain source code of ASP files via a URL encoded with Unicode. |
| CVE-2001-0669 | Overlaps interaction error. |

## Real CVEs with this weakness (sample of 12 of 37)

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2024-43093 | Elevation of privilege in Framework | high | 7.0 | - | Yes | 2024-11-13 |
| CVE-2024-24691 | Zoom Desktop Client for Windows, Zoom VDI Client for Windows, and Zoom Meeting SDK for Windows - Improper Input Validation | critical | 9.8 | - | No | 2024-02-14 |
| CVE-2023-39213 | - | critical | 9.8 | - | No | 2023-08-08 |
| CVE-2025-71316 | SQLite sqldiff remote code execution via argument injection | critical | 9.2 | - | No | 2026-06-04 |
| CVE-2026-89074 | MOVEit Transfer Email MFA Bypass | high | 8.8 | - | No | 2026-10-14 |
| CVE-2026-23950 | node-tar has Race Condition in Path Reservations via Unicode Ligature Collisions on macOS APFS | high | 8.8 | - | No | 2026-01-20 |
| CVE-2026-93990 | Expat before 2.8.5 Malformed UTF-16 Acceptance via Unchecked Surrogate | high | 8.7 | - | No | 2026-09-19 |
| CVE-2026-48618 | A flaw in Node.js TLS hostname handling can cause Node.js unicode dot separator handling can lead... | high | 7.7 | - | No | 2026-06-26 |
| CVE-2026-110687 | Cpanel::JSON::XS versions from 4.43 before 4.80 for Perl misorder byte-string keys during canonical encoding in utf16\_cmp | high | 7.5 | - | No | 2026-10-19 |
| CVE-2026-7040 | Text::Minify::XS versions from 0.3.0 before 0.7.8 for Perl have heap overflow when processing some malformed UTF-8 characters | high | 7.5 | - | No | 2026-04-27 |
| CVE-2026-4116 | - | high | 7.2 | - | No | 2026-04-09 |
| CVE-2026-116542 | Netty netty-tcnative before 2.0.84.Final SNI Hostname Spoofing via Modified UTF-8 Decoding | medium | 6.9 | - | No | 2026-10-26 |

## Related attack patterns (CAPEC)

- [CAPEC-71](https://radicalnotion.ai/capec/capec-71): Using Unicode Encoding to Bypass Validation Logic

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-172](https://radicalnotion.ai/cwe/cwe-172) | Improper Encoding or Decoding of Data |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| PLOVER | Unicode Encoding | - | - |
| CERT C Secure Coding | Character Encoding - UTF8 Related Issues | MSC10-C | - |
| OpenSSF Secure Coding Guide for Python | Enforce Consistent Encoding | pyscg-0045 | - |

## Frequently asked questions

### What is CWE-176?

The product does not properly handle when an input contains Unicode encoding.

### What CVEs are caused by CWE-176?

37 recorded CVEs are attributed to CWE-176, including CVE-2024-43093, CVE-2024-24691 and CVE-2023-39213. 1 is listed in CISA's Known Exploited Vulnerabilities (KEV) catalog.

### How do you prevent CWE-176?

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

### How is CWE-176 detected?

Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

### What are the consequences of CWE-176?

Exploiting CWE-176 can lead to: Unexpected State.

### Is CWE-176 actively exploited?

Yes. 1 CWE-176 vulnerability is in CISA's KEV catalog of actively exploited flaws, out of 37 recorded CVEs.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/176.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-176). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
