CWE · MITRE source
CWE-838Inappropriate Encoding for Output Context
The product uses or specifies an encoding when generating output to a downstream component, but the specified encoding is not the same as the encoding that is expected by the downstream component.
This weakness can cause the downstream component to use a decoding method that produces different data than what the product intended to send. When the wrong encoding is used - even if closely related - the downstream component could decode the data incorrectly. This can have security consequences when the provided boundaries between control and data are inadvertently broken, because the resulting data could introduce control characters or special elements that were not sent by the product. The resulting data could then be used to bypass protection mechanisms such as input validation, and enable injection attacks. While using output encoding is essential for ensuring that communications between components are accurate, the use of the wrong encoding - even if closely related - could cause the downstream component to misinterpret the output. For example, HTML entity encoding is used for elements in the HTML body of a web page. However, a programmer might use entity encoding when generating output for that is used within an attribute of an HTML tag, which could contain functional Javascript that is not affected by the HTML encoding. While web applications have received the most attention for this problem, this weakness could potentially apply to any type of product that uses a communications stream that could support multiple encodings.
Last updated: 14 October 2026 20:41 UTC
Control responseHuman-reviewed
Answering this weakness across the control lifecycle, from our framework cross-walks.
NIST 800-53 r5 controls PROPOSED for this weakness (0)AI-assisted
These are model PROPOSALS, not graded mappings. They come
from controls_to_cwe_proposals, which carries no grade field at
all; across the CWE pages 1,540 of 1,722 such associations (89%) have never
been graded by anything. The heading said “address” until
2026-09-29, which asserted a relationship the data does not carry.
Graded cross-walks are on the framework map, not here.
| Control | Title | Family | Why it addresses this CWE |
|---|---|---|---|
| No NIST controls proposed yet. | |||
Top CVEs of this weakness type, ranked by Risk Priority
| CVE | Risk | CVSS | EPSS | Published |
|---|---|---|---|---|
CVE-2019-18981 UPD | 7.6 | 9.8 | 0.0139 | 2019-11-15 |
CVE-2025-4052 UPD | 7.3 | 9.8 | 0.0054 | 2025-05-05 |
CVE-2019-6110 UPD | 6.7 | 6.8 | 0.2490 | 2019-01-31 |
CVE-2020-10996 UPD | 6.4 | 8.1 | 0.0154 | 2020-04-27 |
CVE-2024-11702 UPD | 5.9 | 7.5 | 0.0053 | 2024-11-26 |
CVE-2018-9862 UPD | 5.8 | 7.8 | 0.0042 | 2018-04-09 |
CVE-2023-6512 UPD | 5.4 | 6.5 | 0.0128 | 2023-12-06 |
CVE-2026-55858 UPD | 4.8 | 5.9 | 0.0087 | 2026-08-28 |
CVE-2026-55859 UPD | 4.7 | 5.9 | 0.0049 | 2026-08-28 |
CVE-2023-5770 UPD | 4.4 | 5.3 | 0.0034 | 2024-01-09 |
CVE-2020-7292 UPD | 3.9 | 4.3 | 0.0086 | 2020-07-15 |
CVE-2023-3735 UPD | 3.8 | 4.3 | 0.0058 | 2023-08-01 |
CVE-2024-34006 UPD | 3.7 | 4.3 | 0.0035 | 2024-05-31 |
CVE-2020-29135 UPD | 3.5 | 4.1 | 0.0058 | 2020-11-27 |