Koenkk / Koenkk/zigbee2mqtt

Unix socket (for serving frontend) created with insufficient permissions

Open Beginner friendly
#32,798 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

problem
Dominant language
TypeScript
Stars
15.7k
Forks
2k
Avg merge
18h 55m
Merged PRs (30d)
35

Description

What happened?

When using a unix socket to serve the frontend, the socket file is created with 0755 permissions (tested in the latest docker image).
Any reverse proxy will not be able to access the socket using group memberships.

What did you expect to happen?

Socket file to be created with 0660 or 0666 permissions.

How to reproduce it (minimal and precise)

In configuration.yaml:

frontend:
  enabled: true
  host: /run/zigbee2mqtt/zigbee2mqtt.sock

Run zigbee2mqtt and examine the sock file permissions.

Zigbee2MQTT version

2.13.0

Adapter firmware version

EmberZNet Rev 7.4.4

Adapter

SLZB-MR5U

Setup

Server:
Linux offshore 7.0.0-29-generic #29-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 17 20:52:35 UTC 2026 x86_64 GNU/Linux
Ubuntu 26.04 LTS
Docker image:
ghcr.io/koenkk/zigbee2mqtt:latest - b6b50173d575

Device database.db entry

No response

Debug log

No response

Notes

I have tested two fixes, via selectively patching frontend.js in the docker container.

  1. node_fs_1.chmodSync(host, 0o660); (after this.server.listen block for unix socket)
  2. this.server.listen({ path: host, readableAll: true, writableAll: true }); (for the unix socket block) - this makes a 0666 file

The method 1 fix is here:
https://github.com/inks007/zigbee2mqtt/blob/fix-unix-socket-permissions/lib/extension/frontend.ts

(I'm new to node.js and I don't know how to transpile the ts to test the direct fix)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading lib/extension/frontend.ts and locate the Unix-socket server.listen path. Reproduce the issue using the frontend.host configuration from the report and inspect the created socket permissions. Done means the socket is created with permissions that allow access through reverse-proxy group membership, while existing frontend serving still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.