Query Parameterization Framework for Legacy SQL Security

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Non-parameterized SQL queries are commonly used in legacy applications, leading to security vulnerabilities and inefficient query execution, despite the benefits of query parameterization.

Innovation Solution

A query parameterization framework that automatically converts non-parameterized queries to parameterized queries using multi-layer validation and in-memory tree structures, ensuring valid parameter names and values, and maintaining the query's logical structure.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If query parameterization is implemented, then data security and query efficiency are improved, but implementation complexity and difficulty increase

Engineering Contradiction:
Improvedata securityVSAvoidimplementation complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The system performs preliminary actions by automatically analyzing SQL queries, identifying parameter positions, and generating parameterized query templates before query execution. This includes parsing query structure, detecting literal values that should be parameters, and creating execution plans with placeholder positions, thereby eliminating the need for manual parameterization and reducing implementation complexity

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The query parameterization system performs self-service by automatically transforming non-parameterized queries into parameterized queries without requiring manual intervention. The system analyzes query structure, identifies parameter opportunities, generates parameterized templates, and manages execution plans autonomously, making the security improvement transparent to users while reducing implementation burden

Inventive Principle:
Principle #25Self-service

2Productivity

If query parameterization is implemented, then query execution efficiency is improved through plan reuse, but query processing complexity increases

Engineering Contradiction:
Improvequery execution efficiencyVSAvoidquery processing complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The system segments the query processing into distinct phases: query parsing, parameter identification, template generation, and execution plan creation. By dividing the complex parameterization process into manageable segments with clear boundaries, the system enables efficient plan reuse while managing processing complexity through structured intermediate representations and modular transformation steps

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system applies parameter changes by transforming concrete literal values in queries into parameter placeholders, allowing the same query template to be executed multiple times with different parameter values. This transformation enables execution plan reuse across similar queries while the system manages the complexity of tracking parameter positions, types, and bindings through structured metadata

Inventive Principle:
Principle #35Parameter changes

3Object-affected harmful factors

If automatic query parameterization is implemented across legacy applications, then security vulnerabilities are reduced, but system complexity and validation requirements increase

Engineering Contradiction:
Improvesecurity vulnerabilitiesVSAvoidsystem complexity
Core Design Contradiction:
Object-affected harmful factorsVSDevice complexity

Solution Approach 1:

The system applies preliminary anti-action by proactively parameterizing queries before they can be exploited for SQL injection attacks. By automatically identifying and parameterizing all user-input-dependent values in queries, the system prevents malicious code injection while managing complexity through automated query analysis and validation that checks parameter positions and types without requiring manual security audits

Inventive Principle:
Principle #9Preliminary anti-action

Data Source

PatentUS12380095B2Framework for query parameterization
Publication Date: 2025.08.05 SAP SE
  • US12380095B2 patent drawing
  • US12380095B2 patent drawing
  • US12380095B2 patent drawing

AI summary

A computer implemented method can receive a condition expression for a query, parse the condition expression to identify parameter names and corresponding values, and evaluate validity of the parameter names and corresponding values. Responsive to finding that the parameters names and corresponding values are valid, the method can create a tree structure representing a logical relationship between the parameter names and corresponding values in a memory space, create a parameterized query comprising a modified condition expression which includes the parameter names and placeholders for the corresponding values, map the modified condition expression to a vector comprising values corresponding to the parameter names, and send the parameterized query and the vector to a query processing engine which pairs the parameter names in the modified condition expression with corresponding values contained in the vector when executing the parameterized query.