GHSL-2024-013_GHSL-2024-014: SQL injection vulnerability in Meshery - CVE-2024-35181, CVE-2024-35182
Two SQL injection vulnerabilities in Meshery allowed a remote attacker to inject arbitrary SQL via the order and sort parameters of two HTTP endpoints, enabling data theft, database modification, and arbitrary file write through stacked queries.
Originally disclosed on GitHub Security Lab
A SQL injection vulnerability in Meshery up to v0.7.22 allows a remote attacker to obtain sensitive information, alter database registries, or create arbitrary files via the order and sort parameters of two HTTP endpoints.
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 application directly concatenated user-supplied order and sort parameters into SQL queries without parameterisation or validation.
Impact
Attackers could read and modify any database data, including performance profiles that may contain session cookies, and write arbitrary files on the server; the impact depends on authentication, authorisation, and the sensitivity of stored data.
What the attacker needed
Network access to the Meshery server; a valid session cookie (or local auth cookie)
The fix
The vulnerabilities were fixed in a pull request.
How it was found
- Send a request to the first endpoint with a crafted order parameter that attaches a new database file.
- Send a second request to create a table in the attached database.
- Send a third request to insert data into that table, resulting in a file with attacker-controlled content.
- Alternatively, use blind SQL injection techniques (e.g., with sqlmap) to extract data from the database.
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.
SQL injection is when user input is inserted directly into a database command without proper handling, letting an attacker change the command's meaning. Here, the order and sort parameters were used to build SQL queries, so an attacker could run their own SQL commands, read or change data, and even write files on the server.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.