CVE-2024-39909 SQL Injection in the KubeClarity REST API

Medium 6.5 Published Updated

Attackers can exploit SQL injection in the KubeClarity REST API to read or modify database contents via the packageID parameter.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-39909?

CVE-2024-39909 is a medium-severity SQL injection vulnerability in openclarity kubeclarity, published on 12 Jul 2024. Any signed-in user can exploit it over the network, with no action from the victim.

Official 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.

Weakness: CWE-89

Which versions are affected by CVE-2024-39909?

3 open source packages ship an affected version, including github.com/openclarity/kubeclarity/backend.

PackageAffectedFixed in
github.com/openclarity/kubeclarity/backend GoAll versions0.0.0-20240711173334-1d1178840703
github.com/openclarity/kubeclarity/backend GoAll versions0.0.0-20240711173334-1d1178840703
github.com/openclarity/kubeclarity/backend GoAll versions0.0.0-20240711173334-1d1178840703

How do I fix CVE-2024-39909?

Upgrade github.com/openclarity/kubeclarity/backend to 0.0.0-20240711173334-1d1178840703 or later.

Use parameterised queries everywhere and never build SQL by joining strings. Upgrade affected software first; a web application firewall only buys time. More about SQL injection.

Is CVE-2024-39909 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-39909 exists.

Sources

Also known as GHSA-5248-h45p-9pgw, GO-2024-2981.

Is CVE-2024-39909 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free