Seeing odd searches in your logs? Check for SQL injection
An owner of an online bookshop in Kolkata opens the search report and sees queries like ' OR 1=1 and UNION SELECT. Nobody is looking for a book with that title. These are SQL injection probes: scripts testing whether your search box passes text straight into the database. Most fail on a well-built site, but they reveal weak spots. This page explains what the probes mean, how to check your search code and how to block them.
What the search probes tell you
- Search logs show quotes, dashes and database words like SELECT, UNION or SLEEP that no customer would ever type.
- Probing often happens in bursts from a few IPs, testing many variations in a short time window.
- Some probes make the search page slow or throw errors, which can show bits of database information to the attacker.
- If the code is weak, a successful attempt can read customer details or change data in the store database.
Responding to SQL injection probes
- Do not panic, but do check. Probes are common on any public site. Their presence does not mean you were breached. It means someone is testing. Ask your developer to check whether any of these searches returned unusual results or errors. Look at the database user's permissions and recent changes to tables like users and orders.
- Review how search queries are built. The real fix is in code. Search and filter queries should use prepared statements or the framework's query builder, never text joined into SQL. Your developer can check search, filters, sort options and any old custom pages. Pay attention to older plugins and custom PHP written years ago.
- Hide database errors from visitors. If a probe causes an error, the visitor should see a simple message, not a database error with table names. Turn off detailed error display on the live site and log errors privately instead. This takes away a key source of information attackers rely on.
- Block the patterns at the edge. Even with fixed code, block requests carrying clear injection patterns before they reach your application. This reduces load and closes gaps in parts of the site you have not reviewed yet. It is a safety layer, not a replacement for safe code.
- Watch who keeps coming back. Probing IPs often return with new variations. Keep a log of blocked attempts and check for repeat sources. Block them or their networks if they persist. Alerts for repeat offenders mean you hear about a determined attacker early, not after an incident.
How VadiGuard helps
Injection patterns blocked in real time
VadiGuard is built to stop SQL injection and cross-site scripting attempts as they arrive. Search and filter requests carrying obvious injection strings can be blocked before your application handles them. Your developer still fixes the underlying queries, but you gain a layer while that work happens.
See every probe and why it was flagged
Each blocked request appears in the log with a risk score and block reason. Clicking it shows the AI risk explanation with the triggered signals and weights. You see exactly which search strings were caught, which helps your developer find the weak pages.
Repeat offenders flagged
IP reputation scoring helps block harmful IPs and networks, and smart alerts can tell you by Telegram, Slack, webhook or email when a repeat offender is detected. The adaptive baseline also notices bursts of probing on your search route.
Strange searches are a warning, not a disaster. Check for damage, fix query code, hide errors, block patterns and watch repeat sources. VadiGuard can add the blocking and visibility layer. Ask the team for a demo on your stack.
Questions people ask
Does seeing probes mean my site was hacked?
Not necessarily. Probes are very common on public sites. They show that someone tested your site. Ask a developer to check for signs of success, like unusual errors, data changes or new admin users.
Is blocking at the edge enough?
No. It is a helpful layer, but safe code with prepared statements is the real fix. Use both. VadiGuard reduces exposure while your developer reviews and fixes the search and filter code.
Can this cause false blocks for real searches?
Rarely, a genuine search with unusual characters might look suspicious. The log shows what was blocked and why, so you can adjust. Review the log in the first weeks after setup.
Which platforms can use this protection?
VadiGuard supports WordPress, Laravel, CodeIgniter 3, Node.js and Express, any PHP framework and plain HTML or JavaScript sites, with copy-paste snippets for each.