CWE-1067 covers a data query against an SQL table or view that does not use an index and may cause sequential searches. Anyone running a relational database behind an application can hit it, usually as tables grow.
How it happens
A query filters on a column with no index, or wraps an indexed column in a function so the index cannot be used. The database reads every row.
-- Pattern to avoid: the function on the column defeats a plain index
SELECT * FROM orders WHERE LOWER(email) = 'a@example.com';
-- Better: index the expression, or compare the stored value directly
CREATE INDEX idx_orders_email_lower ON orders (LOWER(email));
Expression indexes exist in several databases but not all, so check yours.
What an attacker gains
MITRE lists an availability consequence: reduced performance. If an attacker can reach the code, the performance problem "might introduce a vulnerability." A request that forces a full scan is cheap to send and expensive to serve.
How to find it
The record lists no detection methods. Run your database's query plan tool, such as EXPLAIN, on frequent queries and look for sequential or full scans on large tables.
How to fix it
- Add indexes on columns used in filters and joins.
- Rewrite queries so indexed columns are compared directly.
- Limit result sizes and require filters on public endpoints.
Quick check
How can you see if a query scans the whole table?
Run the database's plan command, such as EXPLAIN, and look for a sequential or full table scan.