Background

nginx-ignition is an open-source web interface for managing nginx. Instead of editing configuration files, an administrator uses a browser to define hosts (virtual servers and reverse proxies), TLS certificates, access lists and more. The application then generates the nginx configuration and reloads nginx. It is written in Go with a React front end, and the official deployment uses Docker.

It supports several users with different permissions. A permission pairs an area with an access level, for example Hosts:READ_WRITE (may view and edit hosts) or VPNs:NO_ACCESS (may not touch VPN integrations). Administrators can also define VPN integrations such as NetBird, and a host can be attached to one. When the configuration is applied, a driver writes the files the VPN client needs, including a generated config.json.

The program also serves its own web interface as static files from a directory (/opt/nginx-ignition/frontend in the official image). Anything inside that directory is downloadable by any visitor without logging in.

Terms used below:

  • Apply is the action that makes the application write out its configuration and reload.
  • Path is the location of a file in the filesystem. .. means “go up one directory”.

Summary

A host editor can supply a VPN entry name that directs generated credentials into a publicly served directory. The entry is accepted even when the editor has no permission to manage VPNs, then becomes a filesystem path when the configuration is next applied.

The trust boundary lies between a host-level name and the VPN driver’s storage location. A host configuration may refer to an administrator-created integration, but that reference should not let its editor select arbitrary directories in the running service. By targeting the frontend’s static files, the attacker turns the path traversal into an unauthenticated download of newly generated VPN credentials.

How the Vulnerability Works

Path traversal happens when an application builds a file path using text supplied by a user and does not stop that text from climbing out of the intended folder with ../. The program meant to work inside one directory. The attacker makes it work somewhere else.

Here the text comes from the name of a VPN entry attached to a host. When the configuration is saved, the name only has to be non-empty and unique. At apply time the NetBird driver uses it to choose where to write:

Go
filepath.Join(configDir, "netbird", name)

A common misunderstanding is that Join makes this safe. It does not. It combines the pieces and resolves .., so a name made of ../ segments walks up out of the NetBird folder (shown with the test deployment’s paths):

/tmp/nginx-ignition/vpn/netbird  +  "../../../../..//opt/nginx-ignition/frontend/vrpoc-leak"
   -> /opt/nginx-ignition/frontend/vrpoc-leak

The name above is the payload from the published proof of concept. In the test deployment the VPN configuration directory was /tmp/nginx-ignition/vpn, so the five ../ segments climb out of it to the filesystem root, and the rest names a new folder inside the frontend directory. The driver then writes its generated config.json, which contains freshly generated VPN keys, into that folder. Because the frontend directory is served publicly, the attacker downloads the file over HTTP without any login.

Two things make this reachable by a low-privilege user. The VPN entry is stored as part of a host, so a user with Hosts:READ_WRITE can supply it even with VPNs:NO_ACCESS. And nothing happens until an administrator next applies the configuration, which is a routine action. The write happens before the VPN connection is attempted, so the connection does not have to succeed. The poisoned entry does make the nginx apply fail afterwards, so every later reload fails too until the entry is removed.

The defence is to treat the name as an identifier, not a path. Reject separators, or resolve the final path and confirm it is still inside the intended folder. Credentials should never be stored under any directory that is served to the public. This is path traversal (CWE-22), combined with missing authorization on the VPN reference (CWE-862).

Prerequisites

The attacker needs Hosts:READ_WRITE, an existing administrator-created VPN definition, and a later configuration apply. The recorded account had VPNs:NO_ACCESS and could not directly list or manage VPNs.

Saving the malicious host entry alone does not trigger the write. It remains in the configuration until an apply makes the driver consume the name. The demonstrated chain used an administrator-triggered apply.

Attack Path

Attack route
Attacker routeMitigationCtrl + scroll to zoom
  1. START
    Host editor saves a VPN entry with traversal segments

    The account lacks VPN management permission but can influence a host’s VPN attachment.

    MITIGATION Validate entry names as path-free identifiers

  2. STEP 01
    Administrator applies the saved configuration
  3. STEP 02
    Driver resolves the name outside its config directory

    MITIGATION Enforce resolved-path containment before writing

  4. STEP 03
    Generated config lands inside the public frontend

    MITIGATION Keep credential storage outside all static roots

  5. STEP 04
    Unauthenticated visitor retrieves generated keys

Root Cause

The affected input is vpns[].name in POST/PUT /api/hosts. Host validation accepts a nonempty, unique value, and the driver later consumes it as endpoint.SourceName. In the NetBird path, filepath.Join(configDir, "netbird", name) resolves traversal segments rather than rejecting them. Joining a trusted base and an untrusted name is therefore not a containment check. The Tailscale driver builds its path the same way.

On configuration apply, the driver writes its generated config.json before attempting to establish a VPN connection. Targeting the official image’s /opt/nginx-ignition/frontend directory makes that config available through the static handler. Successful VPN connectivity is unnecessary for the write and read-back chain.

Validation

On the official 2.46.0 image, the proof of concept created an existing NetBird integration, then an account with only Hosts:READ_WRITE and VPNs:NO_ACCESS. An HTTP 403 response to GET /api/vpns confirmed the lack of direct VPN access. The account nevertheless saved a host VPN entry whose name traversed into a chosen subdirectory of the frontend root.

After an administrator-triggered configuration apply, an unauthenticated request for that subdirectory’s config.json returned HTTP 200. The generated file contained WireGuard and SSH private keys and the management endpoint. A benign-name control remained outside publicly served storage. The apply request itself was interrupted after the write, demonstrating that a failed reload does not imply the sensitive file was never created.

CheckExpected boundaryRecorded result
Host editor lists VPNsDenied without VPN permissionHTTP 403
Benign VPN entry nameState remains inside driver storageNot publicly served
Traversal name followed by applyReject output outside driver storageGenerated config written into frontend
Anonymous HTTP read-backNo access to generated credentialsHTTP 200 with generated key material

Impact

Three boundaries are crossed: a host editor influences VPN driver state, the driver writes outside its intended directory, and a static route exposes that output without authentication. The leaked file contains newly generated WireGuard and SSH private keys and the management endpoint.

The attacker selects the directory, while the driver determines the filenames and contents. This is not evidence of arbitrary reads of pre-existing private keys. Configuration applies can also fail while the poisoned entry remains, and that failure does not undo a sensitive file already written.

Remediation

Upgrade to 2.46.1 or later. Treat host-provided VPN names as untrusted path input and enforce containment before writing driver state. The advisory lists the patched release.

Validate names as identifiers rather than paths, and verify that the resolved output stays beneath the intended driver directory. Authorization should also govern attaching or influencing a VPN through host edits. Keeping generated secret material outside every static document root provides an additional boundary if path validation fails.

A failed apply is not a rollback guarantee. In this reproduction, sensitive files were written before a later stage failed. Reviewing the order of side effects is therefore necessary: validation and containment checks must run before the first filesystem write, not only before the final reload succeeds.

References