Cyber Resilience

CWE · MITRE source

CWE-838Inappropriate Encoding for Output Context

Abstraction: Base · CVEs in our corpus: 12

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: 04 July 2026 00:28 UTC

Cumulative inbound coverage

How completely the frameworks we cross-walk collectively cover this — the verdict is the strongest single mapping (overlapping partials are not summed); breadth shows the corroboration behind it.

Collective: full · 7 mapping(s) from 3 framework(s): ASVS 5.0 4 (full) · ATT&CK 2 (partial) · CAPEC 1 (partial)

See the full cumulative-coverage rollup →

NIST 800-53 r5 controls that address this weakness (0)AI

Control Title Family Why it addresses this CWE
No NIST controls proposed yet.

MITRE ATT&CK techniques this weakness enables

Our own two-way CWE↔ATT&CK cross-walk — a direct mapping with no public source (the CWE→CAPEC→ATT&CK chain leaves most top weaknesses, incl. XSS and SQLi, mapped to nothing). Drafted by Grok and spot-checked by Claude Opus 4.8.

Direction: other covers this; this covers other (F/M/P = full / mostly / partial).

Top CVEs of this weakness type, ranked by Risk Priority

CVE Risk CVSS EPSS Published
CVE-2019-189817.09.80.01392019-11-15
CVE-2025-4052 UPD7.09.80.00582025-05-05
CVE-2019-61106.06.80.20912019-01-31
CVE-2018-98625.57.80.00452018-04-09
CVE-2020-109965.58.10.01502020-04-27
CVE-2024-117025.57.50.00542024-11-26
CVE-2020-72923.54.30.00862020-07-15
CVE-2020-291353.54.10.00572020-11-27
CVE-2023-37353.54.30.00572023-08-01
CVE-2023-65123.56.50.01292023-12-06
CVE-2023-57703.55.30.00342024-01-09
CVE-2024-340063.54.30.00352024-05-31