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

99 results · Feed

  • Medium 5.3

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

  • Low 2.2

    dysk before 3.8.2 Terminal Escape Sequence Injection via Mount Metadata

    Canop dysk before 3.8.2 contains a terminal escape sequence injection vulnerability that allows local users to inject control sequences by crafting mount metadata rendered unsanitized in table and CSV output. Attackers can create FUSE mounts with ESC/OSC sequ…

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

  • Low 2.5

    CUPS fax option values bypass the CVE-2026-34980 control-character sanitizer (incomplete fix)

    OpenPrinting CUPS is an open source printing system for Linux and other Unix-like operating systems. Prior to 2.4.20, the cupsdCreateJob option-string builder in scheduler/job.c maps attacker-controlled destination-uri and pre-dial-string values from a config…

  • Low 2.3

    Terminal escape sequence injection in Hex via unneutralized server-supplied output

    Improper Neutralization of Escape, Meta, or Control Sequences vulnerability in hexpm hex allows a malicious package publisher or a hostile repository server to inject terminal control sequences into the output of Mix tasks. Hex prints strings supplied by the …

  • High 8.4

    openapi-python-client: Malicious OpenAPI Documents can cause Arbitrary Code Generation

    openapi-python-client generates Python clients from OpenAPI documents. Prior to 0.29.1, the generator does not safely neutralize malicious OpenAPI document content before rendering string, docstring, and f-string contexts in generated Python. The generated Py…

  • High 7.8

    In Sapling SCM prior to v0.2.20260929-102736, control characters were allowed to be embedded in Git subtree URLs. A mal…

  • High 7.7

    Collectl: collectl: colmux does not sanitize ansi/vt100 terminal escape sequences in data received from remote collectl instances

    colmux in collectl before 4.3.20.2 does not sanitize ANSI/VT100 terminal escape sequences in data received from remote collectl instances before displaying it, allowing a local user on a monitored host to inject escape sequences into the terminal of an operat…

  • Low 3.5

    Flysystem: WhitespacePathNormalizer's control-character (CorruptedPathDetected) check is bypassed by malformed UTF-8 in the path, affecting every adapter

    Flysystem is an open source file storage library for PHP. Prior to 3.35.3, the default WhitespacePathNormalizer in src/WhitespacePathNormalizer.php used by Filesystem across adapters calls preg_match with the u modifier and treats both false and 0 as falsy. A…

  • Low 3.3

    onefetch through 2.28.1 Terminal Escape Sequence Injection

    onefetch through 2.28.1 writes repository information field values to the terminal without removing control characters, allowing terminal escape sequence injection. Attackers can embed ANSI/OSC escape sequences in project manifest version and name fields to m…

  • Low 3.3

    spaceship-prompt through 4.22.5 Terminal Escape Sequence Injection

    spaceship-prompt through 4.22.5 fails to sanitize control characters from project manifest version fields before rendering them in the zsh prompt. Attackers can embed ANSI/OSC escape sequences in version fields of package manifests to manipulate terminal outp…

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

  • High 8.4

    MISP Interactive CLI Shell: Authorization Bypass, Credential Exposure, and Terminal Injection

    Affected versions of MISP’s interactive CLI shell implement access control independently from the normal web application, causing several authorization inconsistencies. The patch shows that CLI access could differ from the web application in multiple security…

  • Low 3.2

    procs through 0.14.12 Terminal Escape Sequence Injection via Command

    procs through 0.14.12 fails to sanitize escape sequences in process command lines before displaying them in the Command column. Local attackers can execute processes with malicious ANSI or OSC escape sequences in their command line arguments, which are writte…

  • Low 2.3

    Terminal escape sequence injection in mix usage_rules.search_docs via package documentation metadata

    Improper Neutralization of Escape, Meta, or Control Sequences vulnerability in ash-project usage_rules allows a malicious package publisher to inject terminal control sequences into the output of mix usage_rules.search_docs. mix usage_rules.search_docs search…

  • Low 2.3

    Terminal escape sequence injection in the mix igniter.install confirmation prompt via package metadata

    Improper Neutralization of Escape, Meta, or Control Sequences vulnerability in ash-project igniter allows a malicious package publisher to forge the mix igniter.install confirmation prompt. mix igniter.install prints a confirmation panel (an anti-typosquattin…

  • High 8.8

    OpenAI Codex CLI for Windows, macOS, and Linux and Codex Desktop for Windows and macOS misclassified certain PowerShell…

  • High —

    pickem vulnerable to terminal escape-sequence injection via unsanitized item text

    ### Impact pickem rendered item text (label, description, group, meta, name) to the terminal with no control-character sanitization. `chrome.row` only stripped ANSI from the **active** row; inactive rows, the public `createFormatter`, and selection-summary li…

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

  • Low 3.3

    powerlevel10k Control Character Injection via package.json Version

    powerlevel10k fails to neutralize control characters in the package.json version field when rendering the package prompt segment. Attackers can inject raw escape bytes in the version string to emit arbitrary terminal control sequences on each prompt render wh…

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

  • Critical 9.2

    Shescape: Shell injection via unescaped parentheses on Windows with CMD

    Shescape is a simple shell escape library for JavaScript. Prior to 2.1.14 and 3.0.1, getEscapeFunction in src/internal/win/cmd.js does not escape `(` and `)` when applications use the escape or escapeAll APIs on Windows with shell set to cmd.exe, or with shel…

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

  • High 7.3

    Kitty: Command injection into the child shell via chained @kitty-echo + @kitty-ssh DCS escape sequences

    Kitty is a cross-platform GPU based terminal. Prior to 0.48.2, the @kitty-echo and @kitty-ssh DCS handlers in kitty/window.py write unauthenticated data to the child shell's stdin, where handle_remote_echo accepts printable shell command characters and handle…

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

  • High 7.1

    SQL injection in syslog-ng SQL destionation driver

    Due to a missing sanitization call in [`afsql_dd_run_query`](https://github.com/syslog-ng/syslog-ng/blob/649e6e18e3459fb4467000a88dfb12fa97f9719c/modules/afsql/afsql.c#L219), syslog-ng before 4.12 are vulnerable to SQL injection from an untrusted source. This…

  • Critical 9.6

    OpenWrt odhcpd/LuCI: unauthenticated DHCPv6 client can inject lease-file lines via FQDN hostname → stored XSS in the LuCI admin UI

    OpenWrt is a Linux operating system targeting embedded devices. Prior to 25.12.5, odhcpd writes a DHCPv6 client FQDN option 39 hostname into /tmp/odhcpd.leases through src/statefiles.c statefiles_write_state6() and statefiles_write_state4() without escaping, …

  • High 7.5

    App::Ack versions through 3.10.0 for Perl print unsanitised terminal escape sequences from filenames in several output modes

    App::Ack versions through 3.10.0 for Perl print unsanitised terminal escape sequences from filenames in several output modes. When ack prints a filename whose basename contains terminal control bytes such as ANSI escape sequences, those bytes reach the termin…

  • Critical 9.1

    Net::Statsite::Client versions through 1.1.0 for Perl allow metric injections

    Net::Statsite::Client versions through 1.1.0 for Perl allow metric injections. Net::Statsite::Client is a client for the statsite protocol, which is a variant of statsd. Newlines are not removed from metric names, allowing metric injections. Values are not sa…

  • High 7.3

    Kitty vulnerable to command injection via unsanitized OSC 21 query reply

    Kitty is a cross-platform GPU based terminal. In versions prior to 0.47.3, kitty's OSC 21 (color-control) query reply reflects attacker-controlled bytes, including newlines, into the shell's input without sanitization. Version 0.47.3 fixes the issue.

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

  • Critical 9.1

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

    Metrics::Any::Adapter::DogStatsd 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::DogSt…

  • High 8.2

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

    Metrics::Any::Adapter::Statsd versions before 0.04 for Perl does not protect against metric injections. The statsd protocol (and extensions) allow mutiple metrics, separated by newlines, to be sent per packet. The send method does not validate the contents of…

  • Critical 9.8

    DataDog::DogStatsd versions through 0.07 for Perl allow metric injections from event tags

    DataDog::DogStatsd versions through 0.07 for Perl allow metric injections from event tags. DataDog::DogStatsd does not properly sanitise input, allowing metric injections of data from untrusted sources. The format_event method (used by the event method) does …

  • Critical 9.1

    DataDog::DogStatsd versions through 0.07 for Perl allow metric injections

    DataDog::DogStatsd versions through 0.07 for Perl allow metric injections. DataDog::DogStatsd does not properly sanitise input, allowing metric injections of data from untrusted sources. The send_stats method does not remove newlines from metric names ($stat …

  • High 7.5

    Etsy::StatsD versions through 1.002002 for Perl allow metric injections

    Etsy::StatsD versions through 1.002002 for Perl allow metric injections. The metric names and values are not checked for newlines, colons or pipes. Metrics generated from untrusted sources could inject additional statsd metrics. Note that the git repository c…

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