skip to content
Back to
Home Bounties Research Advisories CodeQL Wall of Fame Get Involved Events
April 27, 2021

GHSL-2020-325: Authentication bypass in Nacos - CVE-2021-29441, CVE-2021-29442

Alvaro Munoz

Coordinated Disclosure Timeline


When enabled, Nacos authentication can be bypassed which enables an attacker to access any console or REST API endpoints.



Tested Version

Latest commit at the date of reporting (b8b57dc)


Issue 1: Authentication bypass (GHSL-2020-325)

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 ""
{"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 ""


This issue may allow any user to carry out any administrative tasks on the Nacos server.

Issue 2: Missing Authentication check (GHSL-2020-326)

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 ''

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)



This issue was discovered and reported by GHSL team member @pwntester (Alvaro Muñoz).


You can contact the GHSL team at, please include a reference to GHSL-2020-325 and GHSL-2020-326 in any communication regarding this issue.