/

CVE-2026-119586

Severity:

HIGH RISK

(7.8)

Command Injection (CWE-77) in SQLite .recover Shell

CVE-2026-119586

Analyzed

Vulnerability type

Category:

Command Injection

CWE:

CWE-77

Impact:

Operating System Command Execution

Severity:

HIGH RISK

(7.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

SQLite's command-line shell can emit attacker-controlled dot-commands from database schema content when processing the .recover command. If a victim pipes that output into sqlite3, the embedded commands may execute operating system commands with the victim process's privileges.

SQLite's command-line shell can emit attacker-controlled dot-commands from database schema content when processing the .recover command. If a victim pipes that output into sqlite3, the embedded commands may execute operating system commands with the victim process's privileges.

Affected context

The issue occurs in SQLite command-line shell versions through 3.54.1 when the .recover command processes a database containing attacker-controlled sqlite_schema.sql values. Risk depends on a workflow that treats .recover output as executable sqlite3 input, rather than reviewing or sanitizing the generated text first.

The issue occurs in SQLite command-line shell versions through 3.54.1 when the .recover command processes a database containing attacker-controlled sqlite_schema.sql values. Risk depends on a workflow that treats .recover output as executable sqlite3 input, rather than reviewing or sanitizing the generated text first.

Exploit preconditions

  • Attack surface: SQLite command-line shell recovery workflow
  • Required access: Ability to provide or cause the victim to open a crafted SQLite database
  • Trigger point: The victim runs .recover and pipes its output into sqlite3
  • Why exploitation is possible: Schema text is emitted verbatim, allowing

attacker-planted dot-commands to be interpreted by the receiving shell

  • Execution context: Commands run with the privileges of the process

consuming the recovery output

  • Attack surface: SQLite command-line shell recovery workflow
  • Required access: Ability to provide or cause the victim to open a crafted SQLite database
  • Trigger point: The victim runs .recover and pipes its output into sqlite3
  • Why exploitation is possible: Schema text is emitted verbatim, allowing

attacker-planted dot-commands to be interpreted by the receiving shell

  • Execution context: Commands run with the privileges of the process

consuming the recovery output

Why this happens

The .recover implementation treats content derived from sqlite_schema.sql as trusted output even though database files may be attacker-controlled. Because SQLite shell dot-commands are directives rather than ordinary SQL, emitting them without neutralization can cause a downstream sqlite3 process to interpret attacker-supplied text as shell instructions. This is command injection under CWE-77, caused by mixing untrusted data with an executable command language.

The .recover implementation treats content derived from sqlite_schema.sql as trusted output even though database files may be attacker-controlled. Because SQLite shell dot-commands are directives rather than ordinary SQL, emitting them without neutralization can cause a downstream sqlite3 process to interpret attacker-supplied text as shell instructions. This is command injection under CWE-77, caused by mixing untrusted data with an executable command language.

Potential impact

  • An attacker may execute operating system commands as the victim user
  • The attacker could read, modify, or delete accessible files
  • The vulnerable workflow may lead to credential or data exposure
  • A compromised account or host could be used for further attacks
  • An attacker may execute operating system commands as the victim user
  • The attacker could read, modify, or delete accessible files
  • The vulnerable workflow may lead to credential or data exposure
  • A compromised account or host could be used for further attacks

General mitigation guidance

Mitigation generally focuses on treating recovery output as untrusted data

rather than executable input.

Common defensive patterns include:

  • Avoiding direct piping of .recover output into an SQLite shell
  • Reviewing and sanitizing generated recovery text before execution
  • Using recovery workflows that separate data from shell directives
  • Running database inspection and recovery in an isolated, least-privileged environment
  • Restricting access to untrusted database files and applying appropriate file permissions
  • Disabling unnecessary shell-command capabilities in controlled execution environments

Mitigation generally focuses on treating recovery output as untrusted data

rather than executable input.

Common defensive patterns include:

  • Avoiding direct piping of .recover output into an SQLite shell
  • Reviewing and sanitizing generated recovery text before execution
  • Using recovery workflows that separate data from shell directives
  • Running database inspection and recovery in an isolated, least-privileged environment
  • Restricting access to untrusted database files and applying appropriate file permissions
  • Disabling unnecessary shell-command capabilities in controlled execution environments

How teams detect issues like this

Detection approaches may include:

  • Static analysis and code review for direct piping of database recovery output into command interpreters
  • Searching scripts and operational documentation for automated .recover | sqlite3 workflows
  • Monitoring recovery output for unexpected dot-commands such as .shell or .system
  • Applying policy controls that prohibit execution of generated database or migration text without review
  • Using automated security review tools to flag data flowing from untrusted database files into command-capable parsers

Detection approaches may include:

  • Static analysis and code review for direct piping of database recovery output into command interpreters
  • Searching scripts and operational documentation for automated .recover | sqlite3 workflows
  • Monitoring recovery output for unexpected dot-commands such as .shell or .system
  • Applying policy controls that prohibit execution of generated database or migration text without review
  • Using automated security review tools to flag data flowing from untrusted database files into command-capable parsers

Sources

SourceLink
abraxaslabs.techabraxaslabs.tech/research/sqlite-cli-recover
github.comgithub.com/sqlite/sqlite
github.comgithub.com/sqlite/sqlite/blob/version-3.54.1/ext/recover/sqlite3recover.c#L1221-L1223
github.comgithub.com/sqlite/sqlite/blob/version-3.54.1/src/shell.c.in#L7877-L7891
vulncheck.comvulncheck.com/advisories/sqlite-cli-through-3.54.1-command-injection-via-recover-output

Frequently asked

questions

The vulnerability is not necessarily a network-level issue. Exploitation generally

requires getting a victim or an automated process to open a crafted database and

execute or pipe the resulting .recover output.

The attacker needs a way to supply or influence the database file used by the

recovery workflow. Authentication requirements depend on how that file is obtained

and who operates the SQLite shell.

Do not treat .recover output from an untrusted database as executable sqlite3

input. Review and sanitize the output, or use a recovery process that keeps

database content separate from shell directives.

Maintain clear trust boundaries between database content and command interpreters,

restrict recovery tooling privileges, isolate untrusted files, and enforce code

review or policy checks for pipelines that execute generated text.

The vulnerability is not necessarily a network-level issue. Exploitation generally

requires getting a victim or an automated process to open a crafted database and

execute or pipe the resulting .recover output.

The attacker needs a way to supply or influence the database file used by the

recovery workflow. Authentication requirements depend on how that file is obtained

and who operates the SQLite shell.

Do not treat .recover output from an untrusted database as executable sqlite3

input. Review and sanitize the output, or use a recovery process that keeps

database content separate from shell directives.

Maintain clear trust boundaries between database content and command interpreters,

restrict recovery tooling privileges, isolate untrusted files, and enforce code

review or policy checks for pipelines that execute generated text.

Find out what's already
exploitable in your codebase.