/

CVE-2026-74997

Severity:

HIGH RISK

(8.8)

OS Command Injection (CWE-78) in Roundcube markasjunk

CVE-2026-74997

Analyzed

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Remote Code Execution

Severity:

HIGH RISK

(8.8)

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 high-severity OS command injection vulnerability in Roundcube's markasjunk plugin can allow remote code execution through crafted placeholder replacement values.

The issue becomes risky when a Roundcube instance uses the markasjunk plugin with its cmd_learn driver and processes attacker-influenced values.

Affected context

The vulnerability affects Roundcube deployments that:

  • Enable the markasjunk plugin
  • Configure the plugin to use the cmd_learn driver
  • Process crafted placeholder replacement values through that driver

Deployments that do not use the affected plugin and driver combination may not expose this specific attack path.

Exploit preconditions

  • Attack surface: Roundcube webmail functionality associated with the markasjunk plugin
  • Required access: A network-accessible Roundcube instance and whatever account or application interaction is required to reach the vulnerable plugin workflow
  • Trigger point: Processing placeholder replacement values by the cmd_learn driver
  • Why exploitation is possible: Attacker-influenced values may be incorporated into an operating-system command without adequate separation between data and command syntax

Why this happens

The underlying issue is an OS command injection flaw, mapped to CWE-78. The vulnerable driver appears to pass crafted replacement values into command execution logic without reliably treating those values as untrusted data.

This insecure pattern occurs when external input is concatenated into shell commands or otherwise reaches an interpreter without strict argument handling, contextual escaping, or a design that avoids shell execution altogether.

Potential impact

  • An attacker may execute arbitrary commands with the privileges of the Roundcube process.
  • The webmail application or its underlying host could be compromised.
  • Confidential email, configuration data, or credentials could be accessed or altered.
  • The compromised account or host could be used for further network activity.
  • Mail-processing workflows could be disrupted or manipulated.

General mitigation guidance

Mitigation generally focuses on removing shell interpretation from the command path and reducing trust in placeholder replacement values.

Common defensive patterns include:

  • Prefer direct process APIs with fixed executable paths and separately passed arguments.
  • Avoid constructing shell command strings from user-controlled or message-derived values.
  • Apply strict allowlist validation and type constraints to replacement values.
  • Use narrowly scoped, secure-by-default plugin configurations and disable unused command-based drivers.
  • Run webmail components with least privilege and isolate command execution from sensitive resources.
  • Enforce appropriate filesystem, process, and network restrictions around the application.

How teams detect issues like this

Organizations can look for this weakness through:

  • Static analysis rules identifying shell execution APIs, command-string construction, and interpolation of external values.
  • Code review checks for placeholder expansion near process-spawning or command execution functions.
  • Policy enforcement that blocks shell invocation when direct argument-based APIs are available.
  • Runtime monitoring for unexpected child processes, unusual command lines, or webmail workers accessing unrelated system resources.
  • Tests that supply malformed and boundary-case replacement values while verifying that no command interpretation occurs.

Automated security review tools may help identify command construction and unsafe data flows, but findings should be validated against the deployment's enabled plugin configuration.

Sources

SourceLink
github.comgithub.com/roundcube/roundcubemail/commit/14044f843cfacbe78b042f659e379d6b4497aa7c
github.comgithub.com/roundcube/roundcubemail/commit/495d211638f222336b20f4744545c53712426c2a
github.comgithub.com/roundcube/roundcubemail/commit/b8f90e28a46d42e79a69568cba897f8f4223d9cd
github.comgithub.com/roundcube/roundcubemail/releases/tag/1.6.18
github.comgithub.com/roundcube/roundcubemail/releases/tag/1.7.3
roundcube.netroundcube.net/news/2026/08/09/security-updates-1.6.18-and-1.7.3

Frequently asked

questions

It may be remotely exploitable against an accessible Roundcube deployment when the markasjunk plugin and its cmd_learn driver are enabled and the vulnerable workflow can be reached.

The exact access requirements depend on the deployment's authentication and plugin permissions. The key conditions are access to the relevant Roundcube functionality and processing of attacker-influenced replacement values.

Avoid shell command construction, use direct execution APIs with fixed arguments, and strictly validate any values that must be passed to an external process.

Minimize command-based integrations, enforce least privilege, review data flows into process-execution APIs, and use static analysis and runtime monitoring to detect unsafe command construction.

Find out what's already
exploitable in your codebase.