Skip to content
SQL injection Advisory Beginner CVE-2023-22319

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.

Francesco Benvenuto Follow

Originally disclosed on Cisco Talos

High 7.3 View original

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.

Francesco Benvenuto, on Cisco Talos

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

  1. Send a POST request to the /LoginAuth endpoint with a crafted user parameter that includes SQL comment syntax.
  2. 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.

More by Francesco Benvenuto

View all

152 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

SQL injection

The lesson behind this report.

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.