/

CVE-2022-51019

Severity:

HIGH RISK

(8.8)

OS Command Injection (CWE-78) in Akaunting Module Flow

CVE-2022-51019

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Arbitrary Command 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

Akaunting before 2.1.31 contains an operating system command injection vulnerability in its module installation and update workflow. An authenticated user with administrative panel access may manipulate the module alias parameter to execute arbitrary commands on the server.

Affected context

The vulnerability occurs in Akaunting's module installation and update flow when the alias parameter is incorporated into shell command execution without adequate validation or safe argument handling. Exploitation generally requires access to the administrative panel and the ability to submit or influence module-related requests.

Exploit preconditions

  • Attack surface: Administrative module installation or update functionality
  • Required access: An authenticated account with administrative panel privileges
  • Trigger point: Processing of the module alias parameter during a module operation
  • Why exploitation is possible: The alias value reaches shell command execution without sufficient validation, allowing shell metacharacters to alter command interpretation

Why this happens

The underlying flaw is the construction or invocation of operating system commands using attacker-influenced input. When a user-controlled alias is passed to a shell without strict validation, safe argument separation, or equivalent command APIs, shell metacharacters may be interpreted as control syntax rather than data. This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command.

Potential impact

  • An attacker may execute arbitrary commands under the privileges of the Akaunting service
  • The application server could be modified, disrupted, or used to access sensitive data
  • Credentials, configuration files, and other hosted application data could be exposed
  • The compromised server could be used for persistence or further network activity

General mitigation guidance

Mitigation generally focuses on removing shell interpretation from module operations and reducing trust in administrative input.

Common defensive patterns include:

  • Using direct process or library APIs that pass arguments without invoking a shell
  • Applying strict allowlists for module aliases and canonical module identifiers
  • Separating validation, normalization, and command execution logic
  • Rejecting unexpected characters and enforcing bounded input formats
  • Running the application with the minimum filesystem and operating-system privileges required
  • Restricting administrative functionality and protecting it with strong authentication and authorization controls

How teams detect issues like this

Organizations can look for this vulnerability class through:

  • Static analysis rules that identify shell execution APIs receiving request parameters
  • Code review checks for string concatenation or interpolation in command construction
  • Runtime monitoring of child-process creation by the web application
  • Web and application logs containing unusual module alias values or unexpected administrative operations
  • Policy enforcement that prohibits shell invocation for routine module-management tasks

Automated security review tools may help identify command execution paths that consume untrusted input.

Sources

SourceLink
github.comgithub.com/akaunting/akaunting
github.comgithub.com/akaunting/akaunting/blob/2.1.30/app/Jobs/Install/FinishUpdate.php#L45-L47
github.comgithub.com/akaunting/akaunting/blob/2.1.30/app/Jobs/Install/InstallModule.php#L37-L39
github.comgithub.com/akaunting/akaunting/commit/a1792327347a56ea575240b58673b2ece44230da
github.comgithub.com/akaunting/akaunting/releases/tag/2.1.31
vulncheck.comvulncheck.com/advisories/akaunting-before-2.1.31-os-command-injection-via-app-alias

Frequently asked

questions

It may be exploitable through the application's administrative interface, but exploitation requires authenticated access with sufficient privileges to reach module installation or update functionality.

Yes, the described attack path requires access to the Akaunting admin panel and the ability to submit a module alias used by the vulnerable workflow.

Avoid passing user-controlled values through a shell. Use fixed command components, safe process APIs with separate arguments, and strict allowlists for accepted module identifiers.

Apply least privilege, enforce strong administrative access controls, validate inputs against narrow schemas, review all process-execution paths, and monitor unexpected child processes launched by the application.

Find out what's already
exploitable in your codebase.