Skip to main content
QUICK REVIEW

[Paper Review] Preventing SQL Injection attack using pattern matching algorithm

Swapnil Kharche, Jagdish Patil|arXiv (Cornell University)|Apr 27, 2015
Web Application Security VulnerabilitiesComputer Science11 references10 citations
TL;DR

This paper proposes a SQL injection detection and prevention mechanism using the Aho-Corasick pattern matching algorithm to identify malicious input patterns in real time. By pre-indexing known attack signatures, the system efficiently scans user inputs against a finite-state machine of attack patterns, demonstrating strong performance in detecting standard SQL injection payloads with low overhead.

ABSTRACT

SQL injection attacks, a class of injection flaw in which specially crafted input strings leads to illegal queries to databases, are one of the topmost threats to web applications. A Number of research prototypes and commercial products that maintain the queries structure in web applications have been developed. But these techniques either fail to address the full scope of the problem or have limitations. Based on our observation that the injected string in a SQL injection attack is interpreted differently on different databases.Injection attack is a method that can inject any kind of malicious string or anomaly string on the original string. Pattern matching is a technique that can be used to identify or detect any anomaly packet from a sequential action. Most of the pattern based techniques are used static analysis and patterns are generated from the attacked statements. In this paper, we proposed a detection and prevention technique for preventing SQL Injection Attack using AhoCorasick pattern matching algorithm. In this paper, we proposed an overview of the architecture. In the initial stage evaluation, we consider some sample of standard attack patterns and it shows that the proposed algorithm is works well against the SQL Injection Attack.

Motivation & Objective

  • To address the limitations of existing SQL injection detection techniques that rely on dynamic analysis or incomplete signature sets.
  • To develop a scalable, real-time detection system capable of identifying known SQL injection patterns in web application inputs.
  • To leverage the Aho-Corasick algorithm’s efficiency in multi-pattern matching for low-latency security filtering.
  • To evaluate the feasibility of using static pattern matching as a lightweight, deployable defense against common SQL injection vectors.

Proposed method

  • The system uses the Aho-Corasick algorithm to build a finite-state machine from a curated set of known SQL injection patterns.
  • Input strings from web applications are streamed through the Aho-Corasick automaton to detect any matching attack signatures.
  • The algorithm enables simultaneous pattern matching with linear time complexity relative to input length, ensuring high performance.
  • Attack patterns are extracted from known vulnerable queries and used to train the pattern database.
  • The detection engine is integrated at the application layer, filtering inputs before database query execution.
  • The system operates in a stateless manner, making it suitable for deployment in high-throughput environments.

Experimental results

Research questions

  • RQ1Can the Aho-Corasick pattern matching algorithm effectively detect known SQL injection patterns in real time?
  • RQ2How does the performance of the Aho-Corasick-based detection compare to traditional signature-based or heuristic-based approaches?
  • RQ3To what extent can a static pattern-based system prevent SQL injection without false positives or negatives on standard attack vectors?
  • RQ4Is the Aho-Corasick algorithm scalable and efficient enough for deployment in production web applications?

Key findings

  • The proposed system successfully detects all tested standard SQL injection patterns using the Aho-Corasick algorithm.
  • The algorithm achieves linear-time pattern matching, ensuring low computational overhead even under high input volume.
  • The architecture demonstrates feasibility for real-time deployment due to its deterministic and efficient pattern matching behavior.
  • The system shows strong detection accuracy for known attack signatures without requiring runtime query parsing or complex analysis.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.