CVE-2023-2868
Remote Code injection in Barracuda Email Security Gateway
Record summary
CVE-2023-2868 has a selected CVSS score of 9.4 (critical); EIP currently links 1 catalogued exploit and 4 repository PoCs. CISA lists CVE-2023-2868 in KEV.
Description
A remote command injection vulnerability exists in the Barracuda Email Security Gateway (appliance form factor only) product effecting versions 5.1.3.001-9.2.0.006. The vulnerability arises out of a failure to comprehensively sanitize the processing of .tar file (tape archives). The vulnerability stems from incomplete input validation of a user-supplied .tar file as it pertains to the names of the files contained within the archive. As a consequence, a remote attacker can specifically format these file names in a particular manner that will result in remotely executing a system command through Perl's qx operator with the privileges of the Email Security Gateway product. This issue was fixed as part of BNSF-36456 patch. This patch was automatically applied to all customer appliances.
Exploitation context
Known exploitation
- CISA KEV
- Listed · May 26, 2023 · CISA
- VulnCheck KEV
- Listed · May 18, 2023 · VulnCheck
- Reported exploitation
- Observed · VulnCheck
Available material
CISA SSVC decision
CISA Coordinator · SSVC 2.0.3 · Evaluated Jan 16, 2025 · Source: CVE List
Affected products and versions
2| Product | Source | Version range | Status |
|---|---|---|---|
Barracuda Email Security GatewayBrowse Barracuda / Barracuda Email Security GatewayDefault status: unaffected | CVE List | 5.1.3.001 to < 9.2.0.006 | affected |
Email Security Gateway (ESG) ApplianceBrowse Barracuda Networks / Email Security Gateway (ESG) Appliance | CISA | Version data not supplied | |
Proofs of concept
5Catalogued exploits
MetasploitBarracuda ESG TAR Filename Command InjectionMetasploit exploitby Curt Hyvarinen +2 moreExploit1 file
Analysis
Technical assessment
A Metasploit module that exploits CVE-2023-2868, a command injection vulnerability in Barracuda Email Security Gateway. It sends an email with a specially crafted TAR attachment whose filename contains backtick-wrapped shell commands, achieving remote code execution when the ESG processes the attachment.
Backdoor review
No backdoor observed in reviewed code
The module is a standard Metasploit exploit for CVE-2023-2868. It constructs a TAR file with a malicious filename containing backtick-wrapped payload commands and delivers it via SMTP. No concealed backdoor, deceptive payload, or operator-directed harm was observed. The code performs only the documented exploit behavior.
Classification basis and observed behavior
Classification basis
The module is a complete exploit that actively delivers a payload to achieve remote code execution. It constructs a malicious TAR file with a command-injection filename, sends it via email, and relies on the vulnerable ESG to execute the injected command.
modules/exploits/linux/smtp/barracuda_esg_tarfile_rce.rb:16-26modules/exploits/linux/smtp/barracuda_esg_tarfile_rce.rb:102-121Requirements
- Network access to the target SMTP service (port 25)
modules/exploits/linux/smtp/barracuda_esg_tarfile_rce.rb:117 - A valid target email address on the ESG appliance
modules/exploits/linux/smtp/barracuda_esg_tarfile_rce.rb:75
Observed behavior
- Connects to the target SMTP server and checks the banner for Barracuda ESG identification
modules/exploits/linux/smtp/barracuda_esg_tarfile_rce.rb:85-89 - Wraps the attacker's payload in backticks and single quotes to form a malicious filename
modules/exploits/linux/smtp/barracuda_esg_tarfile_rce.rb:103-108 - Creates a TAR archive containing a file with the malicious filename
modules/exploits/linux/smtp/barracuda_esg_tarfile_rce.rb:112 - Composes and sends an email with the malicious TAR attachment to the target
modules/exploits/linux/smtp/barracuda_esg_tarfile_rce.rb:114-118
Behaviors behind the backdoor verdict
Observables
- Exploit Mechanism
- Payload withheldThe exploit wraps the payload in backticks and single quotes to trigger command substitution on the target.
modules/exploits/linux/smtp/barracuda_esg_tarfile_rce.rb:108 - Payload Delivery
- Payload withheldThe module sends the exploit via SMTP to the target email address.
modules/exploits/linux/smtp/barracuda_esg_tarfile_rce.rb:117-118 - Method Override
- Payload withheldThe module temporarily overrides a method to bypass the 100-byte filename limit for the injection payload.
modules/exploits/linux/smtp/barracuda_esg_tarfile_rce.rb:129-143
What the analysis did not establish
- Analysis is based solely on the module source code and metadata; framework mixins, libraries, and external payloads are not expanded.
- The module's actual runtime behavior, reliability, and safety are not verified.
- Only the module source and metadata were reviewed; framework mixins, libraries, and external payloads were not expanded or analyzed.
- Binary files were not inspected (metadata only).
This review is limited to the supplied PoC code and context. It does not assert that the code works or is safe to execute.