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

502 results · Feed

  • High 7.5

    Denial of Service (DoS) vulnerability in the DMS module. Successful exploitation of this vulnerability will affect avai…

  • Critical 9.3

    Django Template Engine Vulnerable to XSS

    This package provides universal methods to use multiple template engines with the Fiber web framework using the Views interface. This vulnerability specifically impacts web applications that render user-supplied data through this template engine, potentially …

  • Medium 5.3

    lockss-daemon (aka Classic LOCKSS Daemon) before 1.77.3 performs post-Unicode normalization, which may allow bypass of …

  • 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…

  • Low 3.3

    IBM QRadar WinCollect Agent improper output encoding

    IBM QRadar WinCollect Agent 10.0 through 10.1.7 could allow a local user to perform unauthorized actions due to improper encoding. IBM X-Force ID: 248160.

  • Critical 9.8

    An issue was discovered in MISP before 2.4.176. app/Controller/Component/IndexFilterComponent.php does not properly fil…

  • Medium 4.9
    CVE-2023-5968 Public exploit

    Password hash in response body after username update

    Mattermost fails to properly sanitize the user object when updating the username, resulting in the password hash being included in the response body. 

  • Medium 5.4

    HTML and SMTP Injection in LiquidFiles

    HTML and SMTP injections on the registration page of LiquidFiles versions 3.7.13 and below, allow an attacker to perform more advanced phishing attacks against an organization.

  • Critical 9.1

    XWiki users can be tricked to execute scripts as the create page action doesn't display the page's title

    XWiki Platform is a generic wiki platform offering runtime services for applications built on top of it. In `org.xwiki.platform:xwiki-platform-web` versions 7.2-milestone-2 until 14.10.12 and `org.xwiki.platform:xwiki-platform-web-templates` prior to versions…

  • Medium 6.5

    React Developer Tools extension Improper Authorization vulnerability

    The React Developer Tools extension registers a message listener with window.addEventListener('message', <listener>) in a content script that is accessible to any webpage that is active in the browser. Within the listener is code that requests a URL derived f…

  • 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.8

    Croc sender may place ANSI or CSI escape sequences in filename to attach receiver's terminal device

    An issue was discovered in Croc through 9.6.5. A sender may place ANSI or CSI escape sequences in a filename to attack the terminal device of a receiver.

  • Low 3.0

    Cross-Site Scripting Vulnerability in Wing FTP Server <= 7.2.0

    Improper encoding or escaping of output in Wing FTP Server (User Web Client) allows Cross-Site Scripting (XSS).This issue affects Wing FTP Server: <= 7.2.0.

  • Medium 5.7

    XSS in Chrome Lab Critters

    Critters versions 0.0.17-0.0.19 have an issue when parsing the HTML, which leads to a potential cross-site scripting (XSS) bug. We recommend upgrading to version 0.0.20 of the extension. 

  • Unscored —

    Docker Machine through 0.16.2 allows an attacker, who has control of a worker node, to provide crafted version data, wh…

  • Unscored —

    Vulnerability of input parameter verification in certain APIs in the window management module. Successful exploitation …

  • Unscored —

    Vulnerability of input parameters being not strictly verified in the PMS module. Successful exploitation of this vulner…

  • Unscored —

    Input verification vulnerability in the audio module. Successful exploitation of this vulnerability may cause virtual m…

  • Unscored —

    Input verification vulnerability in the storage module. Successful exploitation of this vulnerability may cause the dev…

  • High 8.6

    Improper input validation in some firmware for Intel(R) AMT and Intel(R) Standard Manageability before versions 11.8.94…

  • Medium 5.3

    OpenZeppelin Contracts's ERC2771Context with custom forwarder may lead to zero-valued _msgSender

    OpenZeppelin Contracts is a library for secure smart contract development. Starting in version 4.0.0 and prior to version 4.9.3, contracts using `ERC2771Context` along with a custom trusted forwarder may see `_msgSender` return `address(0)` in calls that orig…

  • High 8.3

    PrestaShop XSS vulnerability through Validate::isCleanHTML method

    PrestaShop is an open source e-commerce web application. Versions prior to 1.7.8.10, 8.0.5, and 8.1.1 are vulnerable to cross-site scripting through the `isCleanHTML` method. Versions 1.7.8.10, 8.0.5, and 8.1.1 contain a patch. There are no known workarounds.

  • Unscored —

    Interactive Forms (IAF) in GX Software XperienCentral versions 10.33.1 until 10.35.0 was vulnerable to invalid data inp…

  • High 8.6

    Envoy vulnerable to OAuth2 credentials exploit with permanent validity

    Envoy is an open source edge and service proxy designed for cloud-native applications. Prior to versions 1.27.0, 1.26.4, 1.25.9, 1.24.10, and 1.23.12, a malicious client is able to construct credentials with permanent validity in some specific scenarios. This…

  • Medium 5.3

    Forwarded header exploit with Spring HATEOAS on WebFlux

    Reactive web applications that use Spring HATEOAS to produce hypermedia-based responses might be exposed to malicious forwarded headers if they are not behind a trusted proxy that ensures correctness of such headers, or if they don't have anything else in pla…

  • Critical 9.1

    Improper Encoding or Escaping of Output in froxlor/froxlor

    Improper Encoding or Escaping of Output in GitHub repository froxlor/froxlor prior to 2.0.21.

  • Critical 9.8

    Controller stack overflow when decoding messages from the server

    Controller DoS due to stack overflow when decoding a message from the server.  See Honeywell Security Notification for recommendations on upgrading and versioning.

  • Medium 4.1

    Improper Encoding or Escaping of Output in GitLab

    An issue has been discovered in GitLab CE/EE affecting all versions starting from 7.14 before 15.11.10, all versions starting from 16.0 before 16.0.6, all versions starting from 16.1 before 16.1.1, which allows an attacker to inject HTML in an email address f…

  • High 7.6

    Improper Encoding or Escaping of Output in nilsteampassnet/teampass

    Improper Encoding or Escaping of Output in GitHub repository nilsteampassnet/teampass prior to 3.0.10.

  • Low 3.1

    Discourse's canonical url not being used for topic embeddings

    Discourse is an open source discussion platform. Prior to version 3.0.4 of the `stable` branch and version 3.1.0.beta5 of the `beta` and `tests-passed` branches, multiple duplicate topics could be created if topic embedding is enabled. This issue is patched i…

  • Low 3.5

    Improper Encoding or Escaping of Output in nilsteampassnet/teampass

    Improper Encoding or Escaping of Output in GitHub repository nilsteampassnet/teampass prior to 3.0.9.

  • High 8.8

    An attacker could have caused memory corruption and a potentially exploitable use-after-free of a pointer in a global o…

  • High 8.8

    Firefox did not properly handle downloads of files ending in <code>.desktop</code>, which can be interpreted to run att…

  • Medium 5.5

    WebAssembly wat2wasm v1.0.32 allows attackers to cause a libc++abi.dylib crash by putting '@' before a quote (").

  • Critical 9.1
    CVE-2023-32071 EPSS 70%

    XWiki Platform vulnerable to RXSS via editor parameter - importinline template

    XWiki Platform is a generic wiki platform. Starting in versions 2.2-milestone-1 and prior to versions 14.4.8, 14.10.4, and 15.0-rc-1, it's possible to execute javascript with the right of any user by leading him to a special URL on the wiki targeting a page w…

  • Low 3.0

    Mutagen list and monitor operations do not neutralize control characters in text controlled by remote endpoints

    Mutagen provides real-time file synchronization and flexible network forwarding for developers. Prior to versions 0.16.6 and 0.17.1 in `mutagen` and prior to version 0.17.1 in `mutagen-compose`, Mutagen `list` and `monitor` commands are susceptible to control…

  • High 7.2

    Stored XSS affecting the AcyMailing plugin for Joomla

    AnyMailing Joomla Plugin is vulnerable to stored cross site scripting (XSS) in templates and emails of AcyMailing, exploitable without authentication when access is granted to the campaign's creation on front-office. This issue affects AnyMailing Joomla Plugi…

  • Critical 9.8

    ConEmu through 220807 and Cmder before 1.3.21 report the title of the terminal, including control characters, which all…

  • Critical 9.8
    CVE-2022-42948 Exploited

    Cobalt Strike 4.7.1 fails to properly escape HTML tags when they are displayed on Swing components. By injecting crafte…

    KEV Mar 30, 2023
  • Medium 5.0

    Flatpak metadata with ANSI control codes can cause misleading terminal output

    Flatpak is a system for building, distributing, and running sandboxed desktop applications on Linux. In versions prior to 1.10.8, 1.12.8, 1.14.4, and 1.15.4, if an attacker publishes a Flatpak app with elevated permissions, they can hide those permissions fro…