Repository navigation
Require a WPA2 password when the device is set up as an access point - #1338
Merged
Merged
Conversation
gskjold
force-pushed
the
require-ap-password
branch
from
December 4, 2026 09:20
82629c7 to
6ac9712
Compare
Access point mode accepted an empty password, which starts an open AP, and the web interface does not ask for a login in AP mode. A password of 1-7 characters was stored as well, although softAP() rejects it; the handler ignored that and reported the AP as up. - /save refuses AP mode with a password shorter than 8 characters. - setNetworkConfig() does not store a new AP config without a valid password, which also covers MQTT setconfig and config file import. A config already stored that way is left alone so its other fields can still be saved. - The AP handler checks the softAP() result and turns the radio off when it fails. - The setup and configuration forms require 8 characters in AP mode. Co-Authored-By: Claude Fable 5.2 <[email protected]>
gskjold
force-pushed
the
require-ap-password
branch
from
December 4, 2026 09:34
6ac9712 to
cd0799d
Compare
🔧 PR Build ArtifactsVersion: All environments built successfully. Download the zip files:
|
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.
Why
When the device is configured to run as an access point (network mode "AP"), nothing made sure the AP had a password:
WiFi.softAP()then starts an open network. In AP modecheckSecurity()grants access without the web login, so anyone in radio range could reach the full web interface.softAP(), but the handler ignored the return value and reported the AP as connected.The only guard was
requiredon the password field in the setup wizard (browser validation only, no minimum length). The configuration page had none.Changes
/saverefuses AP mode when the password is shorter than 8 characters, for both the setup wizard and the configuration page (***is resolved to the stored password first).AmsConfiguration::setNetworkConfig()does not store a new AP config without a valid WPA2 password. This is the common path for the web form, MQTTsetconfigand config file import. A config that is already stored as an open AP is left alone, so its other fields (hostname etc.) can still be saved.WiFiAccessPointConnectionHandler::connect()checks thesoftAP()result; on failure it turns the radio off and reports not connected.requiredwithminlength=8in AP mode.ui/distrebuilt.Not changed
messagefrom a failed/save, so the browser validation is what the user sees; the server check is the backstop.Verification
pio test -e native_config: 6/6 pass, including four new tests for the storage rule.pio run -e esp8266 -e esp32s2build. ESP8266 flash is at 99.2 %./saverejection, the form validation and thesoftAP()failure path are verified by reading and building only.🤖 Generated with Claude Code