Summary
Homer contains a SQL injection vulnerability in the V4StatisticsQuery handler because it forwards the user-supplied rawquery value directly to DuckDB without applying the validation used elsewhere in the application.
An authenticated user may be able to execute arbitrary SQL statements against data accessible through the FlightSQL service when the vulnerable handler is exposed.
Homer contains a SQL injection vulnerability in the V4StatisticsQuery handler because it forwards the user-supplied rawquery value directly to DuckDB without applying the validation used elsewhere in the application.
An authenticated user may be able to execute arbitrary SQL statements against data accessible through the FlightSQL service when the vulnerable handler is exposed.
Affected context
The vulnerability occurs in Homer deployments using the affected V4StatisticsQuery handler and DuckDB-backed FlightSQL service. It requires that an authenticated user can reach the statistics query endpoint and submit a value for the rawquery field without effective SQL validation or equivalent query restrictions.
The vulnerability occurs in Homer deployments using the affected V4StatisticsQuery handler and DuckDB-backed FlightSQL service. It requires that an authenticated user can reach the statistics query endpoint and submit a value for the rawquery field without effective SQL validation or equivalent query restrictions.
Exploit preconditions
- Attack surface: The Homer statistics query API and its FlightSQL-backed data service
- Required access: Authentication sufficient to invoke the affected handler
- Trigger point: Processing of the user-controlled
rawqueryfield - Why exploitation is possible: The handler passes raw SQL to DuckDB without invoking the validation control applied in other query paths
- Attack surface: The Homer statistics query API and its FlightSQL-backed data service
- Required access: Authentication sufficient to invoke the affected handler
- Trigger point: Processing of the user-controlled
rawqueryfield - Why exploitation is possible: The handler passes raw SQL to DuckDB without invoking the validation control applied in other query paths
Why this happens
The underlying bug is a failure to treat user-controlled query text as untrusted input. The V4StatisticsQuery handler sends the rawquery value directly to the database engine instead of enforcing a safe query model or consistently applying SQL validation.
This behavior maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command, commonly known as SQL injection. The insecure pattern permits input to alter the intended database command structure rather than limiting the request to approved operations and parameters.
The underlying bug is a failure to treat user-controlled query text as untrusted input. The V4StatisticsQuery handler sends the rawquery value directly to the database engine instead of enforcing a safe query model or consistently applying SQL validation.
This behavior maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command, commonly known as SQL injection. The insecure pattern permits input to alter the intended database command structure rather than limiting the request to approved operations and parameters.
Potential impact
- An authenticated user may execute unauthorized SQL statements
- Sensitive data accessible through the FlightSQL service could be disclosed
- Database records may be altered or deleted
- Queries could consume excessive resources and affect service availability
- The impact may extend to other data sources or permissions available to the DuckDB process
- An authenticated user may execute unauthorized SQL statements
- Sensitive data accessible through the FlightSQL service could be disclosed
- Database records may be altered or deleted
- Queries could consume excessive resources and affect service availability
- The impact may extend to other data sources or permissions available to the DuckDB process
General mitigation guidance
Mitigation generally focuses on removing raw SQL execution from user-controlled request paths and reducing database privileges.
Common defensive patterns include:
- Replacing free-form SQL with parameterized queries and predefined query operations
- Applying consistent allowlisting and validation at every query entry point
- Separating query construction from user-provided values
- Restricting database credentials and service capabilities to the minimum required
- Limiting accessible schemas, tables, columns, and statement types
- Enforcing query timeouts, resource limits, and read-only access where appropriate
- Treating authentication as an access control layer rather than a substitute for query authorization
Mitigation generally focuses on removing raw SQL execution from user-controlled request paths and reducing database privileges.
Common defensive patterns include:
- Replacing free-form SQL with parameterized queries and predefined query operations
- Applying consistent allowlisting and validation at every query entry point
- Separating query construction from user-provided values
- Restricting database credentials and service capabilities to the minimum required
- Limiting accessible schemas, tables, columns, and statement types
- Enforcing query timeouts, resource limits, and read-only access where appropriate
- Treating authentication as an access control layer rather than a substitute for query authorization
How teams detect issues like this
Organizations can look for SQL injection risks through:
- Static analysis rules identifying request fields concatenated into SQL or passed to raw execution APIs
- Code review checks for database calls that accept unvalidated query text
- Tests that verify disallowed statement types and query structures are rejected
- Runtime monitoring for unexpected DDL, DML, schema enumeration, or high-volume queries
- Database audit policies correlating SQL activity with API identities and endpoints
- CI policy checks requiring parameterized queries or approved query-builder interfaces
Automated security review tools may help identify direct data flow from HTTP or API inputs into database execution functions.
Organizations can look for SQL injection risks through:
- Static analysis rules identifying request fields concatenated into SQL or passed to raw execution APIs
- Code review checks for database calls that accept unvalidated query text
- Tests that verify disallowed statement types and query structures are rejected
- Runtime monitoring for unexpected DDL, DML, schema enumeration, or high-volume queries
- Database audit policies correlating SQL activity with API identities and endpoints
- CI policy checks requiring parameterized queries or approved query-builder interfaces
Automated security review tools may help identify direct data flow from HTTP or API inputs into database execution functions.

