NginxProxyManager / NginxProxyManager/nginx-proxy-manager

[Security] API Should not return Certificate Private Keys

Open
#5,128 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug stale
Dominant language
TypeScript
Stars
34.2k
Forks
3.9k
Avg merge
21h 12m
Merged PRs (30d)
20

Description

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    • Yes
  • Are you sure you're not using someone else's docker image?
    • Yes
  • Have you searched for similar issues (both open and closed)?
    • Yes

Describe the bug

The API returns the Private Keys for manually uploaded Certificates on every get request to /api/nginx/certificates. This can be captured through the dev console or directly by requesting the endpoint directly.

For security, there is no good reason to return the Private Key of stored certificates to anyone as you only need the public data to identify the certificate and its validity.

There is a point to say that it is secured behind authentication, but even then, transmitting this information outside of the Nginx environment is neither desired nor required behaviour.

Nginx Proxy Manager Version

v2.13.5

To Reproduce
Steps to reproduce the behavior:

Requirements
A manually uploaded certificate & key.

  1. Open your Browser Developer Console
  2. Click on 'Network'
  3. Browse to the "Certificates" Tab in NPM
  4. Look at the response data for the call to "/api/nginx/certificates" for the key: meta.certificate_key

Expected behavior

The meta JSON key should instead at most contain a summary of the private key information (e.g. key length & cipher) as oppose to sending the full key back in the response.

Contributor guide

No contributing guide indexed for this repository

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 reproducing the GET request to /api/nginx/certificates with a manually uploaded certificate, then trace the endpoint's response handling for meta.certificate_key. Done means the response no longer exposes the full private key and contains only the intended public certificate data or a private-key summary.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.