0

During a third party website audit, I found that the User-Agent header is vulnerable to time based SQLi. Can anyone suggest me how to patch this vulnerability?

1
  • 3
    Is that different from any other SQL injection? Parameterized queries or escaping, no? Dec 14 '16 at 5:17
2

A time-based SQL injection is not different from an ordinary SQL injection and neither is fixing it. They vary in how hard they are to attack but the defense remains pretty much the same. It also should not be relevant for the fixing method in which component you found it.

That's because the clean way to deal with SQL injections is almost always using parametrized queries (prepared statements). If you are auditing the source code, it would be best if instead of just flagging the SQL queries that you think are exploitable, you would rewrite all raw SQL queries to proper prepared statements. That makes the next audit much easier and you don't have to spend time thinking about escaping patterns and evasion techniques.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.