Skip to content

Security: logm1lo/dusicbox

Security

docs/SECURITY.md

Security boundaries

Secrets

Use independent high-entropy values for the Discord token, Lavalink password, component signing secret, media proxy signing secret, metrics bearer token, and database password. When Spotify is enabled, its client secret must also be independent and protected. Do not place production secrets in .env on a shared host. Mount them through the deployment platform's secret mechanism and expose them to the process at runtime.

Pino structurally redacts tokens, authorization values, passwords, secrets, cookies, and playback URIs. The repository audit script rejects common secret formats, prompt artifacts, generated attribution, and unexpected binary files before a user-requested commit or push.

Discord controls

Music mutations require the caller to be in voice. If the player already exists, the caller must be in the same channel. Connect and Speak permissions are checked before player creation. Component IDs carry a version, guild, optional user authorization, action, expiry, nonce, and HMAC. Expired, modified, cross-guild, and user-mismatched components are rejected.

Outbound media

The media proxy denies non-HTTP schemes, URL credentials, non-allowlisted hosts, loopback, private, link-local, documentation, multicast, and reserved IP ranges. It repeats checks after redirects. The default deployment keeps the proxy inside the Lavalink network. The Raspberry Pi deployment binds it to Oracle localhost and exposes it only through a restricted Tailscale TCP service for the remote Lavalink node.

DNS can change between validation and connection in the Node fetch stack. The proxy rejects any resolved private address immediately before each request, but the current implementation does not bind a validated address directly to the socket. Operators should use stable fixture origins and outbound firewall rules. A future hardened deployment can add an egress proxy that pins resolved destinations.

Container posture

Images are pinned by manifest digest. The bot runs as the Node image's non-root user with a read-only root filesystem, a temporary /tmp, no Linux capabilities, and no-new-privileges. Lavalink is read-only with no capabilities. The Pi container binds only to 127.0.0.1; Tailscale provides its private listener and access policy. PostgreSQL retains only the capabilities required by its official entrypoint. Data services use an internal network and publish no ports.

Reporting

Do not include real tokens, private guild IDs, private audio, or member information in issue reports. Replace correlation identifiers and provider URLs when they expose private deployment details.

There aren't any published security advisories