fix: Changed order of escape to prevent RCE#5498
Open
Yasha-ops wants to merge 1 commit intoNginxProxyManager:developfrom
Open
fix: Changed order of escape to prevent RCE#5498Yasha-ops wants to merge 1 commit intoNginxProxyManager:developfrom
Yasha-ops wants to merge 1 commit intoNginxProxyManager:developfrom
Conversation
|
Docker Image for build 1 is available on DockerHub: Note Ensure you backup your NPM instance before testing this image! Especially if there are database changes. Warning Changes and additions to DNS Providers require verification by at least 2 members of the community! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Nginx Proxy Manager is vulnerable to authenticated remote code execution due to a shell injection in
setupCertbotPlugins()(backend/setup.js).The user-controlled field
dns_provider_credentialsis interpolated into a shell command executed viachild_process.exec()without proper escaping.An attacker with
certificates:managepermission can inject arbitrary commands, executed on backend restart (typically asrootin Docker deployments).Affected Versions
Root Cause
Incorrect escaping order:
Backslashes are escaped after single quotes, breaking the protection and allowing injection.
Example input:
Results in command execution:
Exploitation
dns_provider_credentials(DB or race condition)/bin/sh -cinsideexec()Reliable in Docker since
/etc/letsencrypt/credentials/is not persisted.Example payload:
Impact
Fix