CVE-2021-29441: Authentication bypass
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.
Other sources
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.
The following request to the configuration endpoint gets rejected as we are not providing any credentials: ❯ curl -X POST "http://127.0.0.1:8848/nacos/v1/cs/configs?dataId=nacos.cfg.dataIdfoo&group=foo&content=helloWorld" {"timestamp":"2020-12-02T14:33:57.154+0000","status":403,"error":"Forbidden","message":"unknown user!","path":"/nacos/v1/cs/configs"}
However the following one gets accepted by using the Nacos-Server user-agent header: ❯ curl -X POST -A Nacos-Server "http://127.0.0.1:8848/nacos/v1/cs/configs?dataId=nacos.cfg.dataIdfoo&group=foo&content=helloWorld" true
Impact
This issue may allow any user to carry out any administrative tasks on the Nacos server.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
maven/com.alibaba.nacos:nacos-commonto a version that resolves this vulnerability.Fixed in 1.4.1 - Upgrade
Upgrade
Nacosto a version that resolves this vulnerability.Fixed in 1.4.1
Event History
Frequently Asked Questions
What is CVE-2021-29441?
CVE-2021-29441 is a vulnerability in the Nacos platform that allows unauthorized access when authentication is enabled.
How severe is CVE-2021-29441?
CVE-2021-29441 has a severity rating of 9.8 (critical).
What is the affected software for CVE-2021-29441?
The affected software for CVE-2021-29441 is Nacos version 1.4.1.
How can I fix CVE-2021-29441?
To fix CVE-2021-29441, update your Nacos installation to version 1.4.1 or higher.
Where can I find more information about CVE-2021-29441?
You can find more information about CVE-2021-29441 at the following references: [NVD](https://nvd.nist.gov/vuln/detail/CVE-2021-29441), [GitHub issue](https://github.com/alibaba/nacos/issues/4701), [GitHub pull request](https://github.com/alibaba/nacos/pull/4703).