# CVE-2021-29441: Authentication bypass

> Attackers can bypass authentication by spoofing the user-agent header, allowing unauthorized administrative access to the Nacos server.

- **Severity:** High 8.6 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 27 Apr 2021
- **Updated:** 3 Aug 2024

## What is CVE-2021-29441?

CVE-2021-29441 is a high-severity authentication bypass vulnerability in alibaba nacos, published on 27 Apr 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Nacos is a platform designed for dynamic service discovery and configuration and service management. In Nacos before version 1.4.1, when configured to use authentication (-Dnacos.core.auth.enabled=true) Nacos uses the AuthFilter servlet filter to enforce authentication. This filter has a backdoor that enables Nacos servers to bypass this filter and therefore skip authentication checks. This mechanism relies on the user-agent HTTP header so it can be easily spoofed. This issue may allow any user to carry out any administrative tasks on the Nacos server.

Weakness: CWE-290 (Authentication Bypass by Spoofing)

## Which versions are affected by CVE-2021-29441?

It affects 1 product.


Products: Alibaba Nacos.

## How do I fix CVE-2021-29441?

Upgrade to a fixed version.

## Is CVE-2021-29441 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2021-29441 exists.

Public exploit code:

- https://github.com/bysinks/CVE-2021-29441 (github_poc): https://github.com/bysinks/CVE-2021-29441
- https://github.com/hh-hunter/nacos-cve-2021-29441 (github_poc): https://github.com/hh-hunter/nacos-cve-2021-29441
- https://github.com/azhao1981/CVE-2021-29441 (github_poc): https://github.com/azhao1981/CVE-2021-29441
- Vulhub nacos/CVE-2021-29441: Nacos User-Agent Authentication Bypass (CVE-2021-29441), run with Isoloom (github_poc): https://github.com/CyberCTF/vulhub-nacos-cve-2021-29441
- Nacos <1.4.1 - Authentication Bypass (nuclei): http/cves/2021/CVE-2021-29441.yaml

## Other vulnerabilities in alibaba nacos

- [CVE-2021-43116](https://insights.sbomify.com/CVE-2021-43116/): Use of Hard-coded Credentials in Nacos (high 8.8)
- [CVE-2021-29442](https://insights.sbomify.com/CVE-2021-29442/): Authentication bypass (high 8.6)
- [CVE-2021-44667](https://insights.sbomify.com/CVE-2021-44667/): Cross-site Scripting in Nacos (medium 6.1)
- [CVE-2020-19676](https://insights.sbomify.com/CVE-2020-19676/): Incorrect Access Control in Nacos (medium 5.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-29441 and fix it if it is affected.

What it is: CVE-2021-29441 is a high-severity authentication bypass vulnerability in alibaba nacos, published on 27 Apr 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2021-29441 exists.

Affected product: alibaba nacos. 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-2021-29441/ (Markdown: https://insights.sbomify.com/CVE-2021-29441/index.md)
```

## Sources

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

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