Repository navigation
Fix command injection in SSID and OpenVPN cfg_id handling - #2161
Merged
Merged
Conversation
CVE-2026-101858: WiFiManager::writeWpaSupplicant() called escapeshellarg() before ssid2utf8(), so an SSID containing \x27 was decoded into a literal quote after escaping. That broke out of the quoting and allowed commands to run as www-data. The SSID is now decoded first and escaped second. CVE-2026-101859: del_ovpncfg.php passed $_POST['cfg_id'] through escapeshellcmd() into "sudo rm", which allowed path traversal and deletion of arbitrary files as root. cfg_id is now validated against /^[A-Za-z0-9_-][A-Za-z0-9._-]*$/D. Instead of an_*.conf glob, only _client.conf and _login.conf are removed, with each path quoted. The glob also deleted unrelated configs with a matching prefix (e.g. deleting "foo" also removed "foo_bar"). activate_ovpncfg.php had the same cfg_id pattern feeding "sudo ln -s" and gets the same validation and quoting. Invalid ids now return HTTP 400 with a JSON body. Co-Authored-By: Claude Opus 5.5
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.
CVE-2026-101858: WiFiManager::writeWpaSupplicant() called escapeshellarg() before ssid2utf8(), so an SSID containing \x27 was decoded into a literal quote after escaping. That broke out of the quoting and allowed commands to run as www-data. The SSID is now decoded first and escaped second.
CVE-2026-101859: del_ovpncfg.php passed $POST['cfg_id'] through escapeshellcmd() into "sudo rm", which allowed path traversal and deletion of arbitrary files as root. cfg_id is now validated against /^[A-Za-z0-9-][A-Za-z0-9.-]*$/D. Instead of an *.conf glob, only _client.conf and _login.conf are removed, with each path quoted. The glob also deleted unrelated configs with a matching prefix (e.g. deleting "foo" also removed "foo_bar").
activate_ovpncfg.php had the same cfg_id pattern feeding "sudo ln -s" and gets the same validation and quoting.
Invalid ids now return HTTP 400 with a JSON body.