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

  • Critical 9.3

    Orval: RCE via OpenAPI path -> unescaped request-URL template literal (backtick breakout)

    Orval generates type-safe JavaScript clients in TypeScript from OpenAPI v3 and Swagger v2 specifications. Prior to 8.21.0, an unescaped backtick in an OpenAPI path is emitted into request URL template literals generated for axios, fetch, react-query, and SWR …

  • Medium 6.3

    Forem: Stored XSS in Admin Abuse Report Rendering

    Forem is open source software for building communities. In versions before commit 92eacd16a82cf9007ba8e16a2258b42e3b53ca9c, a malicious value submitted through feedback_message[message] is stored without sanitization and rendered in app/views/admin/feedback_m…

  • Medium 6.3

    Link Header Directive Smuggling via Unescaped target/rel/Attribute Keys in cow_link:link/1

    Improper Encoding or Escaping of Output vulnerability in ninenines cowlib allows Link header directive smuggling via unescaped special characters in cow_link:link/1. cow_link:do_link/1 in cowlib interpolates the target URI, rel value, and attribute keys direc…

  • Medium 4.8

    Shescape before 2.1.15 and 3.0.2 Home Directory Disclosure via BusyBox

    Shescape before 2.1.15 (and 3.0.0 before 3.0.2) fails to properly escape tilde (~) characters in assignment contexts on Unix systems where the shell is explicitly configured to "sh" or true and /bin/sh points to BusyBox. Using the escape and escapeAll APIs wi…

  • High 8.6

    JupyterLab: Cross-site scripting (XSS) via crafted settings file (`overrides.json`)

    jupyterlab is an extensible environment for interactive and reproducible computing, based on the Jupyter Notebook Architecture. From 3.3.0 until 4.5.10 and 4.6.2, JupyterLab allows notebook settings to be shared and applied through an overrides.json file usin…

  • Medium 5.0

    dua-cli Terminal Escape Sequence Injection via Marked Paths

    dua-cli fails to filter terminal escape sequences when printing marked file paths after exiting the TUI interface. Attackers can craft file names containing OSC/CSI escape sequences that are interpreted by the terminal emulator when printed, enabling title sp…

  • Medium 5.0

    gdu Terminal Injection via Unstripped Escape Sequences

    gdu fails to strip terminal escape sequences from directory and file names when printing paths after TUI exit. Attackers can craft malicious directory or file names containing escape sequences that are interpreted by the terminal, enabling title spoofing, cli…

  • Low 3.4

    HCL AION is affected by multiple security vulnerabilities.

    HCL AION is affected by a vulnerability where certain input fields do not enforce sufficient server-side input validation. Unexpected or crafted input may be accepted by the application, potentially resulting in unintended behavior or security impact under ce…

  • Medium 6.3

    Shescape: Home-directory disclosure in assignment context on Unix with Dash

    Shescape is a simple shell escape library for JavaScript. Prior to 2.1.14 and 3.0.1, getEscapeFunction in src/internal/unix/dash.js fails to escape ~ after : or = when applications use the escape or escapeAll APIs on Unix with shell set to dash, or with shell…

  • Medium 5.4

    ColdFusion | Improper Encoding or Escaping of Output (CWE-116)

    is affected by an Improper Encoding or Escaping of Output vulnerability that could result in a Security feature bypass. A low-privileged attacker could leverage this vulnerability to bypass security measures and gain limited unauthorized write access, causing…

  • Medium 6.1

    SWC HTML minifier may allow script element breakout when minifying embedded JSON

    SWC is a TypeScript / JavaScript compiler written in Rust. Prior to @swc/html 1.15.47-nightly-20260729.1 and swc_html_minifier 59.0.0, the minifyJson processing in crates/swc_html_minifier/src/lib.rs parsed and serialized attacker-controlled JSON in applicati…

  • Medium 5.1

    cti-transmute Conversion Table Allows XSS via Unescaped Cell Content During Search Highlighting

    Affected versions of cti-transmute improperly handle conversion-table values passed through the search highlighting feature. The highlight() function previously returned the underlying text directly when no search query was supplied, or performed a regex repl…

  • Low 2.3

    cti-transmute Remote MISP Event Browser Allows Cross-Site Scripting via Malicious Event Metadata

    Affected versions of cti-transmute render data obtained from a remote MISP instance into the event-browser interface using HTML interpolation. Because fields such as event IDs, event information, organization names, tags, tag colors, TLP labels, distribution …

  • Medium 4.6

    Improper Output Encoding in GNU cpio

    GNU cpio is vulnerable to improper encoding or escaping of output in its archive member listing functionality. When listing archive members via cpio -it, member names are printed directly to output without quoting or escaping. An attacker can craft a cpio arc…

  • Medium 5.7

    Electron: DevTools JavaScript Injection via Unsanitized Dock State Parameter

    Electron is a framework for writing cross-platform desktop applications using JavaScript, HTML and CSS. Prior to 39.8.7, 40.9.0, 41.2.0, and 42.0.0-beta.1, the mode option of webContents.openDevTools() was not sanitized before use by the DevTools frontend. If…

  • Medium 6.5

    CentreStack < 17.4 Session Injection via SelectProvider.aspx

    CentreStack before 17.4 contains a session variable injection vulnerability that allows unauthenticated attackers to inject arbitrary session variables by embedding newline and tab characters into a crafted AccountName parameter posted to the SelectProvider.a…

  • Medium 6.3

    mathlive's Lack of Escaping of HTML allows for XSS

    MathLive provides web components for math display and input. Prior to 0.110.0, MathLive fails to escape text-mode content in \text{} and \mbox{} commands in Box.toMarkup at src/core/box.ts, in xmlEscape, scanText, and text-mode output in src/formats/atom-to-m…

  • Medium 4.8

    Terminal Escape Injection in diff‑so‑fancy

    diff‑so‑fancy does not properly sanitize non‑SGR terminal control sequences before outputting diff data. The application only strips ANSI SGR sequences while allowing other control characters, including carriage return (\r) and escape sequences (e.g., OSC, CS…

  • Medium 5.5

    nebula-mesh: Newly-minted operator API key exposed in redirect URL (Referer, history, proxy logs)

    nebula-mesh is a self-hosted control plane for Slack Nebula mesh virtual private network. Prior to version 0.3.2, newly-minted operator API key exposed in redirect URL (Referer, history, proxy logs). This issue has been patched in version 0.3.2.

  • Low 2.1

    Astro: Cross-site scripting via unescaped transition:* directive values on hydrated islands

    Astro is a web framework for content-driven websites. In versions 3.10.0 through 7.0.3, when a transition:persist, transition:scope, or transition:persist-props directive is applied to a client-hydrated (client:*) component, Astro copied the directive value o…

  • Medium 6.3

    Next.js: Response Body Cache Confusion with Invalid UTF-8 Request Bodies

    Next.js is a React framework for building full-stack web applications. In versions 12.0.0 through 15.5.20 and 16.0.0 through 16.2.10, a server-side fetch with a request body may return a cached response body from a different request to the same URL but differ…

  • Medium 5.7

    ImageMagick: Code injection in HTML encoder due to incomplete fix of CVE-2026-25797

    An incomplete fix of CVE-2026-25797 can result in code injection in the HTML encoder.

  • High 8.7

    Loytec LWEB802: Reflected Cross-Site Scripting in LWEB802

    Reflected Cross-Site Scripting (CWE-79) in LWEB802 in Loytec LWEB-802 before 5.0.8 on all platforms allows an unauthenticated remote attacker to execute arbitrary JavaScript in a victim's browser and perform actions with the victim's privileges via a crafted …

  • High 8.7

    Loytec LINX firmware: Unauthenticated stored XSS in OPC XML-DA server

    Stored Cross-Site Scripting (CWE-79) in the OPC XML-DA server statistics in Loytec LIP-ME201C, L-INX, L-GATE, L-ROC, L-IOB, L-DALI, L-VIS and L-PAD through 8.4.16 on LINX-A64 allows an unauthenticated remote attacker to execute arbitrary JavaScript in an admi…

  • Critical 9.1

    An issue was discovered in openRISC OR1200 commit 83ac6b. An output mismatch between the RTL and the netlist of the or1…

  • Medium 6.4

    remorses/genql code injection

    remorses/genql before version 6.3.4 allows an authenticated attacker with control of the GraphQL schema that is passed to genql to inject arbitrary JavaScript or TypeScript. The malicious code is injected into the generated schema.ts file and executes when th…

  • High 7.8

    Github.com/cri-o/cri-o: fix bypass for cve-2022-4318 — /etc/passwd injection via home env

    A flaw was found in CRI-O. The fix for a previous vulnerability (CVE-2022-4318) was incorrect, allowing it to be bypassed. An attacker capable of setting environment variables on a container can inject a newline character into the HOME environment variable. T…

  • High 7.8

    PraisonAI before 4.6.78 Code Injection via API deployment generator

    PraisonAI before 4.6.78 fails to safely encode deployment configuration values when generating Python source code for API servers. Attackers can inject arbitrary Python expressions through the deploy.api.host and agents_file configuration parameters that exec…

  • Medium 5.1

    Twig: HTML-output filters in twig/* extras incorrectly declared `is_safe => ['all']`

    Twig is a template language for PHP. Prior to 3.26.0, several filters in twig/markdown-extra and twig/cssinliner-extra are registered with is_safe => [all], causing Twig to treat plain text or HTML output as safe in HTML, JavaScript, CSS, URL, and other conte…

  • Medium 5.1

    Twig: The `spaceless` filter implicitly marks its output as safe

    Twig is a template language for PHP. Prior to 3.26.0, the deprecated spaceless filter is registered as safe for HTML, causing Twig autoescaping to emit attacker-controlled markup unescaped when spaceless is applied to untrusted input. This issue is fixed in v…

  • Critical 9.1

    Adobe Commerce | Improper Encoding or Escaping of Output (CWE-116)

    Adobe Commerce is affected by an Improper Encoding or Escaping of Output vulnerability that could result in arbitrary code execution in the context of the current user. An attacker with high privileges could exploit this vulnerability to execute arbitrary cod…

  • Medium 6.5

    .NET Spoofing Vulnerability

    Improper encoding or escaping of output in .NET allows an authorized attacker to perform spoofing over a network.

  • Low 3.5

    FacturaScripts: Stored XSS in WidgetVariante and WidgetSubcuenta modal lists via HTML-attribute decoding of `Tools::noHtml`-escaped quotes inside `onclick=`

    ## Summary `WidgetVariante::renderVariantList` (`Core/Lib/Widget/WidgetVariante.php:298-330`) and `WidgetSubcuenta::renderSubaccountList` (`Core/Lib/Widget/WidgetSubcuenta.php:290-321`) build the `<tr onclick="...">` row for each modal hit by concatenating th…

  • Medium 5.1

    HedgeDoc: Stored HTML injection via email local-part

    HedgeDoc is an open source, real-time, collaborative, markdown notes application. Prior to version 1.11.0, due to unsafe handling of the local-part of registered email addresses, HedgeDoc was vulnerable to stored HTML Injection through its publish and slide v…

  • High 7.5

    luci-app-banip Log Monitor IP Extraction Bypass

    luci-app-banip contains a log parsing vulnerability where the awk-based parser extracts the first IPv4 address from log lines regardless of field position, allowing attackers to inject arbitrary IPs via attacker-controlled fields like usernames. An unauthenti…

  • High 7.5

    PraisonAI before 4.6.78 Prompt Injection Defense Bypass

    PraisonAI versions before 4.6.78 contain a prompt injection defense misconfiguration where the block threshold defaults to CRITICAL severity, allowing HIGH-level threats to pass through unblocked. Attackers can submit single-vector prompt injection attacks su…

  • Medium 6.3
    CVE-2026-49844 Public exploit

    Apache Log4j API: Improper serialization of non-finite floating-point values in MapMessage.asJson()

    Improper encoding of non-finite floating-point values during MapMessage JSON serialization in Apache Log4j API produces output that is not valid JSON. This issue affects Apache Log4j API versions 2.13.1 through 2.25.4 and version 2.26.0. The fix for CVE-2026-…

  • High 7.7

    Grist: XSS through unsafe value interpolation in server-rendered pages

    Grist is spreadsheet software using Python as its formula language. Prior to 1.7.15, several server-rendered Grist pages embedded user-controlled values into the page and into inline scripts without fully escaping them, allowing cross-site scripting. On the m…

  • High 8.6

    SiYuan: Stored XSS to RCE in SiYuan via a per-attribute URL-scheme sanitizer gap in Lute (form action / SVG xlink:href)

    SiYuan is an open-source personal knowledge management system. Prior to 3.7.1, SiYuan renders note and package content to HTML through the Lute engine with sanitization enabled, but Lute's dangerous javascript scheme block does not check form action or SVG xl…

  • Medium 6.1

    Hono: Server-Side XSS via JSX Escaping Bypass in cx() Utility

    Hono is a Web application framework that provides support for any JavaScript runtime. From 4.0.0 before 4.12.27, cx() in hono/css composes class names from plain strings but marks the result as already escaped without HTML-escaping the input, allowing untrust…