GHSL-2023-249: SQL injection vulnerability in Meshery - CVE-2024-29031
A SQL injection vulnerability in Meshery's GetMeshSyncResources endpoint allows an attacker to inject arbitrary SQL via the order parameter. This can lead to arbitrary file write, data modification, and data extraction, including session cookies.
Originally disclosed on GitHub Security Lab
A SQL injection vulnerability in Meshery up to v0.6.181 allows a remote attacker to obtain sensitive information via the order parameter of GetMeshSyncResources.
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 concatenates the user-supplied 'order' parameter into a SQL query without sanitisation or parameterisation.
Impact
An attacker could write arbitrary files, modify or read any data in the database, including session cookies and Kubernetes configurations, depending on authentication and authorisation settings.
What the attacker needed
Access to the API endpoint; a valid cookie (e.g., meshery-provider=None for local auth)
The fix
The vulnerability was fixed by the maintainers in a pull request.
How it was found
- Send a request to the endpoint with an order parameter that attaches a new database file.
- Send a request to create a table in the attached database.
- Send a request to insert data into the table.
- Verify the file was created with the expected content.
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 into a database query without proper handling, letting an attacker change the query's meaning. Here, the 'order' parameter is used directly in a database command, so an attacker can add extra commands to read or write files and data.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.