SQL Injection Affecting github.com/openclarity/kubeclarity/backend/pkg/database package, versions <2.23.2


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.05% (18th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about SQL Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-GOLANG-GITHUBCOMOPENCLARITYKUBECLARITYBACKENDPKGDATABASE-7448452
  • published14 Jul 2024
  • disclosed12 Jul 2024
  • creditb-abderrahmane

Introduced: 12 Jul 2024

CVE-2024-39909  (opens in a new tab)
CWE-89  (opens in a new tab)

How to fix?

Upgrade github.com/openclarity/kubeclarity/backend/pkg/database to version 2.23.2 or higher.

Overview

github.com/openclarity/kubeclarity/backend/pkg/database is a tool for detection and management of Software Bill Of Materials (SBOM) and vulnerabilities of container images and filesystems

Affected versions of this package are vulnerable to SQL Injection via the /api/applicationResources endpoint's packageID parameter, which is passed to fmt.Sprintf() in id_view.go without sanitization. This exposes the internal database to a user in a way that is only vulnerable when the application is not deployed via helm. Under a helm deployment, the user already has access to the database.

PoC

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'

CVSS Base Scores

version 4.0
version 3.1