CWE-838: Inappropriate Encoding for Output Context

15 CVEs have CWE-838 as their primary weakness. 0 of them are in the CISA KEV catalog. The highest EPSS score among them is 24.901%.

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.

Using the correct output encoding is essential for ensuring that communications between components are accurate. 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 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.

Child of CWE-116: Improper Encoding or Escaping of Output

Mitigations

Observed examples

Get more CVE data from the API.

Free without a key or signup. Pro adds monitoring and higher limits: pricing.

Sources