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

    Threat Intelligence

    Exploit Maturity
    Proof of concept
    EPSS
    0.05% (17th 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 ID SNYK-GOLANG-GITHUBCOMOPENCLARITYKUBECLARITYBACKENDPKGDATABASE-7448452
  • published 14 Jul 2024
  • disclosed 12 Jul 2024
  • credit b-abderrahmane

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 Scores

version 4.0
version 3.1
Expand this section

Snyk

Recommended
4.9 medium
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    High
  • Attack Requirements (AT)
    None
  • Privileges Required (PR)
    Low
  • User Interaction (UI)
    None
  • Confidentiality (VC)
    Low
  • Integrity (VI)
    None
  • Availability (VA)
    None
  • Confidentiality (SC)
    High
  • Integrity (SI)
    None
  • Availability (SA)
    None