Milesight MilesightVPN requestHandlers.js LoginAuth SQL injection vulnerability
The login function in MilesightVPN builds a SQL query by concatenating user input, allowing an attacker to inject SQL and bypass authentication. An attacker can send a crafted request to log in as any user without knowing the password.
Originally disclosed on Cisco Talos
A sql injection vulnerability exists in the requestHandlers.js LoginAuth functionality of Milesight VPN v2.0.2. A specially-crafted network request can lead to authentication bypass.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The SQL query is built by concatenating user input directly into the string instead of using a prepared statement.
What the attacker needed
Network access to the MilesightVPN web interface
How it was found
- Send a POST request to the /LoginAuth endpoint with a crafted user parameter that includes SQL comment syntax.
- Observe that the server responds with a success status and sets a token cookie, indicating authentication bypass.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
The login page checks your username and password by putting them directly into a database command. Because it does not separate the input from the command, someone can type special characters that change the command's meaning. This lets them log in without a valid password.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.