CVE-2026-40521
Received Received - Intake

Path Traversal in FrontAccounting Leading to RCE

Vulnerability report for CVE-2026-40521, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-06-29

Last updated on: 2026-06-29

Assigner: VulnCheck

Description

FrontAccounting before 2.4.20 contains a path traversal vulnerability in the attachment upload handler that allows authenticated attackers to execute arbitrary code by uploading files with traversal sequences in the unique_name parameter. Attackers can supply path traversal sequences ../../../shell.php to write files outside the intended attachments directory into the web root, and by uploading PHP files without extension validation, achieve remote code execution as the web server user.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-06-29
Last Modified
2026-06-29
Generated
2026-06-29
AI Q&A
2026-06-29
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
frontaccounting frontaccounting to 2.4.20 (exc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-22 The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

CVE-2026-40521 is a critical remote code execution vulnerability in FrontAccounting versions before 2.4.20. It arises from a path traversal flaw in the attachment upload handler, where authenticated users can upload files with specially crafted filenames containing traversal sequences like ../../../shell.php. This allows attackers to write files outside the intended attachments directory and into the web root.

The vulnerability exists because the application does not properly sanitize or validate the unique_name parameter used as the filename during file uploads. The sanitization function does not encode characters like forward slashes or dots, and file content bypasses sanitization entirely. Attackers can upload PHP files without extension validation, enabling them to execute arbitrary code on the server as the web server user.

Exploitation requires authentication and involves uploading a malicious PHP webshell through the attachment interface. Once uploaded, attackers gain remote code execution, allowing them to run commands on the server, read sensitive files such as database configuration, and potentially fully compromise the accounting system.

Compliance Impact

The vulnerability in FrontAccounting allows authenticated attackers to execute arbitrary code on the server by uploading malicious files outside the intended directory. This can lead to full compromise of the accounting system, including access to sensitive financial records and user credentials.

Such unauthorized access and potential data breach can result in non-compliance with common standards and regulations like GDPR and HIPAA, which require protection of personal and sensitive data. The exposure of financial and user data due to this vulnerability could lead to violations of data protection requirements, resulting in legal and regulatory consequences.

Impact Analysis

This vulnerability can have severe impacts including remote code execution on the server hosting FrontAccounting. An attacker who exploits this flaw can execute arbitrary commands with the privileges of the web server user.

Consequences include reading sensitive files such as database credentials, leading to full compromise of the accounting system. Attackers can access financial records, user credentials, and potentially manipulate or steal critical business data.

Because the exploit requires only authenticated users with standard roles (like AP Officer, Accountant, or Sub Admin) and does not require elevated privileges, the attack surface is broad within organizations using FrontAccounting.

Detection Guidance

This vulnerability can be detected by monitoring for suspicious file uploads containing path traversal sequences such as '../../../' in the unique_name parameter during attachment uploads in FrontAccounting versions before 2.4.20.

You can look for uploaded PHP files in directories outside the intended attachments folder, especially in the web root, which may indicate exploitation attempts.

Suggested commands to detect potential exploitation include searching the web root and attachments directories for unexpected PHP files or files with traversal patterns in their names:

  • Find PHP files in the web root (or other directories where uploads should not be): find /var/www/html -name '*.php' -type f
  • Search for files with traversal sequences in their names (e.g., ../../../): find /var/www/html -name '*..*..*' -type f
  • Check web server logs for POST requests to attachment upload endpoints containing suspicious parameters like unique_name with traversal sequences.

Additionally, reviewing user roles and permissions for users with access to attachment upload features (such as AP Officer, Accountant, or Sub Admin) may help identify potential attackers.

Mitigation Strategies

The immediate mitigation step is to upgrade FrontAccounting to version 2.4.20 or later, where this vulnerability has been fixed.

If upgrading immediately is not possible, consider the following temporary mitigations:

  • Restrict file uploads by validating and sanitizing the unique_name parameter to prevent path traversal sequences.
  • Implement strict file extension validation to allow only safe file types such as JPG, PNG, GIF, PDF, DOC, and ODT, blocking PHP or other executable files.
  • Ensure that uploaded files are stored only within the intended attachments directory by verifying resolved file paths.
  • Limit permissions for users who can upload attachments to trusted roles and monitor their activities closely.

These mitigations align with the official fixes applied in the patch, which include sanitizing filenames, validating file extensions, and enforcing directory restrictions.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-40521. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart