CVE-2026-53521: Nezha Monitoring Stored Future DDNS Profile ID Vulnerability

MODERATE
Advisory Identifier: GHSA-39g2-8x68-pmx8
CVSS 6.4
CWE-863
Published
Advisory Summary

CVE-2026-53521 is a MODERATE (CVSS 6.4) stored future ddns profile id vulnerability (CWE-863: Incorrect Authorization) affecting Nezha Monitoring libraries in the Go ecosystem. The issue involves stored future ddns profile id allows unauthorized use of another user's ddns profile context. Remediation is available by upgrading affected packages to version 2.1.0.

CVE-2026-53521 at a Glance

CVE Identifier CVE-2026-53521
GHSA Identifier GHSA-39g2-8x68-pmx8
Severity MODERATE
CVSS v3.1 Base Score 6.4
CWE Classification CWE-863: Incorrect Authorization
Affected Product Nezha Monitoring
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2026-53521

To remediate this vulnerability, upgrade all affected Nezha Monitoring dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/nezhahq/nezha fixed: 2.1.0
Upgrade github.com/nezhahq/nezha to 2.1.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/nezhahq/nezha

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-53521, inspect your project dependencies for Nezha Monitoring:

inspect dependencies for github.com/nezhahq/nezha

Analyze the terminal output to locate any version of Nezha Monitoring in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-863: Incorrect Authorization, where the product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. In Nezha Monitoring, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary `PATCH /server/{id}` accepts and persists nonexistent `ddns_profiles` IDs for a member-owned server. If another user later creates a DDNS profile with one of those IDs, the DDNS worker resolves the stored ID and dispatches an update using the other user's DDNS profile configuration in the context of the attacker's server. This is a second-order authorization bypass: direct binding to an existing foreign DDNS profile is correctly denied, but an unresolved future ID can be stored first and later becomes a live cross-user reference. ## Affected versions Confirmed on: - Nezha `v2.0.14` - Commit: `8b5e382fe217107c7b777ea9c6b4bc3d2e156202` The exact affected version range was not determined. ## Impact A normal member who owns a server can prebind one or more future DDNS profile IDs to that server. If another user later creates a DDNS profile with a matching ID, the dashboard DDNS worker can use the victim's DDNS profile/provider configuration for the attacker's server. In the validated worker path, the dispatched DDNS update combines: - the victim DDNS profile ID and owner - the victim profile's provider type - victim profile fields such as domains, access ID, access secret, and retry policy - attacker server context, including the attacker's server ID, owner, IPv4 address, and override DDNS domains This can result in unauthorized DDNS update attempts using another user's DDNS profile context. The attacker does not need permission to bind the victim profile after it exists. The following were not validated: credential disclosure, account takeover, or guaranteed external DNS modification across all providers. The credentials remain server-side in the worker path. The downstream DNS impact depends on the victim profile's provider configuration and what that provider account is authorized to update. ## Affected components - `PATCH /server/{id}` - `cmd/dashboard/controller/server.go` - `service/singleton/singleton.go` - `service/singleton/ddns.go` - `service/singleton/server.go` - `pkg/ddns/ddns.go` ## Root cause The server update path validates submitted DDNS profile IDs through `CheckPermission`, but that check only rejects existing objects owned by another user. Nonexistent IDs are skipped. The `updateServer` path then persists the submitted raw IDs into `DDNSProfilesRaw`, along with override domain data. Later, the DDNS worker resolves the stored profile IDs by ID and dispatches provider updates without revalidating that the resolved profiles belong to the server owner. As a result, an invalid unresolved reference can become a valid cross-user reference after another user creates a DDNS profile with the same global auto-increment ID. ## Reproduction summary The behavior was validated locally with focused regression tests. ### Controller chain proof Test file: `cmd/dashboard/controller/ddns_second_order_test.go` Test name: `TestUpdateServerAllowsFutureDDNSProfileBindingThenResolvesVictimProfile` Command: ```bash go test ./cmd/dashboard/controller -run TestUpdateServerAllowsFutureDDNSProfileBindingThenResolvesVictimProfile -count=1 ``` Result: `pass` The test demonstrates: 1. A normal member owns server `1`. 2. DDNS profile ID `1` does not exist. 3. The member updates their server with `enable_ddns=true` and `ddns_profiles=[1]`. 4. The request succeeds. 5. The server persists `DDNSProfiles=[1]`. 6. Another user later creates a DDNS profile and receives ID `1`. 7. A fresh attempt by the attacker to bind profile `1` is correctly denied. 8. The previously stored reference remains active and resolves in the DDNS worker path. ### Provider-level worker proof Test file: `service/singleton/ddns_worker_authz_test.go` Test name: `TestUpdateDDNSDispatchesVictimProfileForAttackerServer` Command: ```bash go test ./service/singleton -run TestUpdateDDNSDispatchesVictimProfileForAttackerServer -count=1 ``` Result: `pass` The test proves that the DDNS worker does not merely resolve the victim profile. It dispatches a DDNS update using the victim profile configuration and attacker server context. Validated assertions include: - resolved profile ID is `1` - resolved profile owner is victim user `200` - processed server is attacker server `1` owned by user `100` - provider type is the victim profile's provider - victim profile fields are present in worker dispatch: - domains - access ID - access secret - max retries - attacker server context is present in the same dispatch: - IPv4 `198.51.100.44` - attacker-controlled override domains are passed to the worker: - `attacker-controlled.example` ## Practicality The attack requires predicting or prebinding future DDNS profile IDs. This limits severity, but does not remove the authorization issue. Evidence supporting practicality: - DDNS profile IDs are `uint64` GORM primary keys from `model/common.go`. - `createDDNS` uses a normal `DB.Create(&p)` flow and returns `p.ID`. - `DDNSProfiles` is an unbounded `[]uint64` in `model/server_api.go`. - No length or existence validation is applied in `updateServer`. - Invalid/future IDs are preserved in the server record. - Stored unresolved IDs survive reload. - Range prebinding was validated with `[1,2,3,4]`. - The DDNS worker consumes stored IDs on future DDNS update events. - Worker dispatch can occur after server edit and agent IP-change events. - Each DDNS update can retry according to the victim profile's `MaxRetries`. This makes the issue semi-practical: exploitation depends on future ID prediction or range prebinding, but the unresolved IDs persist and can become active later. ## Expected behavior `PATCH /server/{id}` should reject any submitted DDNS profile ID that does not both: 1. exist, and 2. belong to the caller or the owner of the server being updated. The DDNS worker should also avoid trusting stored profile IDs without revalidating ownership before provider resolution or dispatch. ## Actual behavior `PATCH /server/{id}` accepts nonexistent DDNS profile IDs and persists them. If another user later creates a DDNS profile with a matching ID, the stored reference resolves to that user's profile and is consumed by the DDNS worker for the attacker's server. ## Suggested remediation Apply both bind-time and worker-time validation. At bind time: - Reject nonexistent DDNS profile IDs. - Reject DDNS profile IDs that do not belong to the caller/server owner. - Reject or limit excessive DDNS profile ID lists if range prebinding is not intended. At worker time: - Revalidate that every resolved DDNS profile still belongs to the owner of the server being processed. - Skip or remove stale, nonexistent, or foreign DDNS profile references before provider dispatch. Suggested regression tests: - `TestUpdateServerRejectsNonexistentDDNSProfileIDs` - `TestUpdateServerRejectsForeignDDNSProfileIDs` - `TestUpdateServerAcceptsOwnedDDNSProfileIDs` - `TestUpdateDDNSSkipsStaleOrForeignStoredDDNSProfiles` ## Security relevance A direct bind to an existing foreign DDNS profile is already denied, which shows the intended ownership boundary. The issue is that the same boundary can be bypassed by storing a future unresolved ID before the victim profile exists. The worker later treats the stored ID as trusted and dispatches a DDNS update using the victim profile's provider configuration with attacker server context. This is an authorization issue in a deferred worker path, not merely malformed input. ## Limitations - The attacker does not read victim DDNS credentials through the validated path. - Exploitation may require predicting or prebinding future global auto-increment DDNS profile IDs. - The downstream DNS impact depends on the victim profile's provider configuration. - External DNS modification was not claimed as guaranteed across all providers.

CVE-2026-53521 Affected Nezha Monitoring Versions

1 component(s)
Fixed Versions:
2.1.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/nezhahq/nezha
Go
≥ 2.0.14
< 2.1.0
2.1.0

References

Frequently Asked Questions

What is CVE-2026-53521?
CVE-2026-53521 is a security vulnerability in Nezha Monitoring involving Stored future DDNS profile ID allows unauthorized use of another user's DDNS profile context under CWE-863: Incorrect Authorization.
Which Nezha Monitoring versions are affected?
Affected versions include releases prior to 2.1.0 across affected packages: github.com/nezhahq/nezha.
What version fixes CVE-2026-53521?
Upgrading to 2.1.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/nezhahq/nezha affected?
Yes, github.com/nezhahq/nezha is affected in releases prior to 2.1.0. Upgrade your dependency to 2.1.0 or later.
What is the CVSS score of CVE-2026-53521?
CVE-2026-53521 has a CVSS v3.1 base score of 6.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:L.
What CWE is associated with CVE-2026-53521?
CVE-2026-53521 is classified under CWE-863: Incorrect Authorization (The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.).
How can I check Go dependencies for CVE-2026-53521?
Run the dependency tree command: 'inspect dependencies for github.com/nezhahq/nezha'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-39g2-8x68-pmx8",
  "modified" : "2026-06-26T23:02:37Z",
  "published" : "2026-06-26T23:02:37Z",
  "aliases" : [ "CVE-2026-53521" ],
  "summary" : "Nezha Monitoring: Stored future DDNS profile ID allows unauthorized use of another user's DDNS profile context",
  "details" : "## Summary\n\n`PATCH /server/{id}` accepts and persists nonexistent `ddns_profiles` IDs for a member-owned server. If another user later creates a DDNS profile with one of those IDs, the DDNS worker resolves the stored ID and dispatches an update using the other user's DDNS profile configuration in the context of the attacker's server.\n\nThis is a second-order authorization bypass: direct binding to an existing foreign DDNS profile is correctly denied, but an unresolved future ID can be stored first and later becomes a live cross-user reference.\n\n## Affected versions\n\nConfirmed on:\n\n- Nezha `v2.0.14`\n- Commit: `8b5e382fe217107c7b777ea9c6b4bc3d2e156202`\n\nThe exact affected version range was not determined.\n\n## Impact\n\nA normal member who owns a server can prebind one or more future DDNS profile IDs to that server. If another user later creates a DDNS profile with a matching ID, the dashboard DDNS worker can use the victim's DDNS profile/provider configuration for the attacker's server.\n\nIn the validated worker path, the dispatched DDNS update combines:\n\n- the victim DDNS profile ID and owner\n- the victim profile's provider type\n- victim profile fields such as domains, access ID, access secret, and retry policy\n- attacker server context, including the attacker's server ID, owner, IPv4 address, and override DDNS domains\n\nThis can result in unauthorized DDNS update attempts using another user's DDNS profile context. The attacker does not need permission to bind the victim profile after it exists.\n\nThe following were not validated: credential disclosure, account takeover, or guaranteed external DNS modification across all providers. The credentials remain server-side in the worker path. The downstream DNS impact depends on the victim profile's provider configuration and what that provider account is authorized to update.\n\n## Affected components\n\n- `PATCH /server/{id}`\n- `cmd/dashboard/controller/server.go`\n- `service/singleton/singleton.go`\n- `service/singleton/ddns.go`\n- `service/singleton/server.go`\n- `pkg/ddns/ddns.go`\n\n## Root cause\n\nThe server update path validates submitted DDNS profile IDs through `CheckPermission`, but that check only rejects existing objects owned by another user. Nonexistent IDs are skipped.\n\nThe `updateServer` path then persists the submitted raw IDs into `DDNSProfilesRaw`, along with override domain data. Later, the DDNS worker resolves the stored profile IDs by ID and dispatches provider updates without revalidating that the resolved profiles belong to the server owner.\n\nAs a result, an invalid unresolved reference can become a valid cross-user reference after another user creates a DDNS profile with the same global auto-increment ID.\n\n## Reproduction summary\n\nThe behavior was validated locally with focused regression tests.\n\n### Controller chain proof\n\nTest file:\n\n`cmd/dashboard/controller/ddns_second_order_test.go`\n\nTest name:\n\n`TestUpdateServerAllowsFutureDDNSProfileBindingThenResolvesVictimProfile`\n\nCommand:\n\n```bash\ngo test ./cmd/dashboard/controller -run TestUpdateServerAllowsFutureDDNSProfileBindingThenResolvesVictimProfile -count=1\n```\n\nResult:\n\n`pass`\n\nThe test demonstrates:\n\n1. A normal member owns server `1`.\n2. DDNS profile ID `1` does not exist.\n3. The member updates their server with `enable_ddns=true` and `ddns_profiles=[1]`.\n4. The request succeeds.\n5. The server persists `DDNSProfiles=[1]`.\n6. Another user later creates a DDNS profile and receives ID `1`.\n7. A fresh attempt by the attacker to bind profile `1` is correctly denied.\n8. The previously stored reference remains active and resolves in the DDNS worker path.\n\n### Provider-level worker proof\n\nTest file:\n\n`service/singleton/ddns_worker_authz_test.go`\n\nTest name:\n\n`TestUpdateDDNSDispatchesVictimProfileForAttackerServer`\n\nCommand:\n\n```bash\ngo test ./service/singleton -run TestUpdateDDNSDispatchesVictimProfileForAttackerServer -count=1\n```\n\nResult:\n\n`pass`\n\nThe test proves that the DDNS worker does not merely resolve the victim profile. It dispatches a DDNS update using the victim profile configuration and attacker server context.\n\nValidated assertions include:\n\n- resolved profile ID is `1`\n- resolved profile owner is victim user `200`\n- processed server is attacker server `1` owned by user `100`\n- provider type is the victim profile's provider\n- victim profile fields are present in worker dispatch:\n  - domains\n  - access ID\n  - access secret\n  - max retries\n- attacker server context is present in the same dispatch:\n  - IPv4 `198.51.100.44`\n- attacker-controlled override domains are passed to the worker:\n  - `attacker-controlled.example`\n\n## Practicality\n\nThe attack requires predicting or prebinding future DDNS profile IDs. This limits severity, but does not remove the authorization issue.\n\nEvidence supporting practicality:\n\n- DDNS profile IDs are `uint64` GORM primary keys from `model/common.go`.\n- `createDDNS` uses a normal `DB.Create(&p)` flow and returns `p.ID`.\n- `DDNSProfiles` is an unbounded `[]uint64` in `model/server_api.go`.\n- No length or existence validation is applied in `updateServer`.\n- Invalid/future IDs are preserved in the server record.\n- Stored unresolved IDs survive reload.\n- Range prebinding was validated with `[1,2,3,4]`.\n- The DDNS worker consumes stored IDs on future DDNS update events.\n- Worker dispatch can occur after server edit and agent IP-change events.\n- Each DDNS update can retry according to the victim profile's `MaxRetries`.\n\nThis makes the issue semi-practical: exploitation depends on future ID prediction or range prebinding, but the unresolved IDs persist and can become active later.\n\n## Expected behavior\n\n`PATCH /server/{id}` should reject any submitted DDNS profile ID that does not both:\n\n1. exist, and\n2. belong to the caller or the owner of the server being updated.\n\nThe DDNS worker should also avoid trusting stored profile IDs without revalidating ownership before provider resolution or dispatch.\n\n## Actual behavior\n\n`PATCH /server/{id}` accepts nonexistent DDNS profile IDs and persists them. If another user later creates a DDNS profile with a matching ID, the stored reference resolves to that user's profile and is consumed by the DDNS worker for the attacker's server.\n\n## Suggested remediation\n\nApply both bind-time and worker-time validation.\n\nAt bind time:\n\n- Reject nonexistent DDNS profile IDs.\n- Reject DDNS profile IDs that do not belong to the caller/server owner.\n- Reject or limit excessive DDNS profile ID lists if range prebinding is not intended.\n\nAt worker time:\n\n- Revalidate that every resolved DDNS profile still belongs to the owner of the server being processed.\n- Skip or remove stale, nonexistent, or foreign DDNS profile references before provider dispatch.\n\nSuggested regression tests:\n\n- `TestUpdateServerRejectsNonexistentDDNSProfileIDs`\n- `TestUpdateServerRejectsForeignDDNSProfileIDs`\n- `TestUpdateServerAcceptsOwnedDDNSProfileIDs`\n- `TestUpdateDDNSSkipsStaleOrForeignStoredDDNSProfiles`\n\n## Security relevance\n\nA direct bind to an existing foreign DDNS profile is already denied, which shows the intended ownership boundary. The issue is that the same boundary can be bypassed by storing a future unresolved ID before the victim profile exists.\n\nThe worker later treats the stored ID as trusted and dispatches a DDNS update using the victim profile's provider configuration with attacker server context. This is an authorization issue in a deferred worker path, not merely malformed input.\n\n## Limitations\n\n- The attacker does not read victim DDNS credentials through the validated path.\n- Exploitation may require predicting or prebinding future global auto-increment DDNS profile IDs.\n- The downstream DNS impact depends on the victim profile's provider configuration.\n- External DNS modification was not claimed as guaranteed across all providers.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/nezhahq/nezha"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.14"
      }, {
        "fixed" : "2.1.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nezhahq/nezha/security/advisories/GHSA-39g2-8x68-pmx8"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-53521"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nezhahq/nezha"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-863" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-26T23:02:37Z",
    "nvd_published_at" : "2026-06-12T22:16:52Z"
  }
}