Skip to content

DoS attack based on SQL Injection

High
arthurzam published GHSA-gp8g-jfq9-5q2g Feb 24, 2023

Package

gentoo/soko (github.com)

Affected versions

< 1.0.1

Patched versions

1.0.1

Description

Impact

If the user selects in user preferences the "Recently Visited Packages" view for the index page, the website backend uses the value of search_history cookie as base64 encoded comma separated list of atoms, which are string loaded directly into the SQL query with atom = '%s' format string. As a result, any user can modify the browser's cookie value and inject most SQL queries. A proof of concept malformed cookie was generated that wiped the database or changed it's content.

On the database, only public data is stored, so there is no confidentiality issues to our users. If known that the database was modified, a full restoration of data is possible by performing a full database wipe and performing full update of all components.

Patches

  • 5ae9ca83b73 commit id contains the patch

Workarounds

  1. Use a proxy to always drop the search_history cookie until upgraded. The impact on user experience is low.
  2. Add sanitize to the value of search_history cookie after base64 decoding it.

References

  1. https://gitweb.gentoo.org/sites/soko.git/commit/?id=5ae9ca83b735804f2bd405592983a73d7fcc42f4

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

CVE ID

CVE-2023-26033

Weaknesses

Credits