Join our Newsletter — 33% off our NHI Course
Home› FAQ› Threats, Abuse & Incident Response› What happens when users open attacker-controlled logs in…
Threats, Abuse & Incident Response

What happens when users open attacker-controlled logs in a vulnerable web terminal?

← Back to all FAQ
By NHI Mgmt Group Editorial Team Updated September 27, 2026 Domain: Threats, Abuse & Incident Response

When a vulnerable terminal renders attacker-controlled log content, the content can be interpreted as control data instead of plain text. That can trigger a chain from log viewing to command execution on the viewer’s machine. In the worst case, sensitive material such as SSH keys can be read and exfiltrated through a crafted command embedded in the displayed text.

How attacker-controlled logs become code execution

The core failure is that the web terminal treats log text as something it should render or process, rather than as inert output. Once a malicious line is displayed inside an execution-capable interface, the boundary between “viewing logs” and “issuing commands” can collapse. At that point, the attacker is no longer depending on the log file itself, but on the terminal’s unsafe interpretation of what it shows.

This is why the issue is more serious than a simple log injection problem. The viewer becomes the execution surface. In a vulnerable implementation, a crafted sequence can influence the terminal session, trigger shell behavior, or cause the browser or terminal client to hand control to embedded control data instead of preserving plain text semantics.

What the attacker gains beyond the first command

Once code execution occurs on the viewer’s machine, the attacker may be able to chain that access into local discovery, credential theft, or lateral movement. If the user who opened the log has SSH keys, session tokens, or other secrets accessible in their environment, a malicious command hidden in the displayed content can read and exfiltrate them. The exposure is often much larger than the terminal session that was initially opened.

The practical danger depends on the viewer’s privilege level, the terminal’s isolation, and whether the workstation can reach sensitive systems. A low-privilege desktop may still expose browser sessions, cloud credentials, or development keys; an administrative workstation can expose far more. The attacker does not need the log to be “interactive” in the normal sense, only to be interpreted in a way that creates execution paths.

Why this pattern is easy to miss in web terminals

Web terminals and log viewers often optimize for convenience, not strict output safety. That means developers may allow rich formatting, terminal control sequences, hyperlinks, or copy-paste friendly rendering without fully accounting for hostile content. If the product does not neutralize control characters and does not preserve a hard text-only boundary, an attacker can turn an ordinary operational workflow into an execution channel.

For teams handling operational logs, the important distinction is whether the viewer is a passive renderer or an active interpreter. A passive renderer shows text safely. An active interpreter may process escape sequences, shell-like constructs, or content that the user can inadvertently execute. That difference determines whether the attack stops at visual deception or becomes full workstation compromise.

Risk and Threat Considerations

This attack path is especially dangerous because it couples trusted operational content with a privileged viewing context. Logs are often opened by administrators, engineers, or responders, which makes them attractive for attackers who want to pivot from a harmless-looking message into execution on a higher-value endpoint.

Failure mechanism: The terminal fails to enforce a strict text-only rendering boundary, so attacker-controlled content is interpreted as control data or executable input when the user opens the log.

Impact: The attacker can trigger commands on the viewer’s machine, then use that foothold to read secrets, steal sessions, or move further into the environment.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

MITRE ATT&CK addresses the attack and risk surface, while CIS Controls v8, NIST SP 800-53 Rev 5 and OWASP ASVS set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
MITRE ATT&CKT1059 — Command and Scripting InterpreterLog injection becomes dangerous when displayed content can trigger command execution.
Recommendation — Detect and block command-injection paths that let untrusted content execute in a terminal session.
CIS Controls v8CIS-4 — Secure Configuration of Enterprise Assets and SoftwareSafe terminal rendering depends on hardened client and viewer configuration.
Recommendation — Harden terminal and log-viewer settings to prevent control-sequence execution.
NIST SP 800-53 Rev 5SI-10 — Information Input ValidationUntrusted log content must be treated as hostile input before rendering or interpretation.
Recommendation — Validate and sanitize log content before any terminal or browser rendering.
OWASP ASVSV16 — Security Logging and Error HandlingThe issue arises in security-relevant logging and how output is handled safely.
Recommendation — Ensure logging and log-display paths preserve output integrity and do not execute content.

Practitioner Guidance

What to verify: Confirm that the log pipeline strips or neutralizes terminal control sequences, HTML-like payloads, and any content that the web terminal could interpret as input rather than display. Test with hostile samples, not just benign logs, and validate behavior in the exact client version users actually run.

What good looks like: A user can open an untrusted log without any possibility of command execution, clipboard manipulation, or secret leakage from the viewing session. If the platform cannot guarantee that, treat log viewing as a potentially executable action and constrain who can access it.

Practitioner takeaway: The security boundary must sit between untrusted log content and the terminal interpreter, not after the content has already reached a privileged viewing session.

Deepen Your Knowledge

Sign up to our weekly newsletter — get 33% off our NHI Foundation Level Course

    NHIMG Editorial Note
    Reviewed and updated by the NHIMG editorial team on September 27, 2026.
    NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org