/

CVE-2026-34455

Severity:

HIGH RISK

(8.8)

SQL Injection in Hi.Events Repositories

CVE-2026-34455

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Arbitrary SQL Execution and Data Compromise

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Multiple repository classes in Hi.Events accept a user-controlled sort_by query parameter and pass it directly into Eloquent's orderBy() without validation, enabling SQL injection.

In PostgreSQL-backed deployments, this can allow attackers to inject arbitrary SQL, potentially including stacked queries, when they can influence sorting parameters on list or search endpoints.

Affected context

This vulnerability occurs in Hi.Events when HTTP endpoints expose a sort_by (or similar) query parameter that is mapped directly into Eloquent's orderBy() method.

It typically appears in listing, searching, or filtering views where the client can choose how results are sorted.

The issue is most severe when the underlying database is PostgreSQL with support for stacked queries and when database privileges allow modification or exfiltration of sensitive tables.

Exploit preconditions

  • Attack surface: Public or authenticated web endpoints that accept a sort_by query parameter or equivalent.
  • Required access: Ability to send crafted HTTP requests to affected listing/search APIs or pages.
  • Trigger point: Backend repository classes calling orderBy() with user input interpolated into the column or direction argument without whitelisting or normalization.
  • Why exploitation is possible: Eloquent's orderBy() is invoked with unsanitized user data, allowing injection of arbitrary SQL fragments because the ORM does not automatically parameterize identifiers or raw expressions supplied by the caller.

Why this happens

The underlying bug is a classic SQL Injection (CWE-89) issue where user input is incorporated into SQL query construction without proper validation or parameterization.

Instead of restricting sort_by to a fixed set of known, safe column names and directions, the repositories pass the raw query parameter into orderBy(), effectively treating untrusted data as part of the SQL structure.

ORMs like Eloquent only provide protection when using bound parameters and explicit query building patterns; using dynamic strings for identifiers or expressions bypasses that safety and reintroduces direct string concatenation into SQL.

Potential impact

  • Reading data from tables that the application account can access, including user profiles, ticket information, and event metadata.
  • Modifying or deleting records, potentially impacting ticket sales, reservations, or event configuration.
  • Creating or modifying administrative or privileged accounts if the schema permits.
  • Executing stacked queries on PostgreSQL, which can further expand impact depending on database permissions and extensions.
  • Bypassing application-level authorization checks by directly querying or updating protected data.

General mitigation guidance

Effective mitigation centers on eliminating direct use of untrusted input in query structure and enforcing strict whitelisting:

  • Restrict sort_by and similar parameters to a predefined map of allowed sort keys and directions; reject or default on unknown values.
  • Use stable, internal identifiers (e.g., "name", "date", "price") that map to concrete column names instead of accepting arbitrary column or expression strings from the client.
  • Avoid passing raw user input into orderBy() or other query builder methods that treat arguments as identifiers or SQL fragments; prefer parameterized queries and ORM abstractions that do not expose SQL syntax directly.
  • Apply principle of least privilege at the database level so that even if a query is abused, the account has only minimal rights.
  • Centralize sorting and filtering utilities so that validation and whitelisting are consistently applied across all repositories.

How teams detect issues like this

High-level detection typically involves both code-centric and behavior-centric approaches:

  • Static analysis: Configure rules to flag uses of orderBy(), raw(), or similar query builder methods where arguments are derived from request parameters without validation against an allowlist.
  • Code review: During pull requests, examine any dynamic query-building logic, especially for sorting, filtering, and searching, to ensure only whitelisted fields and directions are permitted.
  • Security testing: Use automated scanners and fuzzing tools to send unexpected values in sorting and filtering parameters and observe database errors or anomalous responses that suggest SQL parsing issues.
  • Runtime monitoring: Enable database query logging or application-level instrumentation to detect irregular SQL patterns, including injected clauses or stacked statements, and correlate them with incoming requests.

Sources

SourceLink
github.comgithub.com/HiEventsDev/Hi.Events/commit/01e1aee28d7249f235fdcca8e3a34e88214dcde9
github.comgithub.com/HiEventsDev/Hi.Events/pull/1128
github.comgithub.com/HiEventsDev/Hi.Events/releases/tag/v1.7.1-beta
github.comgithub.com/HiEventsDev/Hi.Events/security/advisories/GHSA-2qcp-24fh-fx6p

Frequently asked

questions

Yes. Any attacker who can reach affected Hi.Events endpoints and control the sort_by parameter (or equivalent sorting controls) can attempt SQL injection over the network.

It depends on how the application is deployed. If listing or search endpoints are public, no authentication may be needed. If they are behind login, an attacker would need at least the lowest level of access that can reach those endpoints.

Implement a strict allowlist of valid sort keys and directions, map them to specific database columns or query builder expressions, and reject or fall back to a default sort for anything else. Avoid ever passing raw request values as identifiers or SQL fragments.

Adopt secure query-building patterns across the codebase: always treat user input as data, never as SQL structure; enforce central validation helpers for sorting, filtering, and searching; and integrate static analysis and security checks into CI to catch unsafe dynamic queries early.

Find out what's already
exploitable in your codebase.