/

CVE-2026-81698

Severity:

HIGH RISK

(7.5)

Command Injection (CWE-78) in openssl_encrypt CLI Tool

CVE-2026-81698

Analyzed

Vulnerability type

Category:

Command Injection

CWE:

CWE-78

Impact:

Arbitrary Command Execution

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A shell injection vulnerability in the openssl_encrypt info command causes untrusted metadata to be inserted into a reconstructed CLI command without appropriate quoting. An attacker who can influence metadata may cause shell commands to execute when a user copies and runs the displayed command.

Affected context

The vulnerability occurs in openssl_encrypt versions that reconstruct and print a command-line invocation from metadata fields. It becomes risky when an attacker can supply or influence fields such as pepper_name and a user trusts the generated CLI block enough to copy it into a shell. The issue depends on shell interpretation of the displayed command rather than automatic execution merely from viewing the output.

Exploit preconditions

  • Attack surface: The info command's reconstructed CLI output
  • Required access: Ability to create or modify metadata consumed by the command
  • Trigger point: A user copies the printed CLI block into a shell
  • Why exploitation is possible: Untrusted metadata is interpolated without shell-safe quoting, allowing shell syntax to be interpreted by the user's command interpreter

Why this happens

The underlying bug is improper neutralization of externally controlled input before it is embedded in a shell command. Metadata values are treated as ordinary arguments during command reconstruction, but the resulting text is later interpreted by a shell. This behavior maps to CWE-78, Improper Neutralization of Special Elements used in an OS Command, because shell metacharacters and command syntax are not safely constrained or escaped.

Potential impact

  • An attacker may execute arbitrary commands with the privileges of the user running the copied command.
  • Local files, credentials, or environment variables could be exposed.
  • The affected workstation or automation environment could be modified or compromised.
  • Downstream scripts or operational workflows could be disrupted.

General mitigation guidance

Mitigation generally focuses on avoiding shell-interpreted command reconstruction for untrusted data. Secure-by-default alternatives include representing commands as structured argument arrays, invoking processes without an intermediate shell, and applying context-aware quoting when displaying commands for human use. Input trust should be reduced through strict metadata schemas, allowlisted values, and validation before rendering. Generated command output should be treated as advisory rather than inherently safe, and execution should use least-privilege accounts with restricted filesystem, network, and credential access.

How teams detect issues like this

Static analysis can flag string interpolation, concatenation, or formatting operations that place metadata into shell commands or executable CLI text. Code review should examine command reconstruction, quoting boundaries, and whether process APIs invoke a shell unnecessarily. Policy enforcement can require structured process arguments, prohibit shell execution for attacker-influenced values, and scan generated output paths for unsafe metacharacter handling. Automated security review tools may help identify these patterns during development.

Sources

SourceLink
github.comgithub.com/jahlives/openssl_encrypt/security/advisories/GHSA-gw2m-mj6q-59hc
vulncheck.comvulncheck.com/advisories/openssl-encrypt-before-1.4.9-shell-injection-via-info-command

Frequently asked

questions

Not by itself. Exploitation generally requires an attacker to influence

metadata and a user or automation process to copy and execute the generated

CLI text.

The attacker needs a way to create or modify metadata read by the info

command. The exact access path depends on how metadata is stored and shared.

Avoid constructing shell commands as interpolated strings. Use structured

argument lists and process execution APIs that do not invoke a shell; when

displaying commands, apply correct shell-specific quoting.

Treat metadata as untrusted input, validate it against an allowlist or strict

schema, minimize shell usage, and run affected workflows with least

privilege.

Find out what's already
exploitable in your codebase.