cve.bz

CAPEC-40

Manipulating Writeable Terminal Devices

Very High severityHigh likelihoodStandard pattern

This attack exploits terminal devices that allow themselves to be written to by other users. The attacker sends command strings to the target terminal device hoping that the target user will hit enter and thereby execute the malicious command with their privileges. The attacker can send the results (such as copying /etc/passwd) to a known directory and collect once the attack has succeeded.

On this page

Ask an AI about this attack pattern

Show the promptExplain the attack pattern CAPEC-40: Manipulating Writeable Terminal Devices: how it unfolds, what it needs and how to prevent and detect it in my systems. Use https://capec.mitre.org/data/definitions/40.html and https://cve.bz/cve/capec/40?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. [Identify attacker-writable terminals] Determine if users TTYs are writable by the attacker.

      2 techniques
      • Determine the permissions for the TTYs found on the system. Any that allow user write to the TTY may be vulnerable.
      • Attempt to write to other user TTYs. This approach could leave a trail or alert a user.
  2. Exploit

    They carry out the attack.

    1. [Execute malicious commands] Using one or more vulnerable TTY, execute commands to achieve various impacts.

      1 technique
      • Commands that allow reading or writing end user files can be executed.

Prerequisites

  • User terminals must have a permissive access control such as world writeable that allows normal users to control data on other user's terminals.

Skills required

  • Low skill

    Ability to discover permissions on terminal devices. Of course, brute force can also be used.

Resources required

  • Access to a terminal on the target network

Consequences

What a successful attack can lead to
ImpactAffectsNote
Gain PrivilegesConfidentiality, Access Control, Authorization
Read DataConfidentiality
Execute Unauthorized CommandsConfidentiality, Integrity, AvailabilityRun Arbitrary Code

Mitigations

  • Design: Ensure that terminals are only writeable by named owner user and/or administrator

  • Design: Enforce principle of least privilege

Weaknesses it exploits

  • CWE-77 Improper Neutralization of Special Elements used in a Command

Recent CVEs with these weaknesses

  1. 8.8CVE-2026-12573

    Zoho Corporation ManageEngine DDI Central versions 6200 and below are vulnerable to Cisco IOS command injection via DHCP pool name leading to arbitrary commands on managed Cisco routers.

  2. 8.0CVE-2026-95646

    Zoho Corporation ManageEngine DDI Central versions 6500 and below are vulnerable to a Unicode-based command injection vulnerability in the Cisco IOS DHCP configuration functionality. This vulnerability could allow cluster-scoped operators …

  3. 8.6CVE-2026-124585

    A vulnerability was found in Chengdu Feiyuxing Technology VW2100 and VEC10GP 1.0 B-MB3W202-210825-r11775. This issue affects the function add_expmac of the file var/html/webserver of the component Web Administration Interface. The manipula…

  4. 9.3CVE-2026-124580

    A vulnerability was found in Chengdu Feiyuxing Technology VW2100 and VEC10GP 1.0 B-MB3W202-210825-r11775. This impacts the function handle_wechat_cn_wifi of the file var/html/webserver of the component Weixin Auth Endpoint. The manipulatio…

  5. 8.8CVE-2026-116786

    FreeSWITCH is a Software Defined Telecom Stack enabling the digital transformation from proprietary telecom switches to a software implementation that runs on any commodity hardware. Prior to 1.11.2, sofia_handle_sip_i_refer() placed raw R…

  6. 9.8CVE-2026-116779

    FreeSWITCH is a Software Defined Telecom Stack enabling the digital transformation from proprietary telecom switches to a software implementation that runs on any commodity hardware. Prior to 1.11.3, sofia_presence_handle_sip_i_message() s…

  7. 8.8CVE-2026-82413

    ntopng is a web-based network traffic monitoring application. Prior to 6.7.260717, scripts/lua/rest/v2/add/host/to_scan.lua and scripts/lua/rest/v2/exec/host/schedule_vulnerability_scan.lua accept scan_ports from any authenticated session,…

  8. 5.5CVE-2026-123022

    A vulnerability was detected in agentscope-ai AgentScope up to 2.0.11. The impacted element is the function subprocess.Popen of the file src/agentscope/mcp/_config.py of the component MCP Workspace API. The manipulation of the argument com…

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

Part of

Examples

"Any system that allows other peers to write directly to its terminal process is vulnerable to this type of a…

"Any system that allows other peers to write directly to its terminal process is vulnerable to this type of attack. If the terminals are available through being over-privileged (i.e. world-writable) or the attacker is an administrator, then a series of commands in this format can be used to echo commands out to victim terminals.

"$echo -e "\033[30m\033\132" > /dev/ttyXX

where XX is the tty number of the user under attack. This will paste the characters to another terminal (tty). Note this technique works only if the victim's tty is world writable (which it may not be). That is one reason why programs like write(1) and talk(1) in UNIX systems need to run setuid." [REF-1]

If the victim continues to hit "enter" and execute the commands, there are an endless supply of vectors available to the attacker, copying files, open up network connections, ftp out to servers, and so on.

MITRE's words, unchanged: CAPEC-40 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.