# CVE-2023-2868: Barracuda Networks ESG Appliance Improper Input Validation

> Remote attackers can execute system commands via malicious tar file names in Barracuda Email Security Gateway appliances.

- **Severity:** Critical 9.4 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L`)
- **Exploited in the wild:** Yes, since 26 May 2023 (CISA KEV)
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 24 May 2023
- **Updated:** 21 Oct 2025
- **Also known as:** GHSA-898g-hmh5-hrcr

## What is CVE-2023-2868?

CVE-2023-2868 is a critical command injection vulnerability in Barracuda Email Security Gateway, published on 24 May 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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.

Weakness: CWE-77 (Improper Neutralization of Special Elements used in a Command), CWE-20 (Improper Input Validation)

## Which versions are affected by CVE-2023-2868?

It affects 5 products.


Products: Barracuda Email Security Gateway 300 Firmware, Barracuda Email Security Gateway 400 Firmware, Barracuda Email Security Gateway 600 Firmware, Barracuda Email Security Gateway 800 Firmware, Barracuda Email Security Gateway 900 Firmware.

## How do I fix CVE-2023-2868?

No fix has been published for CVE-2023-2868 yet. Limit exposure of the affected software until one is available. US federal agencies must fix it by 16 Jun 2023.

## Is CVE-2023-2868 being exploited?

Yes. Attackers have exploited CVE-2023-2868 in the wild since at least 26 May 2023.

Public exploit code:

- https://github.com/cfielding-r7/poc-cve-2023-2868 (github_poc): https://github.com/cfielding-r7/poc-cve-2023-2868
- Barracuda ESG TAR Filename Command Injection (metasploit)
- https://github.com/cashapp323232/CVE-2023-2868CVE-2023-2868 (github_poc): https://github.com/cashapp323232/CVE-2023-2868CVE-2023-2868
- https://github.com/krmxd/CVE-2023-2868 (github_poc): https://github.com/krmxd/CVE-2023-2868

## Other vulnerabilities in Barracuda Email Security Gateway

- [CVE-2023-7102](https://insights.sbomify.com/CVE-2023-7102/): Remote Code Execution (RCE) Vulnerability (critical 9.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-2868 and fix it if it is affected.

What it is: CVE-2023-2868 is a critical command injection vulnerability in Barracuda Email Security Gateway, published on 24 May 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: Yes. Attackers have exploited CVE-2023-2868 in the wild since at least 26 May 2023.

Affected product: Barracuda Email Security Gateway. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-2868/ (Markdown: https://insights.sbomify.com/CVE-2023-2868/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-2868
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-2868
- OSV: https://osv.dev/vulnerability/CVE-2023-2868

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-2868/
Summaries are generated and may contain mistakes; the official description above is the record.
