This page is the security assessment of Bunryu for reviewers. It states what the system exposes and what protects it, then lists the points a review is likely to raise, each with the reason it is accepted, what limits the risk and when to revisit it. The controls themselves are described in Security; this page links to them instead of repeating them.
Scope: the Node.js control plane (REST API and dashboard), its use of SRS, the Goryu SRT relay and FFmpeg, and the native installer, which is the supported production deployment. Version 3.1.0, reviewed November 2026.
Out of scope: the Docker image (Dockerfile, compose.yaml, docker/). It is for
testing, demos and development, not production (Docker),
and does not get the native install's service users and systemd hardening. Its
defaults, such as publishing the dashboard port on every interface, are not findings.
System and trust boundaries
| Listener | Exposure | Protection |
|---|---|---|
Dashboard and API, 8080/tcp |
Not opened by the installer. Meant to be reached through a zero-trust tunnel (Remote access) | Tunnel identity check, then the dashboard password and a session cookie |
RTMP ingest, 21935/tcp |
Reachable by encoders; the recommended setup allows only their IPs in the cloud firewall | Per-pipeline stream key checked by SRS's on_publish hook; playback refused |
SRT ingest, 10080/udp and 10081/udp |
Reachable by encoders; allowlisted like RTMP where the encoders' IPs are fixed | Passphrase checked at the handshake, then the same stream key check |
SRS HTTP API, 1985/tcp |
Loopback only | Bound to 127.0.0.1 in srs.conf |
SRS hooks, 8082/tcp |
Loopback only | Bound to 127.0.0.1; a separate listener from the dashboard |
Relay status, 8081/tcp |
Loopback only | Goryu binds it to 127.0.0.1; read by the app only |
Outbound connections: one FFmpeg per output to the destinations the operator configures, and, if set up, one HTTPS report a minute to Key Vault.
What an attacker would want, in order of value: the stream keys and destination URLs (a destination URL can contain a platform's own stream key, which lets someone broadcast as the organisation), the SRT passphrase, the dashboard password, and the ability to interrupt a live stream.
| Actor | What they can reach | Main limit |
|---|---|---|
| Internet scanner | Ingest ports, and the dashboard port if it is exposed | Unknown keys and apps are refused before any stream starts; login is rate limited |
| Publisher with a valid key | One pipeline's input | The key only authorises publishing to its own pipeline; the public ports cannot play streams back |
| Holder of the dashboard password | Everything in the dashboard | One role by design (see the first point below) |
| Compromised media component (SRS, Goryu, FFmpeg) | The service user's files | See the installer point below |
Controls in place
| Area | Control | Detail |
|---|---|---|
| Authentication | scrypt password hash (the password is never stored in a file), 12-character minimum when set or changed, 7-day sessions stored as SHA-256 hashes, revoked on password change and logout | Security |
| Brute force | 5 failures a minute per client (IPv6 grouped by /64), then a 5-minute block; scrypt runs off the event loop | Security |
| Cross-site requests | SameSite=Strict cookie, JSON-only bodies, and a browser-declared cross-site write is refused |
Security |
| Browser hardening | A Content-Security-Policy that runs only the dashboard's own scripts; frame, sniffing, referrer, device-feature and cross-origin-embedding headers; HSTS over TLS; API answers are no-store; the dashboard escapes everything it renders |
Security |
| Input validation | Bounded names, URLs and counts; destination schemes limited to rtmp, rtmps and srt; arguments passed to FFmpeg as an argument list, never through a shell |
Security |
| Outbound policy | Link-local, unspecified and loopback destinations refused by what the host resolves to, with the same host parsing FFmpeg uses; the reserved internal app refused; restream loops marked on the output card (SRS refuses the second publisher) |
Security |
| Process isolation | FFmpeg gets a minimal environment; the three services run as an unprivileged user; the application tree is root-owned | Security |
| Ingest | Per-server random SRT passphrase, per-pipeline stream keys of 128 random bits, publish and play hooks, non-default RTMP port | Security |
| Data access | One embedded SQLite database; every query is parameterised and the only dynamic SQL is a column list built from constants | src/db/index.ts |
| Secrets at rest | No secret has a default on a production install; the database is mode 600 and the configuration directory mode 750 | Install |
| Supply chain | SRS, Goryu and FFmpeg pinned with SHA-256 checks; npm ci with integrity hashes; Dependabot for npm, GitHub Actions and the Docker base images; CodeQL; every GitHub Action pinned to a commit |
.github/ |
| Resilience | A malformed request, a failed output or an uncaught error does not stop the server; restart and watchdog loops are bounded | Reliability |
Unauthenticated routes are /api/ready (a bare {"ok":true}), /api/auth/login, the
login page and the static dashboard files, which contain no secrets. Every other /api
route, and the HLS previews, require a session.
Points a review may raise
One shared password, no accounts, roles or MFA
The dashboard has a single password and every signed-in user can do everything. This is intended for a small crew running one live event, where per-user accounts would add a user store to maintain and a way to lock the team out mid-event. The identity layer is the zero-trust tunnel, which provides per-person authentication, MFA and audit; the password is a second factor behind it. Sessions can be revoked all at once by changing the password. Revisit if the dashboard must be operated by people with different privileges.
The application does not terminate TLS
The server listens on plain HTTP. TLS is provided by the tunnel or reverse proxy in front
of it, and the session cookie gets Secure and HSTS is sent when the request arrived over
TLS. A direct exposure of port 8080 without a proxy would send the password in clear text,
which is why the installer does not open it and the documentation says to keep it closed.
The Content-Security-Policy allows inline style attributes
The dashboard runs only its own script files: the policy refuses inline script, inline
event handlers and eval, and any other origin for scripts, API calls or media, and a test
fails the build if an inline handler or script reappears in the pages or in the markup the
dashboard builds. Inline style attributes stay allowed (style-src-attr), because the
markup sets a few and a style cannot run script; blob: is allowed only for the preview
player's media and worker. Every value from the server is still escaped before it reaches
HTML, so the policy is a second line of defence, not the only one.
Defaults in the repository
npm run dev seeds a fresh development database with the password admin, and
srs.conf and goryu.json ship a public SRT passphrase. They exist so a first run from a checkout works without
setup, and the password can be changed straight away in Settings. Neither reaches a
production system:
- The installer refuses to run without a dashboard password you supply, and never generates, prints or defaults one. The Docker image, which the review does not cover and which is for trying Bunryu, generates a random password and prints it once in the container log when none is supplied.
- The installer replaces the SRT passphrase with a per-server random value.
- A production start that still has the public or an empty passphrase logs a warning.
Ingest over RTMP is not encrypted and its only credential is the stream key
RTMP carries the key and the video in clear text, as the protocol does. Each pipeline has
its own key, an unknown key or an app other than live is refused before anything is
forwarded. For links that cross an untrusted network the same input accepts SRT, which is
encrypted with a per-server passphrase checked at the handshake. The RTMP port is a
non-default one to keep scanner noise out of the logs.
A leaked key is not revoked by moving its pipeline to another key or deleting the pipeline: a publisher already on the old key stays connected, and the old key goes back into the pool and is given to the next new pipeline. Disconnecting it on a move would have to check that no other pipeline shares the key (sharing is allowed), for a case the deployment already limits: the recommended setup accepts publishes only from the encoders' IPs (Denial of service), and a publisher on a key no pipeline uses feeds no outputs. To retire a leaked key, stop the encoder that holds it and leave its slot unused, or regenerate all keys in Settings when no pipelines exist.
A publisher chooses the protocol it is labelled with
The publish hook tells SRT from RTMP by the client's tcUrl, which an RTMP client sets
itself. A wrong label changes only the protocol shown in the logs and the rejected
publishers list, and whether a second publish with the same stream key is refused as a
change of protocol, which is a reliability guard: that publisher already holds the key.
It grants nothing, since the shared-encode app accepts only an RTMP publish from this host,
and claiming SRT only gets such a publish refused.
RTMPS output certificates are not verified
FFmpeg's default for rtmps:// destinations is not to verify the server certificate, and
Bunryu keeps that default. The risk is an attacker on the network path between the server
and a streaming platform who presents their own certificate and reads the stream key. It is
accepted for three reasons:
- Outputs leave from a server in a data centre, so the attacker needs a position on the provider or platform side of the path (a BGP or DNS hijack, a compromised network provider), not on a venue's network.
- Most destinations in use are plain
rtmp://, which sends the stream key in clear text to anyone on the same path without any certificate. Verifying RTMPS alone would not change what such an attacker can obtain; moving a destination tortmps://where the platform offers it protects more than verification would. - A verification failure (a platform's certificate chain change, an outdated CA bundle, how the pinned static FFmpeg finds certificates) stops a live output, which is the worse failure in the middle of an event.
The output environment already passes SSL_CERT_FILE and SSL_CERT_DIR, so verification
can be switched on later. Revisit if outputs move mostly to RTMPS, or when verification
has been tested against the platforms in use. See Design decisions.
The server connects to destinations an operator types in
An output URL makes the server open a connection, so a stolen session could aim it at internal hosts. Link-local addresses (cloud metadata), the unspecified address and loopback outside the server's own ingest ports are refused, judged by what the name resolves to and with the host parsed as FFmpeg parses it; a URL with no host, which FFmpeg would resolve to this machine, is refused. Private LAN ranges are allowed on purpose, because pushing to a venue encoder or a local media server is a real use. DNS that changes between the check and FFmpeg's own lookup cannot be ruled out. Key Vault reports use the same host check and refuse redirects. The connection speaks RTMP or SRT, not HTTP, and only FFmpeg's own error text comes back, so it cannot be used to read the content of internal services.
SRT listener outputs accept connections
An output whose SRT URL has mode=listener does not connect out: FFmpeg opens a UDP port
on the server and sends the pipeline's stream to whoever connects to it, with no stream
key and with no passphrase unless the URL sets passphrase=. It is allowed because some
receivers can only call in, such as a decoder that runs only as an SRT caller. Only a
signed-in operator can create one, and the port is reachable only where the host or cloud
firewall opens it; the documented firewall ports
include none for outputs. An operator who opens such a port should set a passphrase in
the URL. Revisit if listener outputs are used on hosts with an open firewall.
Secrets visible to a signed-in user and in the logs
The dashboard shows publish URLs and the SRT passphrase to any signed-in user, because configuring an encoder needs them (they are masked by default and revealed for a few seconds). Logs, the output History and the diagnostics files keep FFmpeg's error text as it is, including destination URLs. This is deliberate: a redacted log cannot explain why an output failed during an incident. The logs are private to the server and to its operators, are rotated and size-capped, and the documentation says to redact before copying any of them elsewhere. The report sent to Key Vault is the exception: destinations leave the server only as an HMAC hash and error text is redacted.
Secrets in process arguments
An FFmpeg process receives the input URL (with the SRT passphrase when the input is SRT) and the destination URL as arguments, so any local account on the host can read them from the process list. There is no way to pass them through an option file or environment variable to FFmpeg's network protocols without losing the URL-based configuration, and the server is meant to be a dedicated machine with no untrusted local users. The installer also passes the SRT passphrase to short-lived helper commands, for seconds. The dashboard password only ever travels in the environment, never in arguments.
Connections through the relay reach SRS from loopback
SRS allows playback only from this host, and a connection that arrives through the Goryu relay comes from loopback, so the play check would let it through. The relay only carries streams into SRS, never out, and connecting to it needs the SRT passphrase, so no stream can be read through it.
The dashboard and FFmpeg share one user
SRS and Goryu parse traffic from the internet before any stream key is checked, so they run
as their own user, bunryu-media, which can read only their two configuration files. Their
units hide the data directory, drop every capability, allow only ordinary system calls and
make the rest of the system read-only; Goryu is also refused memory that is both writable
and executable, which the official SRS build needs for its thread stacks. The dashboard and
the FFmpeg processes it starts run as bunryu, which owns the database. FFmpeg parses the
media a publisher sends, but only after SRS has accepted its stream key. The dashboard's
unit has NoNewPrivileges, ProtectSystem=full, PrivateTmp and write access limited to
the data and configuration directories; restricting it further would need testing with
every FFmpeg path. The service user can also read the system journal, which is how the
dashboard shows the three services' logs.
The installer runs as root and trusts what it fetches
The installer is run by an administrator. It installs Node.js from the NodeSource
repository, updates the application from the repository's default branch and installs the
npm dependencies. In the configuration and data directories, which the service user owns,
root only creates the two directories; every file inside is read, written and given its mode
as the service user. A link that user plants there therefore reaches nothing it could not
already write. The media binaries are fetched at pinned versions and verified by
SHA-256, and npm ci runs with install scripts disabled apart from the one native module the
application needs. The remaining trust is in the project's own repository and in the
NodeSource script, the same trust a package-manager install of any server software places
in its source.
The login limit is per client address
The five-failure limit is keyed on the client address. Behind a proxy with
trust_proxy unset, everyone shares the proxy's address and a few mistyped passwords
lock the dashboard for five minutes. This is the safer failure: a guessing flood cannot
be spread across spoofed headers, and ingest and the running outputs are not affected.
The remote-access guide sets trust_proxy for the tunnel. Even then the forwarded
address is used only on a connection from loopback, where the tunnel runs, so a client
that reaches the port directly cannot choose its own address with an X-Forwarded-For
header, and a forwarded value that is not an IP address is ignored.
A process that is already running on the server can connect from loopback and send a new
forwarded address with each attempt, so with trust_proxy set the limit does not apply to
it. This is accepted: it needs code running on the host (a compromised SRS or Goryu, say),
and at the rate scrypt allows, a long random password cannot be guessed anyway; a password
of that kind is the control here. A second, shared limit for every forwarded login was
considered and rejected, because such a process could use it to lock everyone using the
tunnel out of the login page.
Sessions last seven days and have no idle timeout
A session is valid for seven days from login so an operator is not signed out during a
multi-day event. Sessions are stored only as hashes, are revoked by logout and by a
password change, and the cookie is HttpOnly and SameSite=Strict.
The database is not encrypted
The SQLite database holds the stream keys, destination URLs and the password hash. It is readable only by the service user and root. Encryption at rest is the job of the host's disk encryption, which cloud virtual machines provide by default; an application-level key would have to be stored on the same machine.
Denial of service
SRS's connection cap (1000) on the ingest ports is shared by every client, including the server's own FFmpeg processes on loopback, and has no per-source limit, so one host holding enough idle connections could stop encoders and outputs from reconnecting. The control for this is the deployment: the recommended production setup opens the ingest ports only to the encoders' IPs in the cloud firewall (Install). A server whose encoders have no fixed IPs has this exposure on the RTMP port; a per-source limit on the host is tracked in issue #35. For a large or high-risk event, put a provider DDoS layer or an ingest edge in front of the origin.
The other unauthenticated surfaces are bounded. A flood of refused publishes is counted in a fixed-size structure and logged once a minute per key, with the stream name cut to 128 characters; allowed publishes are logged once every 10 seconds per pipeline, so a publisher that reconnects in a loop cannot flood the logs either. Login attempts are rate limited and their hashing does not block the event loop. Request bodies are capped at 1 MB. The dashboard is sized for about ten clients; authenticated API calls are not rate limited because the users are the operators.
Third-party components
The application has three runtime npm dependencies (Express, compression and
better-sqlite3), and npm audit --omit=dev reports no known vulnerabilities. The dashboard
ships one vendored library, hls.js, which only parses playlists produced by the
application's own FFmpeg on the same origin. SRS is an official static build, so it
receives no distribution patches; it is updated by changing the pinned version in the
installer. The pins are listed in Install.