cve.bz

CAPEC-3

Using Leading 'Ghost' Character Sequences to Bypass Input Filters

Medium severityMedium likelihoodDetailed pattern

Some APIs will strip certain leading characters from a string of parameters. An adversary can intentionally introduce leading "ghost" characters (extra characters that don't affect the validity of the request at the API layer) that enable the input to pass the filters and therefore process the adversary's input. This occurs when the targeted API will accept input data in several syntactic forms and interpret it in the equivalent semantic way, while the filter does not take into account the full spectrum of the syntactic forms acceptable to the targeted API.

On this page

Ask an AI about this attack pattern

Show the promptExplain the attack pattern CAPEC-3: Using Leading 'Ghost' Character Sequences to Bypass Input Filters: how it unfolds, what it needs and how to prevent and detect it in my systems. Use https://capec.mitre.org/data/definitions/3.html and https://cve.bz/cve/capec/3?via=ask-ai-copy, which lists recent CVEs with the weaknesses it exploits. Cite the sources.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this attack pattern's id and public links.

How the attack unfolds

  1. Explore

    The attacker looks for a way in.

    1. [Survey the application for user-controllable inputs] Using a browser, an automated tool or by inspecting the application, an adversary records all entry points to the application.

      4 techniques
      • Use a spidering tool to follow and record all links and analyze the web pages to find entry points. Make special note of any links that include parameters in the URL.
      • Use a proxy tool to record all user input entry points visited during a manual traversal of the web application.
      • Use a browser to manually explore the website and analyze how it is constructed. Many browsers' plugins are available to facilitate the analysis or automate the discovery.
      • Manually inspect the application to find entry points.
  2. Experiment

    They probe what they found.

    1. [Probe entry points to locate vulnerabilities] The adversary uses the entry points gathered in the "Explore" phase as a target list and injects various leading 'Ghost' character sequences to determine how to application filters them.

      2 techniques
      • Add additional characters to common sequences such as "../" to see how the application will filter them.
      • Try repeating special characters (?, @, #, *, etc.) at the beginning of user input to see how the application filters these out.
  3. Exploit

    They carry out the attack.

    1. [Bypass input filtering] Using what the adversary learned about how the application filters input data, they craft specific input data that bypasses the filter. This can lead to directory traversal attacks, arbitrary shell command execution, corruption of files, etc.

Prerequisites

  • The targeted API must ignore the leading ghost characters that are used to get past the filters for the semantics to be the same.

Skills required

  • Medium skill

    The ability to make an API request, and knowledge of "ghost" characters that will not be filtered by any input validation. These "ghost" characters must be known to not affect the way in which the request will be interpreted.

Consequences

What a successful attack can lead to
ImpactAffectsNote
Gain PrivilegesConfidentiality, Access Control, Authorization
Modify DataIntegrity

Mitigations

  • Use an allowlist rather than a denylist input validation.

  • Canonicalize all data prior to validation.

  • Take an iterative approach to input validation (defense in depth).

Weaknesses it exploits

  • CWE-20 Improper Input Validation
  • CWE-41 Improper Resolution of Path Equivalence
  • CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component
  • CWE-172 Improper Encoding or Decoding of Data
  • CWE-173 Improper Handling of Alternate Encoding
  • CWE-179 Incorrect Behavior Order: Early Validation
  • CWE-180 Incorrect Behavior Order: Validate Before Canonicalize
  • CWE-181 Incorrect Behavior Order: Validate Before Filter
  • CWE-183 Permissive List of Allowed Inputs
  • CWE-184 Incomplete List of Disallowed Inputs
  • CWE-697 Incorrect Comparison
  • CWE-707 Improper Neutralization

Recent CVEs with these weaknesses

  1. 9.6CVE-2026-108186

    Improper Input Validation in Zoom Workplace for Windows may allow an unauthenticated user to conduct an escalation of privilege via network access.

  2. 4.9CVE-2026-105427

    Improper input validation in Ivanti EPMM before version 12.10.0.1, 12.9.0.3, and 12.8.0.5 allows a remote authenticated attacker with admin privileges to permanently disable all Apache HTTPS services resulting in denial of service.

  3. 6.7CVE-2026-105426

    Improper input validation in Ivanti EPMM before version 12.10.0.1, 12.9.0.3, and 12.8.0.5 allows a remote authenticated attacker with admin privileges to set arbitrary Linux kernel parameters as root.

  4. 4.3CVE-2026-123178

    An insufficient input validation vulnerability in the listed NETGEAR Orbi Models router allows an authenticated administrator connected to the local network to execute unauthorized commands and modify the router’s software and functionalit…

  5. 7.0CVE-2026-16478

    Permissive list of allowed inputs vulnerability in TÜBİTAK BİLGEM Software Technologies Research Institute pardus-nvidia-installer allows Privilege Escalation. This issue affects pardus-nvidia-installer: before 2.0.1.

  6. 6.3CVE-2026-125871

    The sourcecache expansion module in MISP Modules (misp-modules) contains a Server-Side Request Forgery (SSRF) vulnerability. When a user with permission to create or modify attributes of type 'link' or 'url' submits an attribute value, the…

  7. 5.5CVE-2026-125703

    A flaw was found in the GStreamer gst-plugins-bad MXF plugin. Insufficient bounds checks when parsing crafted VANC data can cause an out-of-bounds read in the demuxer, while an incorrect buffer size calculation when muxing multiple ancilla…

  8. 7.7CVE-2026-125368

    OmniAgent through commit 12b98c5 contains an approval bypass vulnerability in ReflexionAgent._is_safe_bash_command that treats any command starting with find as safe without inspecting -execdir arguments. Prompt-injected agents can run fin…

The newest records naming one of them. Each weakness's page lists them all.

Part of

Examples

Alternate Encoding with Ghost Characters in FTP and Web Servers

Alternate Encoding with Ghost Characters in FTP and Web Servers

Some web and FTP servers fail to detect prohibited upward directory traversals if the user-supplied pathname contains extra characters such as an extra leading dot. For example, a program that will disallow access to the pathname "../test.txt" may erroneously allow access to that file if the pathname is specified as ".../test.txt". This attack succeeds because 1) the input validation logic fails to detect the triple-dot as a directory traversal attempt (since it isn't dot-dot), 2) some part of the input processing decided to strip off the "extra" dot, leaving the dot-dot behind.

Using the file system API as the target, the following strings are all equivalent to many programs:

.../../../test.txt
............/../../test.txt
..?/../../test.txt
..????????/../../test.txt
../test.txt

As you can see, there are many ways to make a semantically equivalent request. All these strings ultimately result in a request for the file ../test.txt.

MITRE's words, unchanged: CAPEC-3 at MITRE. CAPEC is Copyright © 2007–2026, The MITRE Corporation, used under the CAPEC terms of use: “The MITRE Corporation (MITRE) hereby grants you a non-exclusive, royalty-free license to use Common Attack Pattern Enumeration and Classification (CAPEC™) for research, development, and commercial purposes. Any copy you make for such purposes is authorized provided that you reproduce MITRE’s copyright designation and this license in any such copy.” CAPEC and the CAPEC logo are trademarks of The MITRE Corporation. Credits. All attack patterns.