Quantcast
Channel: SCN: Message List - SAP Adaptive Server Enterprise (SAP ASE) for Custom Applications
Viewing all articles
Browse latest Browse all 3587

How To Use Escape Characters to Prevent SQL Injection

$
0
0

Currently mitigating security violations in java code.

 

Would like to confirm how to escape special characters when sending dynamic SQL. The following special characters are to be escaped. { ,  " , \ , } , %&'()*+,-./:;<=>?[|\t\n.   The where clause is sent via a parameter in java code.

 

 

Example:

 

 

select * from tableA where columnA=<parameter>

 

parameter passed is: tableA.columnA = 'AB' or 1=1

 

We need to escape quotes and = sign from the <parameter> if it is passed.

 

The result of stripping the special characters in order to stop SQL inject would be: AB or 1 1 instead of 'AB' or 1=1

 

 

 

Thanks in advance.


Viewing all articles
Browse latest Browse all 3587

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>