Skip to content
OpenAdvisories

Weakness (CWE)

CWE-150: Improper Neutralization of Escape, Meta, or Control Sequences

Variant Incomplete

The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as escape, meta, or control character sequences when they are sent to a downstream component.

How to prevent it (6 mitigations)
  1. Developers should anticipate that escape, meta and control characters/sequences will be injected/removed/manipulated in the input vectors of their product. Use an appropriate combination of denylists and allowlists to ensure only valid, expected and appropriate input is processed by the system.

  2. Implementation

    Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.

    When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."

    Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.

  3. Implementation

    While it is risky to use dynamically-generated query strings, code, or commands that mix control and data together, sometimes it may be unavoidable. Properly quote arguments and escape any special characters within those arguments. The most conservative approach is to escape or filter all characters that do not pass an extremely strict allowlist (such as everything that is not alphanumeric or white space). If some special characters are still needed, such as white space, wrap each argument in quotes after the escaping/filtering step. Be careful of argument injection (CWE-88).

  4. Implementation

    Inputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked.

  5. Implementation

    When using output from an LLM, neutralize
    or strip escape codes before redirecting output to the
    terminal or other rendering engine that would process
    the codes. The neutralization could require that the
    character be printable and/or allowable whitespace, such
    as a carriage return or newline. Be deliberate about
    what to allow.

  6. Build and Compilation

    When using an LLM: during tokenizer
    training, suppress escape codes from the tokenizer's
    vocabulary. Depending on context, this could be
    accomplished by removing the codes from input to the
    tokenizer, or removing the map from the string to its
    token ID. It is generally unlikely that this removal
    would adversely affect the quality or correctness of
    what is generated, e.g. advice requests for terminal
    settings to change colors.

Source: MITRE CWE-150

30 results · Clear filters · Feed

  • Medium 5.3

    compose-lint: Compose file text can issue GitHub Actions workflow commands through the compose-lint Action

    compose-lint is a Docker Compose security linter that identifies dangerous misconfigurations before deployment. Prior to 0.31.0, compose-lint prints attacker-controlled service names, environment keys, file lines, and other Compose text without neutralizing G…

  • Medium 5.3

    In JetBrains IntelliJ IDEA before 2026.3 command execution was possible via control characters in terminal command comp…

  • Medium 4.7

    Ember: Unneutralised terminal escape/control sequences from Caddy logs injected into the operator's TUI

    Ember is a real-time terminal dashboard for Caddy servers with FrankenPHP support. Prior to 1.4.2, interactive TUI row formatters pass Caddy access-log fields, particularly the request URI, through the `fitCellLeft` render helper without neutralizing terminal…

  • Medium 5.3

    Mesop: Unauthenticated ANSI Escape Sequence Injection in CSP Reporting Endpoint

    Mesop is a Python-based UI framework that allows users to build web applications. Prior to 1.3.4, the unauthenticated /__csp__ endpoint passes attacker-controlled document-uri, blocked-uri, and violated-directive values to the csp_report handler in mesop/serv…

  • Medium 4.6

    broot Terminal Escape Sequence Injection via Unsanitized File and Directory Names in the Tree View

    broot renders each file and directory name in its interactive tree view exactly as read from the filesystem. Names are converted with a plain to_string_lossy() call in src/tree_build/builder.rs and in TreeLine::unprune in src/tree/tree_line.rs, and no control…

  • Medium 6.1

    Oh My Posh: Terminal escape sequence injection via unsanitized prompt segment data

    Oh My Posh is the most customisable and low-latency cross platform/shell prompt renderer. Prior to 29.35.1, write(s rune) in src/terminal/writer.go emitted attacker-controlled current directory names and Git metadata, including Commit.Subject, Commit.Author.N…

  • Medium 4.4

    Bash-it barbuk Theme 3.2.0 Terminal Escape Sequence Injection via pyproject.toml

    Bash-it 3.2.0 contains a terminal escape sequence injection vulnerability in the barbuk theme's Python virtualenv prompt segment that allows local attackers to inject arbitrary terminal control sequences by embedding escape sequences in the requires-python fi…

  • Medium 4.3

    npm-check-updates 23.0.2 Terminal Injection via Unsanitized Escape Sequences

    npm-check-updates through 23.0.2, fixed in commit b554b84, contains a terminal escape sequence injection vulnerability that allows an attacker to embed arbitrary terminal control characters in a dependency's package.json homepage or repository URL fields. Whe…

  • Medium 5.3

    GitHub CLI: Terminal escape sequence injection in multiple `gh` commands

    GitHub CLI (gh) is GitHub's official command line tool. Prior to version 2.97.0, multiple GitHub CLI commands printed externally controlled gist, API, pull request, release, codespace, skill, or agent-task content without neutralizing terminal escape sequence…

  • Medium 6.5

    Metrics::Any::Adapter::SignalFx versions before 0.04 for Perl does not protect against metric injections

    Metrics::Any::Adapter::SignalFx versions before 0.04 for Perl does not protect against metric injections. The statsd protocol (and extensions such as dogstatsd) allow mutiple metrics, separated by newlines, to be sent per packet. Metrics::Any::Adapter::Signal…

  • Medium 5.3

    Net::Statsd versions before 0.13 for Perl allow metric injections

    Net::Statsd versions before 0.13 for Perl allow metric injections. The metric names are not checked for newlines, colons or pipes. Metrics generated from untrusted sources could inject additional statsd metrics. The update_stats (used for updating counters) a…

  • Medium 6.5

    Net::Async::Statsd::Client versions through 0.005 for Perl allow metric injections

    Net::Async::Statsd::Client versions through 0.005 for Perl allow metric injections. The metric names are not checked for newlines, colons or pipes. Metrics generated from untrusted sources could inject additional statsd metrics.

  • Medium 5.3

    Mojolicious::Plugin::Statsd versions through 0.04 for Perl allowed metric injections

    Mojolicious::Plugin::Statsd versions through 0.04 for Perl allowed metric injections. The metric names and set values were not checked for newlines, colons or pipes. Metrics generated from untrusted sources could inject additional statsd metrics. Version 0.06…

  • Medium 4.6

    Claude HUD 0.0.12 Terminal Injection via OSC 8 Hyperlinks

    Claude HUD through 0.0.12, patched in commit 234d9aa, constructs OSC 8 terminal hyperlink escape sequences using raw cwd and branchUrl values without stripping control characters or encoding embedded values, allowing attackers to inject arbitrary ANSI codes i…

  • Medium 6.5

    Net::Statsd::Lite versions before 0.9.0 for Perl allowed metric injections

    Net::Statsd::Lite versions before 0.9.0 for Perl allowed metric injections. The metric names were not checked for newlines, colons or pipes. Metrics generated from untrusted sources could inject additional statsd metrics.

  • Medium 6.5

    In KDE KCoreAddons before 6.25, KShell::quoteArgs is intended to safely quote arguments so that they can be passed to a…

  • Medium 4.3

    OpenClaw 2026.2.13 < 2026.3.25 - ANSI Escape Sequence Injection in Approval Prompt

    OpenClaw versions 2026.2.13 through 2026.3.24 contain an ANSI escape sequence injection vulnerability in approval prompts that allows attackers to spoof terminal output. Untrusted tool metadata can carry ANSI control sequences into approval prompts and permis…

  • Medium 5.6

    QuRouter

    An improper neutralization of escape, meta, or control sequences vulnerability has been reported to affect QHora. If a local attacker gains an administrator account, they can then exploit the vulnerability to cause unexpected behavior. We have already fixed t…

  • Medium 6.9

    Inspektor Gadget uses unsanitized ANSI Escape Sequences In `columns` Output Mode

    Inspektor Gadget is a set of tools and framework for data collection and system inspection on Kubernetes clusters and Linux hosts using eBPF. String fields from eBPF events in columns output mode are rendered to the terminal without any sanitization of contro…

  • Medium 5.3
    CVE-2026-23829 Public exploit

    Mailpit has SMTP Header Injection via Regex Bypass

    Mailpit is an email testing tool and API for developers. Prior to version 1.28.3, Mailpit's SMTP server is vulnerable to Header Injection due to an insufficient Regular Expression used to validate `RCPT TO` and `MAIL FROM` addresses. An attacker can inject ar…

  • Medium 6.5

    Apache HTTP Server: CGI environment variable override

    Improper Neutralization of Escape, Meta, or Control Sequences vulnerability in Apache HTTP Server through environment variables set via the Apache configuration unexpectedly superseding variables calculated by the server for CGI programs. This issue affects A…

  • Medium 4.6

    Soft Serve does not sanitize ANSI escape sequences in user input

    Soft Serve is a self-hostable Git server for the command line. In versions prior to 0.10.0, there are several places where the user can insert data (e.g. names) and ANSI escape sequences are not being removed, which can then be used, for example, to show fake…

  • Medium 5.4

    gurk (aka gurk-rs) mishandles ANSI escape sequences

    gurk (aka gurk-rs) through 0.6.3 mishandles ANSI escape sequences.

  • Medium 6.3

    MongoDB Shell may be susceptible to control character injection via pasting

    The MongoDB Shell may be susceptible to control character injection where an attacker with control of the user’s clipboard could manipulate them to paste text into mongosh that evaluates arbitrary code. Control characters in the pasted text can be used to obf…

  • Medium 6.1

    HTML templates containing Javascript template strings are subject to XSS in jte

    jte (Java Template Engine) is a secure and lightweight template engine for Java and Kotlin. In affected versions Jte HTML templates with `script` tags or script attributes that include a Javascript template string (backticks) are subject to XSS. The `javaScri…

  • Medium 6.5

    Python-sql: python-sql unary operators does not escape non-expression

    A vulnerability was found in python-sql where unary operators do not escape non-Expression.

  • Medium 5.4

    Jinja has a sandbox breakout through malicious filenames

    Jinja is an extensible templating engine. In versions on the 3.x branch prior to 3.1.5, a bug in the Jinja compiler allows an attacker that controls both the content and filename of a template to execute arbitrary Python code, regardless of if Jinja's sandbox…

  • Medium 6.5

    Shescape on Windows escaping may be bypassed in threaded context

    shescape is simple shell escape library for JavaScript. This may impact users that use Shescape on Windows in a threaded context. The vulnerability can result in Shescape escaping (or quoting) for the wrong shell, thus allowing attackers to bypass protections…

  • Medium 5.9

    Rancher/Wrangler: Denial of service when processing Git credentials

    A Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') vulnerability in SUSE Rancher allows remote attackers to cause denial of service by supplying specially crafted git credentials. This issue affects: SUSE Ranc…

  • Medium 6.8

    Control character injection in console output

    go-ipfs is an open-source golang implementation of IPFS which is a global, versioned, peer-to-peer filesystem. In go-ipfs before version 0.8.0, control characters are not escaped from console output. This can result in hiding input from the user which could r…