NginxProxyManager / NginxProxyManager/nginx-proxy-manager
[Security] API Should not return Certificate Private Keys
Nobody has claimed this yet.
- 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:latestdocker 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.
- Open your Browser Developer Console
- Click on 'Network'
- Browse to the "Certificates" Tab in NPM
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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