6.5medium
SQL Injection in the KubeClarity REST API
- Severity
- 6.5medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.44% (higher than 40% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-5248-h45p-9pgwGO-2024-2981
Description
KubeClarity is a tool for detection and management of Software Bill Of Materials (SBOM) and vulnerabilities of container images and filesystems. A time/boolean SQL Injection is present in the following resource `/api/applicationResources` via the following parameter `packageID`. As it can be seen in backend/pkg/database/id_view.go, while building the SQL Query the `fmt.Sprintf` function is used to build the query string without the input having first been subjected to any validation. This vulnerability is fixed in 2.23.1.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| openclarity kubeclarity | < 2.23.1, before 2.23.1 | CVE List |
| github.com/openclarity/kubeclarity/backend (Go) | before 0.0.0-20240711173334-1d1178840703 | GitHub Advisory Database, Go Vulnerability Database |
All scores
| GitHub_M | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N |
| GitHub | 6.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N |
| GitHub | high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.
What each source says
CVE List
KubeClarity is a tool for detection and management of Software Bill Of Materials (SBOM) and vulnerabilities of container images and filesystems. A time/boolean SQL Injection is present in the following resource `/api/applicationResources` via the following parameter `packageID`. As it can be seen in backend/pkg/database/id_view.go, while building the SQL Query the `fmt.Sprintf` function is used to build the query string without the input having first been subjected to any validation. This vulnerability is fixed in 2.23.1.
GitHub Advisory Database
Summary
A time/boolean SQL Injection is present in the following resource /api/applicationResources via the following parameter packageID
Details
As it can be seen here, while building the SQL Query the fmt.Sprintf function is used to build the query string without the input having first been subjected to any validation.
PoC
The following command should be able to trigger a basic version of the behavior:
curl -i -s -k -X $'GET' \ -H $'Host: kubeclarity.test' \ $'https://kubeclarity.test/api/applicationResources?page=1&pageSize=50&sortKey=vulnerabilities&sortDir=DESC&packageID=c89973a6-4e7f-50b5-afe2-6bf6f4d3da0a\'HTTP/2'
Impact
While using the Helm chart, the impact of this vulnerability is limited since it allows read access only to the kuberclarity database, to which access is already given as far as I understand to regular users anyway. On the other hand, if Kuberclarity is deployed in a less secure way, this might allow access to more data then allowed or expected (beyond the limits of the KuberClarity database). The vulnerable line was introduced as part of the initial commit of Kubeclarity, so all versions up until the latest (2.23.1) are assumed vulnerable.
Go Vulnerability Database
SQL Injection in the KubeClarity REST API in github.com/openclarity/kubeclarity/backend
NVD (es)
KubeClarity es una herramienta para la detección y gestión de listas de materiales de software (SBOM) y vulnerabilidades de imágenes de contenedores y sistemas de archivos. Una inyección SQL booleana/hora está presente en el siguiente recurso `/api/applicationResources` a través del siguiente parámetro `packageID`. Como se puede ver en backend/pkg/database/id_view.go, mientras se construye la consulta SQL, la función `fmt.Sprintf` se utiliza para construir la cadena de consulta sin que la entrada haya sido sometida primero a ninguna validación. Esta vulnerabilidad se solucionó en 2.23.1.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-39909 changed 2024-08-02 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-5248-h45p-9pgw changed 2026-09-10 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2024-2981 changed 2026-03-03 | CC-BY-4.0 |
| NVD | CVE-2024-39909 changed 2026-06-17 | Public domain |