# CVE-2022-1040: Sophos Firewall Authentication Bypass

> Remote attackers can bypass authentication in the User Portal and Webadmin to execute arbitrary code on Sophos Firewall devices.

- **Severity:** Critical 9.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Yes, since 31 Mar 2022 (CISA KEV)
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 25 Mar 2022
- **Updated:** 21 Oct 2025
- **Also known as:** GHSA-9gcv-6rm7-vw3w

## What is CVE-2022-1040?

CVE-2022-1040 is a critical authentication bypass vulnerability in Sophos Firewall, published on 25 Mar 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

An authentication bypass vulnerability in the User Portal and Webadmin allows a remote attacker to execute code in Sophos Firewall version v18.5 MR3 and older.

## Which versions are affected by CVE-2022-1040?

It affects 1 product.


Products: Sophos Sfos.

## How do I fix CVE-2022-1040?

No fix has been published for CVE-2022-1040 yet. Limit exposure of the affected software until one is available. US federal agencies must fix it by 21 Apr 2022.

## Is CVE-2022-1040 being exploited?

Yes. Attackers have exploited CVE-2022-1040 in the wild since at least 31 Mar 2022.

Public exploit code:

- CVE-2022-1040 (github_poc): https://github.com/jam620/Sophos-Vulnerability
- may the poc with you (github_poc): https://github.com/killvxk/CVE-2022-1040
- Save the trouble to open the burpsuite... (github_poc): https://github.com/Keith-amateur/cve-2022-1040
- This vulnerability allows an attacker to gain unauthorized access to the firewall management space by bypassing authentication (github_poc): https://github.com/jackson5sec/CVE-2022-1040
- New exploitation of 2020 Sophos vuln (github_poc): https://github.com/Cyb3rEnthusiast/CVE-2022-1040
- Sophos XG115w Firewall 17.0.10 MR-10 - Authentication Bypass (exploitdb)

## Other vulnerabilities in Sophos Firewall

- [CVE-2020-12271](https://insights.sbomify.com/CVE-2020-12271/): Sophos SFOS SQL Injection (critical 10.0, exploited in the wild)
- [CVE-2020-11503](https://insights.sbomify.com/CVE-2020-11503/): Memory corruption in n/a (critical 9.8)
- [CVE-2018-16116](https://insights.sbomify.com/CVE-2018-16116/): SQL injection in n/a (high 8.8)
- [CVE-2018-16117](https://insights.sbomify.com/CVE-2018-16117/): Command injection in n/a (high 8.8)
- [CVE-2018-16118](https://insights.sbomify.com/CVE-2018-16118/): Command injection in n/a (high 8.1)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-1040 and fix it if it is affected.

What it is: CVE-2022-1040 is a critical authentication bypass vulnerability in Sophos Firewall, published on 25 Mar 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: Yes. Attackers have exploited CVE-2022-1040 in the wild since at least 31 Mar 2022.

Affected product: Sophos Firewall. 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-2022-1040/ (Markdown: https://insights.sbomify.com/CVE-2022-1040/index.md)
```

## Sources

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

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