Vulnerabilities in pkg:golang/github.com/openclarity/kubeclarity/backend
PACKAGECVE-2024-39909 is a HIGH (CVSS 6.5) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Github.com/openclarity/kubeclarity/backend libraries in the Go ecosystem. The issue involves sql injection in the kubeclarity rest api. Remediation is available by upgrading affected packages to version 0.0.0-20240711173334-1d1178840703.
pkg:golang/github.com/openclarity/kubeclarity/backend
Vulnerability advisories affecting package pkg:golang/github.com/openclarity/kubeclarity/backend. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-5248-h45p-9pgw | CVE-2024-39909 | HIGH | SQL Injection in the KubeClarity REST API |
CVE-2024-39909 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2024-39909
To remediate this vulnerability, upgrade all affected Github.com/openclarity/kubeclarity/backend dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/openclarity/kubeclarity/backend to 0.0.0-20240711173334-1d1178840703
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/openclarity/kubeclarity/backend
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-39909, inspect your project dependencies for Github.com/openclarity/kubeclarity/backend:
inspect dependencies for github.com/openclarity/kubeclarity/backend
Analyze the terminal output to locate any version of Github.com/openclarity/kubeclarity/backend in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.0-20240711173334-1d1178840703), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In Github.com/openclarity/kubeclarity/backend, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-39909 Affected Github.com/openclarity/kubeclarity/backend Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/openclarity/kubeclarity/backend
|
Go |
< 0.0.0-20240711173334-1d1178840703
|
0.0.0-20240711173334-1d1178840703
|
References
Frequently Asked Questions
What is CVE-2024-39909?
Which Github.com/openclarity/kubeclarity/backend versions are affected?
What version fixes CVE-2024-39909?
Is github.com/openclarity/kubeclarity/backend affected?
What is the CVSS score of CVE-2024-39909?
What CWE is associated with CVE-2024-39909?
How can I check Go dependencies for CVE-2024-39909?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5248-h45p-9pgw",
"modified" : "2024-11-18T16:26:51Z",
"published" : "2024-07-12T13:56:42Z",
"aliases" : [ "CVE-2024-39909" ],
"summary" : "SQL Injection in the KubeClarity REST API",
"details" : "### Summary\nA time/boolean SQL Injection is present in the following resource `/api/applicationResources` via the following parameter `packageID`\n\n### Details\nAs it can be seen [here](https://github.com/openclarity/kubeclarity/blob/main/backend/pkg/database/id_view.go#L79), 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.\n\n### PoC\nThe following command should be able to trigger a basic version of the behavior:\n`curl -i -s -k -X $'GET' \\\n -H $'Host: kubeclarity.test' \\\n $'https://kubeclarity.test/api/applicationResources?page=1&pageSize=50&sortKey=vulnerabilities&sortDir=DESC&packageID=c89973a6-4e7f-50b5-afe2-6bf6f4d3da0a\\'HTTP/2'`\n\n### Impact\nWhile 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.\nOn 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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"
}, {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/openclarity/kubeclarity/backend"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.0.0-20240711173334-1d1178840703"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/openclarity/kubeclarity/security/advisories/GHSA-5248-h45p-9pgw"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-39909"
}, {
"type" : "WEB",
"url" : "https://github.com/openclarity/kubeclarity/commit/1d1178840703a72d9082b7fc4aea0a3326c5d294"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/openclarity/kubeclarity"
}, {
"type" : "WEB",
"url" : "https://github.com/openclarity/kubeclarity/blob/main/backend/pkg/database/id_view.go#L79"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-89" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-07-12T13:56:42Z",
"nvd_published_at" : "2024-07-12T15:15:11Z"
}
}