Gemini 3.5 Flash vs Grok 4.5 for code review
Grok 4.5 wins, 88–84
Same 12 code review tasks, marked blind by three rival labs. Grok 4.5 took 6 tasks, Gemini 3.5 Flash took 1, 5 tied. Tested 18 Aug 2026.
Where they differed most
Review this Express route. `db.query` returns a Promise resolving to an array of rows. app.get('/api/orders', async (req, res) => { const status = req.query.status; const rows = db.query( `SELECT id, customer, total FROM orders WHERE status = '${status}' ORDER BY created_at DESC` ); res.json({ orders: rows, count: rows.length }); }); Find the defects and rank them by severity. For the most serious one, give a concrete example of an input that exploits it and say what it would do. For the second, say exactly what the caller receives today and why nothing in the logs would show a problem. Then give the corrected route.
Here is the review of the Express route, ranking the defects by severity, explaining their behavior, and providing the corrected code.
---
### Defect 1: SQL Injection (Severity: High)
#### Description
The route directly interpolates the `status` query parameter into the SQL string using template literals (`'${status}'`). This allows untrusted user input to alter the structure of the SQL command executed by the database.
#### Example Exploit Input
An attacker could supply the following value for the `status` parameter in the query string:
``…## Defects (by severity) ### 1. **Critical — SQL injection** `status` is concatenated into the SQL string. An attacker controls the query. **Exploit example:** `GET /api/orders?status='%20OR%20'1'='1` That yields: ```sql SELECT id, customer, total FROM orders WHERE status = '' OR '1'='1' ORDER BY created_at DESC ``` → returns **every order**. Worse payloads can read other tables, modify data, or drop tables (depending on DB privileges), e.g. `status='; DROP TABLE orders; --` --- ### 2. **High — missing `await` on a Promise** `db.quer…
Task by task
| Task | Gemini 3.5 Flash | Grok 4.5 |
|---|---|---|
| The pagination that skips page one | 8 | 8 |
| Nothing wrong with it | 8 | 8 |
| Three things wrong in six lines | 8 | 9 |
| Two customers, one last item | 9 | 10 |
| Rank by what breaks | 8 | 8 |
| The review, as JSON | 8 | 8 |
| Slow is not the same as wrong | 8 | 9 |
| Overdue at one in the morning | 8 | 9 |
| Write only the comment | 10 | 10 |
| The complaint that is not a defect | 8 | 9 |
| Right, and unusable | 9 | 8 |
| Refuse the rubber stamp | 9 | 10 |
Full receipts: Gemini 3.5 Flash, Grok 4.5 · judges claude-sonnet-5, gpt-5.6-terra, grok-4.5
Questions people ask
Which is better for code review: Gemini 3.5 Flash or Grok 4.5?
Grok 4.5 — it scored 88/100 against 84/100 on our 12-task code review suite, winning 6 tasks to 1 with 5 tied. Every answer was marked blind by three judges from three rival AI labs.
How was this tested?
Both models answered the identical published code review tasks. Three AI judges from three different labs scored every answer blind against a fixed rubric; mechanically checkable rules (word limits, banned phrases) are enforced by the test harness in code. The raw outputs and judge verdicts are downloadable.
More code review head-to-heads: GPT-5.6 Sol vs Grok 4.5 · Gemini 3.5 Flash vs GPT-5.6 Sol · GPT-5.5 vs Grok 4.5 · Gemini 3.5 Flash vs GPT-5.5 · Claude Sonnet 5 vs Grok 4.5 · Claude Sonnet 5 vs Gemini 3.5 Flash
Full ranking: Best AI for code review · model pages: Gemini 3.5 Flash, Grok 4.5