---
title: "CWE-173: Improper Handling of Alternate Encoding"
url: https://radicalnotion.ai/cwe/cwe-173
type: cwe
description: "The product 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."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-173: Improper Handling of Alternate Encoding

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

## Description

The product 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.

## Modes of introduction

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

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Access Control | Bypass Protection Mechanism | - |

## 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 (Output Encoding)

Use and specify an output encoding that can be handled by the downstream component that is reading the output. Common encodings include ISO-8859-1, UTF-7, and UTF-8. When an encoding is not specified, a downstream component may choose a different encoding, either by assuming a default encoding or automatically inferring which encoding is being used, which can be erroneous. When the encodings are inconsistent, the downstream component might treat some character or byte sequences as special, even if they are not special in the original encoding. Attackers might then be able to exploit this discrepancy and conduct injection attacks; they even might be able to bypass protection mechanisms that assume the original encoding is also being used by the downstream component.

### 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.

## Real CVEs with this weakness

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2019-9636 | python: Information Disclosure due to urlsplit improper NFKC normalization | critical | 9.8 | - | No | 2019-03-08 |
| CVE-2026-10050 | Digest authentication lossy encoding | high | 8.7 | - | No | 2026-08-04 |
| CVE-2026-19611 | Wildfly-elytron: org.wildfly.security/wildfly-elytron-password-impl: wildfly-elytron: password keyspace reduction via nfkc fullwidth folding | high | 7.4 | - | No | 2026-08-20 |
| CVE-2023-26303 | markdown-it-py crash on null assertions | high | 7.1 | - | No | 2023-02-22 |
| CVE-2023-26302 | markdown-it-py CLI crash on invalid UTF-8 characters | high | 7.1 | - | No | 2023-02-22 |
| CVE-2026-103276 | Ghost before 6.20.0 File Read via URL Encoding Bypass | medium | 6.9 | - | No | 2026-10-01 |
| CVE-2023-25742 | Mozilla: Web Crypto ImportKey crashes tab | medium | 6.5 | - | No | 2023-06-02 |
| CVE-2024-54158 | - | medium | 5.3 | - | No | 2024-12-04 |
| CVE-2026-81638 | Non-canonical ULID spellings are accepted and alias to the same record in ash\_double\_entry | low | 2.1 | - | No | 2026-09-07 |

## Related attack patterns (CAPEC)

- [CAPEC-120](https://radicalnotion.ai/capec/capec-120): Double Encoding
- [CAPEC-267](https://radicalnotion.ai/capec/capec-267): Leverage Alternate Encoding
- [CAPEC-3](https://radicalnotion.ai/capec/capec-3): Using Leading 'Ghost' Character Sequences to Bypass Input Filters
- [CAPEC-4](https://radicalnotion.ai/capec/capec-4): Using Alternative IP Address Encodings
- [CAPEC-52](https://radicalnotion.ai/capec/capec-52): Embedding NULL Bytes
- [CAPEC-53](https://radicalnotion.ai/capec/capec-53): Postfix, Null Terminate, and Backslash
- [CAPEC-64](https://radicalnotion.ai/capec/capec-64): Using Slashes and URL Encoding Combined to Bypass Validation Logic
- [CAPEC-71](https://radicalnotion.ai/capec/capec-71): Using Unicode Encoding to Bypass Validation Logic
- [CAPEC-72](https://radicalnotion.ai/capec/capec-72): URL Encoding
- [CAPEC-78](https://radicalnotion.ai/capec/capec-78): Using Escaped Slashes in Alternate Encoding
- [CAPEC-79](https://radicalnotion.ai/capec/capec-79): Using Slashes in Alternate Encoding
- [CAPEC-80](https://radicalnotion.ai/capec/capec-80): Using UTF-8 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 |
| Can precede | [CWE-289](https://radicalnotion.ai/cwe/cwe-289) | Authentication Bypass by Alternate Name |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| PLOVER | Alternate Encoding | - | - |

## Frequently asked questions

### What is CWE-173?

The product 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.

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

9 recorded CVEs are attributed to CWE-173, including CVE-2019-9636, CVE-2026-10050 and CVE-2026-19611.

### How do you prevent CWE-173?

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

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

Exploiting CWE-173 can lead to: Bypass Protection Mechanism.

### Is CWE-173 actively exploited?

9 recorded CVEs are caused by CWE-173; none are currently in CISA's KEV catalog of actively exploited flaws.

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

---

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