Skip to content

Nacos 用户名枚举漏洞 Issue #15682

Closed

Description

@ruonanqwe

Nacos 用户名枚举漏洞 Issue(GitHub Issue 模板,可直接提交)

Describe the bug

The /v1/auth/login login endpoint returns different HTTP status codes and error messages for non‑existent users vs existing users with wrong passwords, leading to username enumeration vulnerability.
Attackers can distinguish valid usernames by observing response differences:

  1. When username does not exist: return HTTP 500, response contains User xxx not found
  2. When username exists but password wrong: return HTTP 403, generic error prompt

This side‑channel leakage allows unauthenticated attackers to brute‑force enumerate valid system accounts.

中文简述:Nacos 登录接口 /v1/auth/login,对不存在用户、存在用户但密码错误返回不一样的 HTTP 状态码与报错文本,造成用户名枚举漏洞。未授权攻击者可以根据返回状态码区分账号是否真实存在,批量爆破获取系统有效账号。

Expected behavior

Unify login failure responses:

  1. Whether the username exists or password is wrong, return identical HTTP status code (e.g. 401 Unauthorized)
  2. Return the same generic error message, do not leak whether the user exists. Example: Incorrect username or password
  3. Do not output user‑existence details in response body.

Actually behavior

  • Non‑existent user: HTTP/1.1 500, body: caused: User testabc123 not found;
  • Valid username + wrong password: HTTP/1.1 403, body: User not found! Please check user exist or password is right!

Different status code + different error text, leak user existence information.

How to Reproduce

  1. Deploy nacos‑server, enable auth authentication.
  2. Send POST request to /v1/auth/login with application/x‑www‑form‑urlencoded body.

Case1: Non‑existing username

curl -v -X POST http://<nacos‑ip>:8848/v1/auth/login -d "username=testabc123&password=123456"
Image
  • Response status: 500 Internal Server Error
  • Response body: caused: User testabc123 not found;

Case2: Real username, wrong password

curl -v -X POST http://<nacos‑ip>:8848/v1/auth/login -d "username=nacos&password=wrongpass666"
Image
  • Response status: 403 Forbidden
  • Response body: User not found! Please check user exist or password is right!

Compare the two responses, attacker can judge whether username is valid.

Desktop

  • OS: CentOS / Windows
  • Version: nacos‑server (affected multiple versions)
  • Module: auth
  • SDK: HTTP raw request(curl)

Additional context

Risk impact: Unauthenticated remote attackers can enumerate valid account list, prepare for subsequent password spraying / brute‑force attack.

Suggested fix:

  1. Unify HTTP status code for all login failures, e.g. use 401 for both user‑not‑found and bad‑password scenarios.
  2. Use unified generic error message like Incorrect username or password, remove user‑specific User xxx not found detail.
  3. Add rate‑limit / brute‑force protection on login endpoint to mitigate automated enumeration.

Activity

  1. added this to the 3.2.4 milestone on Aug 10, 2026
  2. added a commit that references this issue on Aug 17, 2026
  3. added a commit that references this issue on Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/pluginkind/bugCategory issues or prs related to bug.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions