Skip to content
OpenAdvisories

Weakness (CWE)

CWE-116: Improper Encoding or Escaping of Output

Class Draft

The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.

How to prevent it (7 mitigations)
  1. Architecture and Design

    Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid.

    For example, consider using the ESAPI Encoding control [REF-45] or a similar tool, library, or framework. These will help the programmer encode outputs in a manner less prone to error.

    Alternately, use built-in functions, but consider using wrappers in case those functions are discovered to have a vulnerability.

  2. Architecture and Design

    If available, use structured mechanisms that automatically enforce the separation between data and code. These mechanisms may be able to provide the relevant quoting, encoding, and validation automatically, instead of relying on the developer to provide this capability at every point where output is generated.

    For example, stored procedures can enforce database query structure and reduce the likelihood of SQL injection.

  3. Architecture and Design, Implementation

    Understand the context in which your data will be used and the encoding that will be expected. This is especially important when transmitting data between different components, or when generating outputs that can contain multiple encodings at the same time, such as web pages or multi-part mail messages. Study all expected communication protocols and data representations to determine the required encoding strategies.

  4. Architecture and Design

    In some cases, input validation may be an important strategy when output encoding is not a complete solution. For example, you may be providing the same output that will be processed by multiple consumers that use different encodings or representations. In other cases, you may be required to allow user-supplied input to contain control information, such as limited HTML tags that support formatting in a wiki or bulletin board. When this type of requirement must be met, use an extremely strict allowlist to limit which control sequences can be used. Verify that the resulting syntactic structure is what you expect. Use your normal encoding methods for the remainder of the input.

  5. Architecture and Design

    Use input validation as a defense-in-depth measure to reduce the likelihood of output encoding errors (see CWE-20).

  6. Requirements

    Fully specify which encodings are required by components that will be communicating with each other.

  7. Implementation

    When exchanging data between components, ensure that both components are using the same character encoding. Ensure that the proper encoding is applied at each interface. Explicitly set the encoding you are using whenever the protocol allows you to do so.

Source: MITRE CWE-116

13 results · Clear filters · Feed

  • High 7.8
    CVE-2026-20245 Exploited Public exploit EPSS 25%

    Cisco Catalyst SD-WAN Controller Authenticated Privilege Escalation Vulnerability

    A vulnerability in the CLI of Cisco Catalyst SD-WAN Controller, formerly SD-WAN vSmart, Cisco Catalyst SD-WAN Manager, formerly SD-WAN vManage, and Cisco Catalyst SD-WAN Validator, formerly SD-WAN vBond, could allow an authenticated, local attacker to execute…

    KEV Jun 9, 2026
  • High 8.6
    CVE-2025-66024 Public exploit

    XWiki Blog Application home page vulnerable to Stored XSS via Post Title

    The XWiki blog application allows users of the XWiki platform to create and manage blog posts. Versions starting with 9.15 and prior to 9.15.7 are vulnerable to Stored Cross-Site Scripting (XSS) via the Blog Post Title. The vulnerability arises because the po…

  • High 8.1
    CVE-2026-25940 Public exploit

    jsPDF's PDF Injection in AcroForm module allows Arbitrary JavaScript Execution (RadioButton.createOption and "AS" property)

    jsPDF is a library to generate PDFs in JavaScript. Prior to 4.2.0, user control of properties and methods of the Acroform module allows users to inject arbitrary PDF objects, such as JavaScript actions. If given the possibility to pass unsanitized input to on…

  • High 8.1
    CVE-2026-25755 Public exploit

    jsPDF has PDF Object Injection via Unsanitized Input in addJS Method

    jsPDF is a library to generate PDFs in JavaScript. Prior to 4.2.0, user control of the argument of the `addJS` method allows an attacker to inject arbitrary PDF objects into the generated document. By crafting a payload that escapes the JavaScript string deli…

  • High 8.3
    CVE-2025-55903 Public exploit

    A HTML injection vulnerability exists in Perfex CRM v3.3.1. The application fails to sanitize user input in the "Bill T…

  • High 7.2
    CVE-2025-60787 Public exploit EPSS 18%

    motionEye vulnerable to RCE via unsanitized motion config parameter

    MotionEye v0.43.1b4 and before is vulnerable to OS Command Injection in configuration parameters such as image_file_name. Unsanitized user input is written to Motion configuration files, allowing remote authenticated attackers with admin access to achieve cod…

  • High 7.5
    CVE-2024-52005 Public exploit

    The sideband payload is passed unfiltered to the terminal in git

    Git is a source code management tool. When cloning from a server (or fetching, or pushing), informational or error messages are transported from the remote Git process to the client via the so-called "sideband channel". These messages will be prefixed with "r…

  • High 7.8
    CVE-2024-34739 Public exploit

    In shouldRestrictOverlayActivities of UsbProfileGroupSettingsManager.java, there is a possible escape from SUW due to a…

  • High 8.1
    CVE-2024-38473 Public exploit EPSS 26%

    Apache HTTP Server proxy encoding problem

    Encoding problem in mod_proxy in Apache HTTP Server 2.4.59 and earlier allows request URLs with incorrect encoding to be sent to backend services, potentially bypassing authentication via crafted requests. Users are recommended to upgrade to version 2.4.60, w…

  • High 8.2
    CVE-2023-45539 Public exploit

    HAProxy before 2.8.2 accepts # as part of the URI component, which might allow remote attackers to obtain sensitive inf…

  • High 8.1
    CVE-2022-4137 Public exploit

    Keycloak: reflected xss attack

    A reflected cross-site scripting (XSS) vulnerability was found in the 'oob' OAuth endpoint due to incorrect null-byte handling. This issue allows a malicious link to insert an arbitrary URI into a Keycloak error page. This flaw requires a user or administrato…

  • High 7.5
    CVE-2022-30781 Public exploit EPSS 88%

    Shell command injection in gitea

    Gitea before 1.16.7 does not escape git fetch remote.

  • High 7.5
    CVE-2020-13654 Public exploit

    Improper escaping in XWiki Platform

    XWiki Platform before 12.8 mishandles escaping in the property displayer.