[GH-ISSUE #6921] [Bug]: Can't update node from central panel #4583

Closed
opened 2026-10-31 20:40:40 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @ArtikBoom3007 on GitHub (Oct 24, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6921

Describe the bug

Version of central panel: v3.10.2

Versions of nodes: v3.10.2 and v3.8.5

When trying to update node panel version from "nodes" menu, I've got an error
Image

Reissuing token not affect

Problem also occurs in oldest version of central panel, e.g. 3.8.5

How to reproduce the problem

Open "Nodes" page
Click "Update panel" in "Actions" column and confirm
Error occurs

Expected behavior

No response

Actual behavior

No response

Relevant logs


Screenshots

No response

3x-ui version

3.10.2

Xray-core version

No response

How did you install 3x-ui?

install.sh script

Operating system

ubuntu 24.04

Which parts of the panel are affected?

No response

Browser (only if it is a UI bug)

No response

Is the panel behind a reverse proxy or CDN?

None

Before submitting

  • I searched existing issues and this bug has not been reported.
  • I am running the latest released version of 3x-ui (or have verified the bug still exists on it).
  • This bug report is written in English.
  • I have redacted any sensitive data (tokens, real domains, client UUIDs).
Originally created by @ArtikBoom3007 on GitHub (Oct 24, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6921 ### Describe the bug Version of central panel: v3.10.2 Versions of nodes: v3.10.2 and v3.8.5 When trying to update node panel version from "nodes" menu, I've got an error <img width="1713" height="70" alt="Image" src="https://github.com/user-attachments/assets/a4bd666a-e447-4ac6-a200-142e0044bc83" /> Reissuing token not affect Problem also occurs in oldest version of central panel, e.g. 3.8.5 ### How to reproduce the problem Open "Nodes" page Click "Update panel" in "Actions" column and confirm Error occurs ### Expected behavior _No response_ ### Actual behavior _No response_ ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version 3.10.2 ### Xray-core version _No response_ ### How did you install 3x-ui? install.sh script ### Operating system ubuntu 24.04 ### Which parts of the panel are affected? _No response_ ### Browser (only if it is a UI bug) _No response_ ### Is the panel behind a reverse proxy or CDN? None ### Before submitting - [x] I searched [existing issues](../issues?q=is%3Aissue) and this bug has not been reported. - [x] I am running the latest released version of 3x-ui (or have verified the bug still exists on it). - [x] This bug report is written in English. - [x] I have redacted any sensitive data (tokens, real domains, client UUIDs).
bsakaguchi 2026-10-31 20:40:40 +07:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 24, 2026):

This is most likely a real permission gap in v3.10.2, and it is fixed on the default branch but not in a release yet. In v3.10.2 the node rejects POST /panel/api/server/updatePanel with 403 whenever the central panel reaches it with a node-sync token or over mTLS, whatever token you reissue. Commit a8d0700b adds a new node-admin token scope for this. It is in the dev-latest build only, not in v3.10.2.

I can't open images, so I can't read the error in your screenshot. Please paste its exact text. If it says HTTP 403 / this API token is not permitted to access this endpoint, the cause below is confirmed.

Why it fails in v3.10.2

On the node, checkAPIAuth gives an mTLS connection the node-sync scope before it looks at the bearer token (v3.10.2:internal/web/controller/api.go):

if c.Request.TLS != nil && len(c.Request.TLS.VerifiedChains) > 0 {
    ...
    c.Set("api_token_scope", model.ApiScopeNodeSync)

enforceTokenScope then only lets node-sync reach routes in nodeSyncScopeAllow, and /server/updatePanel is not on that list. So the request is denied with:

"msg": "this API token is not permitted to access this endpoint"

The central panel sends exactly that route (internal/web/runtime/remote.go:677, r.do(ctx, http.MethodPost, "panel/api/server/updatePanel", body)). When a node answers with anything other than 200, the error is shown as POST panel/api/server/updatePanel: HTTP 403: "..." (remote.go, the resp.StatusCode != http.StatusOK branch). v3.8.5 has the same mTLS-first logic, which explains why the older panel fails too.

What changed on the default branch

a8d0700b fix(auth): add node-admin token scope for panel updates (#6666) adds nodeAdminScopeAllow with only "/server/updatePanel": {http.MethodPost: {}} (internal/web/controller/api.go:127-129). On mTLS, only a node-admin bearer raises the scope (api.go:52-58). This is deliberate (docs/architecture.md, scope table): "On an mTLS connection, only a valid node-admin bearer elevates the request; other bearer scopes retain the historical mTLS node-sync behavior." So even on the new code, an admin or node-sync token over mTLS still cannot start a remote update.

What you can do now

  1. On each node, update from its own shell first. The central panel can't update it yet:
    x-ui update-dev   # dev channel, carries a8d0700b; or wait for the next release and use `x-ui update`
    
  2. On the node, go to Settings → Security → API tokens and create a token with scope node-admin.
  3. Put that token into the node's entry on the central panel's Nodes page.

After that, Update panel from the Nodes page should get past the auth check.

Please reply with

  1. The exact error text from the screenshot. It tells me whether this is the 403 above or a different failure, such as node is offline.
  2. The node's TLS mode on the central panel (verify / skip / pin / mtls), and the scope of the token you set for that node.
Verdict:        Already fixed
Severity:       Medium
Confidence:     Medium
Root cause:     v3.10.2 internal/web/controller/api.go checkAPIAuth/enforceTokenScope - mTLS is forced to node-sync, and /server/updatePanel is absent from nodeSyncScopeAllow, so the node returns 403 to the central panel's updatePanel call.
Same class:     None found (Remote.UpdatePanel, remote.go:672, is the only caller of the node's updatePanel route; NodeService.UpdatePanels, service/node.go:937, fans out to it)
Already fixed:  a8d0700b (#6666), on dev-latest only; not in v3.10.2 or any tagged release
Duplicate of:   Related: #6666 (the fix), #5769 (least-privilege node scopes)
Evidence:       api.go:127-129 nodeAdminScopeAllow; api.go:52-58 mTLS elevation only for node-admin; remote.go:672-678; git tag --contains a8d0700b -> dev-latest only
Not determined: The exact error in the screenshot. A 403 "not permitted" message confirms this cause; any other text points to a different failure.

This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:6383072385 --> @github-actions[bot] commented on GitHub (Oct 24, 2026): This is most likely a real permission gap in v3.10.2, and it is fixed on the default branch but **not in a release yet**. In v3.10.2 the node rejects `POST /panel/api/server/updatePanel` with `403` whenever the central panel reaches it with a `node-sync` token **or over mTLS**, whatever token you reissue. Commit `a8d0700b` adds a new `node-admin` token scope for this. It is in the `dev-latest` build only, not in v3.10.2. I can't open images, so I can't read the error in your screenshot. Please paste its exact text. If it says `HTTP 403` / `this API token is not permitted to access this endpoint`, the cause below is confirmed. ### Why it fails in v3.10.2 On the **node**, `checkAPIAuth` gives an mTLS connection the `node-sync` scope before it looks at the bearer token (`v3.10.2:internal/web/controller/api.go`): ```go if c.Request.TLS != nil && len(c.Request.TLS.VerifiedChains) > 0 { ... c.Set("api_token_scope", model.ApiScopeNodeSync) ``` `enforceTokenScope` then only lets `node-sync` reach routes in `nodeSyncScopeAllow`, and `/server/updatePanel` is not on that list. So the request is denied with: ``` "msg": "this API token is not permitted to access this endpoint" ``` The central panel sends exactly that route (`internal/web/runtime/remote.go:677`, `r.do(ctx, http.MethodPost, "panel/api/server/updatePanel", body)`). When a node answers with anything other than 200, the error is shown as `POST panel/api/server/updatePanel: HTTP 403: "..."` (`remote.go`, the `resp.StatusCode != http.StatusOK` branch). v3.8.5 has the same mTLS-first logic, which explains why the older panel fails too. ### What changed on the default branch `a8d0700b fix(auth): add node-admin token scope for panel updates (#6666)` adds `nodeAdminScopeAllow` with only `"/server/updatePanel": {http.MethodPost: {}}` (`internal/web/controller/api.go:127-129`). On mTLS, only a `node-admin` bearer raises the scope (`api.go:52-58`). This is deliberate (`docs/architecture.md`, scope table): *"On an mTLS connection, only a valid `node-admin` bearer elevates the request; other bearer scopes retain the historical mTLS `node-sync` behavior."* So even on the new code, an `admin` or `node-sync` token over mTLS still cannot start a remote update. ### What you can do now 1. On each node, update from its own shell first. The central panel can't update it yet: ```bash x-ui update-dev # dev channel, carries a8d0700b; or wait for the next release and use `x-ui update` ``` 2. On the node, go to **Settings → Security → API tokens** and create a token with scope **node-admin**. 3. Put that token into the node's entry on the central panel's **Nodes** page. After that, **Update panel** from the Nodes page should get past the auth check. ### Please reply with 1. The exact error text from the screenshot. It tells me whether this is the 403 above or a different failure, such as `node is offline`. 2. The node's TLS mode on the central panel (`verify` / `skip` / `pin` / `mtls`), and the scope of the token you set for that node. ``` Verdict: Already fixed Severity: Medium Confidence: Medium Root cause: v3.10.2 internal/web/controller/api.go checkAPIAuth/enforceTokenScope - mTLS is forced to node-sync, and /server/updatePanel is absent from nodeSyncScopeAllow, so the node returns 403 to the central panel's updatePanel call. Same class: None found (Remote.UpdatePanel, remote.go:672, is the only caller of the node's updatePanel route; NodeService.UpdatePanels, service/node.go:937, fans out to it) Already fixed: a8d0700b (#6666), on dev-latest only; not in v3.10.2 or any tagged release Duplicate of: Related: #6666 (the fix), #5769 (least-privilege node scopes) Evidence: api.go:127-129 nodeAdminScopeAllow; api.go:52-58 mTLS elevation only for node-admin; remote.go:672-678; git tag --contains a8d0700b -> dev-latest only Not determined: The exact error in the screenshot. A 403 "not permitted" message confirms this cause; any other text points to a different failure. ``` *This reply was generated automatically; a maintainer may follow up.* <!-- claude-issue:analyst -->
Author
Owner

@ArtikBoom3007 commented on GitHub (Oct 26, 2026):

  1. Error text:
    "Update triggered on 0 node(s), 1 failed — POST panel/api/server/updatePanel: HTTP 403: "{"msg":"this API token is not permitted to access this endpoint","success":false}"

  2. TLS mode is mtls. No token scope provided, it was generated in old version

<!-- gh-comment-id:6422736038 --> @ArtikBoom3007 commented on GitHub (Oct 26, 2026): 1. Error text: "Update triggered on 0 node(s), 1 failed — POST panel/api/server/updatePanel: HTTP 403: "{\"msg\":\"this API token is not permitted to access this endpoint\",\"success\":false}" 2. TLS mode is mtls. No token scope provided, it was generated in old version
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#4583
No description provided.