CVE Tools
Back to blog

CVE-2021-29441: the Nacos backdoor you open by lying about your User-Agent

A cluster-peer shortcut in Alibaba Nacos lets anyone skip authentication by sending 'User-Agent: Nacos-Server' -- and the 1.4.1 fix quietly reintroduced the same class of bug through insecure defaults. Five years on, it was the pivot step in JADEPUFFER, the first agentic-AI ransomware case.

CVE-2021-29441: the Nacos backdoor you open by lying about your User-Agent. A cluster-peer shortcut in Alibaba Nacos lets anyone skip authentication by sending 'User-Agent: Nacos-Server' -- and the 1.
CVE-2021-29441: the Nacos backdoor you open by lying about your User-Agent. A cluster-peer shortcut in Alibaba Nacos lets anyone skip authentication by sending 'User-Agent: Nacos-Server' -- and the 1.

CVE-2021-29441 lets anyone who can merely reach an Alibaba Nacos server perform any administrative action with no credentials. The flaw lives in the AuthFilter servlet filter, which was built with a shortcut so that servers in a cluster could talk to each other without logging in. The check it uses to recognise a peer server is embarrassingly simple: does the request's User-Agent header start with the string Nacos-Server? Because User-Agent is a header the client fully controls, anyone can claim to be a peer server -- and the filter waves them straight through. Nacos routinely holds database credentials, API keys and downstream service secrets in its config store, so an unauthenticated admin foothold there is an unusually rich prize.

What the flaw actually is

When Nacos authentication is switched on (-Dnacos.core.auth.enabled=true), the AuthFilter is supposed to enforce it on every request. Inside the filter sits a whitelist branch: if the internal flag isEnableUserAgentAuthWhite() is true -- the default in vulnerable builds -- and the request's User-Agent starts with the constant Nacos-Server, the filter skips the rest of the authentication chain. That is textbook CWE-290, Authentication Bypass by Spoofing: the server authenticates a string the caller chooses. The proof is a one-line differential -- the same request is rejected without the header and accepted with it.

# Rejected: 403 Forbidden
curl -s -X POST 'http://TARGET:8848/nacos/v1/cs/configs?dataId=nacos.cfg.dataIdfoo&group=foo&content=helloWorld'

# Accepted: 200, body 'true' -- authentication skipped
curl -s -X POST -A 'Nacos-Server' 'http://TARGET:8848/nacos/v1/cs/configs?dataId=nacos.cfg.dataIdfoo&group=foo&content=helloWorld'

The intent was benign -- let peer nodes skip a login -- but authenticating on an attacker-controlled header turns an internal convenience into a public bypass. Once the filter is short-circuited, the whole admin surface is reachable unauthenticated: creating users via POST /nacos/v1/auth/users, and reading or overwriting every namespace and configuration item. GitHub Security Lab, who reported it, describe it plainly as a backdoor in the filter. Worth noting a sibling issue, CVE-2021-29442: the /nacos/v1/cs/ops/derby endpoint lacks the @Secured annotation, exposing the embedded Derby SQL interface without even a header trick.

The exploitation chain

From a single spoofed header to full config-store compromise. The clearest real-world illustration is JADEPUFFER: after an AI agent gained a foothold via a Langflow RCE (CVE-2025-3248), it found an exposed Nacos server, bypassed authentication with this flaw (in parallel with a forged JWT built from Nacos's public default signing key), minted a rogue admin, and encrypted the entire config store. Each stage has a cheap chokepoint, and the most effective one is simply never exposing the Nacos port to an untrusted network.

CVE-2021-29441 exploitation chain -- unauth bypass to rogue admin to config-store ransom

  1. Reachable Nacos < 1.4.1 (port 8848) — An internet- or untrusted-reachable Nacos instance below 1.4.1 (or 1.4.1--2.2.0.0 still on default serverIdentity). If it is isolated and hardened, the chain stops here.
  2. Auth bypass: User-Agent: Nacos-Server — One spoofed header trips the AuthFilter cluster-peer backdoor and skips authentication -- no session, no credentials (ATT&CK T1190).
  3. Parallel: forge JWT with default signing key — Independently, the attacker forges a token using Nacos's public default token.secret.key -- a second way in if the header trick were blocked.
  4. Create rogue admin (POST /nacos/v1/auth/users) — The bypass is converted into durable access by minting a new administrator (JADEPUFFER created 'xadmin'). ATT&CK T1136 then T1078.
  5. Read/exfil all service configs — Every config item Nacos serves -- DB credentials, API keys, downstream secrets -- is now readable (ATT&CK T1552). This is the real prize.
  6. Encrypt 1,342 configs, drop tables, ransom — In JADEPUFFER: MySQL AES_ENCRYPT() over all config items, original tables dropped, README_RANSOM left. The key was never saved -- unrecoverable even if paid.
  7. PREVENT: never expose 8848 / kill defaults — Cheapest, highest-value chokepoint: network-segment the port, set userAgentAuthWhite=false, use a non-default serverIdentity, and rotate token.secret.key. Breaks both the bypass and the forged-JWT path.
  8. DETECT: Nacos-Server UA at admin paths — Alert on any external request carrying User-Agent Nacos-Server (or the default serverIdentity: security header) to /nacos admin paths, plus unauthenticated user-creation.

Am I affected?

Every Nacos release before 1.4.1 is directly vulnerable to the User-Agent trick. But the honest answer is broader: because the 1.4.1 fix shipped an insecure serverIdentity default, anything on 1.4.1 through 2.2.0.0 that was never explicitly reconfigured is also bypassable, and any instance running with nacos.core.auth.enabled=false has no authentication at all. The safe target is 1.4.5 / 2.2.0.1+ with the defaults changed. Fingerprint a server's version safely with an unauthenticated GET to /nacos/v1/console/server/state (read-only, returns a version field) and compare it against that floor. The decisive question, though, is exposure: is the Nacos port reachable from a network you do not trust?

AxisValueWhat it means
CVSS 3.18.6 High (AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N)Unauthenticated, network-reachable, scope-changed; some vendor DBs rate it 9.8 by also scoring integrity/availability
CWECWE-290 -- Authentication Bypass by SpoofingThe server trusts an attacker-controlled header as proof of identity
EPSS~0.74 (about the 99th percentile)Among the most likely-to-be-exploited CVEs tracked
CISA KEVNot listed (catalog as of 2026-07-01)No federal deadline -- but it has been exploited in the wild; prioritise on exposure, not KEV
Exploited in the wildYes -- the 2026 JADEPUFFER agentic-ransomware case (Sysdig)Used to bypass auth on an exposed Nacos and encrypt its config store
Public exploitNuclei template, chaitin/xray PoC, several GitHub scripts; Nessus/Fortinet coverageTurnkey detection and weaponization for any operator
Affected / fixedVulnerable: all < 1.4.1. Fixed (this trick): 1.4.1. Safe floor: 1.4.5 / 2.2.0.1+ with defaults changedThe 1.4.1 fix introduced a new default-value bypass -- version alone is not enough
PreconditionA reachable Nacos endpoint (default port 8848; 2.x gRPC 9848/9849)Network isolation removes the remote path regardless of version

Exploited in the wild -- carefully stated

The strongest and most recent evidence is JADEPUFFER, which Sysdig documented on 1 July 2026 as the first end-to-end AI-driven ("agentic") ransomware operation. After an LLM agent gained initial access through a Langflow RCE, it autonomously located an internet-exposed Nacos server and attacked it two ways at once -- this User-Agent bypass and a forged JWT using Nacos's long-public default signing key. It created a rogue admin account (xadmin), then used MySQL's AES_ENCRYPT() to encrypt all 1,342 configuration items, dropped the original tables, and left a README_RANSOM table. Two details stand out: the agent self-corrected a failed admin-creation payload roughly 31 seconds later without human help, and the AES key was random and never saved -- so the data is unrecoverable even if the ransom is paid. Separately, exposed Nacos has long been a commodity target for cryptojacking crews such as Kinsing that hunt internet-facing middleware to build Linux mining botnets.

Disclosure to renewed exploitation

  1. Reported to vendor
    GitHub Security Lab (GHSL-2020-325) reports the AuthFilter backdoor to Alibaba security
  2. Fix confirmed in 1.4.1
    Alibaba confirms a fix after the researcher follows up publicly; the report had gone to spam
  3. Public disclosure
    GitHub Security Lab publishes the advisory; NVD record commonly dated 2021-04-27
  4. CVE published (NVD)
    CVE-2021-29441 assigned CVSS 3.1 8.6, CWE-290
  5. JADEPUFFER agentic ransomware
    Sysdig reports an LLM-agent-driven ransomware case using this flaw to pivot to and encrypt an exposed Nacos config store

Detection & hunting

The single most useful fact for defenders: the User-Agent value Nacos-Server (and the default serverIdentity: security header) should only ever appear on genuine intra-cluster traffic from known peer IPs. Anything else carrying that marker to a /nacos admin path is high-signal on its own -- you do not need to match a specific payload. Watch the header, then watch the host.

  • Request-side: any request to /nacos/v1/auth/users, /nacos/v1/cs/configs or /nacos/v1/ns/ whose User-Agent starts with Nacos-Server, or that carries serverIdentity: security, from a source that is not a known cluster peer. Also flag admin requests with a trailing slash (/nacos/v1/auth/users/) -- the method-lookup bypass variant.
  • Safe exposure check: GET /nacos/v1/console/server/state (read-only) and flag anything below the 1.4.5 / 2.2.0.1 floor; enumerate ports 8848/9848/9849 from an external vantage. Prefer this over an active exploit check.
  • Post-exploit on the host: hunt for rogue admin users in the Nacos users/roles tables (reconcile against your known set -- JADEPUFFER used xadmin), for config values that are now unexpected AES blobs, dropped config_info tables, or a stray README_RANSOM table.
  • Forged-JWT tell: authenticated actions with no matching successful login can indicate a token minted with the default token.secret.key rather than a real session. Validate before acting; rotate the key regardless.
# PROPOSED, NOT OFFICIAL - flags a request carrying the Nacos cluster-peer marker
# to a Nacos admin path. Map the field names to your proxy/web-log schema and
# allowlist known Nacos peer source IPs to cut false positives.
title: Nacos CVE-2021-29441 User-Agent / serverIdentity auth bypass
status: experimental
logsource:
  category: webserver
detection:
  selection_path:
    cs-uri-stem|contains:
      - '/nacos/v1/auth/users'
      - '/nacos/v1/cs/configs'
      - '/nacos/v1/ns/'
  selection_marker:
    - c-useragent|startswith: 'Nacos-Server'
    - cs-headers|contains: 'serverIdentity: security'
  condition: selection_path and selection_marker
fields: [src_ip, c-useragent, cs-uri-stem, sc-status]
level: high

What to do now

  1. Contain exposure first. If a Nacos port (8848, or 2.x gRPC 9848/9849) is reachable from the internet or an untrusted segment, network-segment it now. The whole bug class is pre-auth, so reachability is the vulnerability -- this single control neutralises the User-Agent trick, the serverIdentity default and the forged-JWT path at once.
  2. Upgrade to 1.4.5 / 2.2.0.1 or later -- past both the User-Agent and serverIdentity-default bypasses. Do not stop at 1.4.1.
  3. Change the defaults. Set nacos.core.auth.enable.userAgentAuthWhite=false, give nacos.core.auth.server.identity.key/.value unique secret values (never serverIdentity/security), and rotate token.secret.key to a strong unique key. The public default JWT key enables token forgery independent of this CVE.
  4. Assume breach if it was ever exposed. Hunt for rogue admin users, tampered or encrypted configs and forged-token activity before you close the ticket -- and rotate every secret Nacos stored, since those configs may already be in an attacker's hands.
  5. Prioritise: internet-reachable instances first (hours), internally-reachable next, fully-isolated hardened instances on normal cadence -- and verify that 'isolated' really is.

FAQ

Is CVE-2021-29441 being exploited?
Yes. It is not on CISA KEV, but its EPSS sits near the 99th percentile, public tooling is turnkey, and it was used in the wild in 2026 as the pivot step in the JADEPUFFER agentic-ransomware case documented by Sysdig. Run a free exposure check.
Is it really unauthenticated admin access?
Yes -- in versions before 1.4.1 the AuthFilter skips authentication for any request whose User-Agent starts with Nacos-Server. From there an attacker can create admin users and read or overwrite every configuration item Nacos serves, with no login.
We upgraded past 1.4.1 -- are we safe?
Not necessarily. The 1.4.1 fix replaced the User-Agent check with a serverIdentity header whose defaults (serverIdentity/security) were themselves an insecure default, bypassable until they were removed in 2.2.1. Upgrade to 1.4.5 / 2.2.0.1+, set userAgentAuthWhite=false, use a non-default serverIdentity, and rotate token.secret.key.
It is from 2021 -- can I ignore it?
No. It stayed exploitable the entire time instances remained exposed, its EPSS is top-percentile, and it was the entry point for a 2026 agentic-ransomware case. Any Nacos endpoint reachable from an untrusted network is a live risk today.
What is the difference between CVE-2021-29441 and CVE-2021-29442?
Both are Nacos auth flaws disclosed together. CVE-2021-29441 is the User-Agent: Nacos-Server filter bypass covered here; CVE-2021-29442 is a separate missing-@Secured issue that exposes the embedded Derby SQL endpoint (/nacos/v1/cs/ops/derby). Upgrading and segmenting addresses both.

Sources