Apostrophe in Alpha Tag throws SQL error

Status
Not open for further replies.

w2lie

New York DB Admin
Database Admin
Joined
Mar 2, 2004
Messages
1,628
Location
Long Island, NY
I attempted to add an apostrophe into an alpha tag using the import function and the result was a SQL error. Removing the apostrophe from the alpha tag allowed me to import correctly.

For security reasons, I don't think I should put the SQL output in a public forum, but if anyone want to try, this is the line that cause the failure:

Code:
152.45  167.9 PL  Stuart's Taxi (Westbury)  Stewart's  WQTP682  FMN  BM  Business
 

QDP2012

Member
Joined
Feb 8, 2012
Messages
1,921
Apostrophe's should not be allowed (as commands, at the injection-point). In other DBMSs, that is a serious vulnerability, and likely is here (in the above described situation), too.
 
Last edited:

eorange

♦RF Enabled Member♦
Joined
Aug 20, 2003
Messages
3,028
Location
Cleveland, OH
An apostrophe can certainly be allowed. That's not the problem.

The problem is whomever wrote the software that updates the database didn't prevent user input from being interpreted as literal SQL commands.
 

QDP2012

Member
Joined
Feb 8, 2012
Messages
1,921
An apostrophe can certainly be allowed. That's not the problem.

The problem is whomever wrote the software that updates the database didn't prevent user input from being interpreted as literal SQL commands.

Correct. I added clarification to my earlier statement which should have been included originally.
 
D

DaveNF2G

Guest
The solution is to put two apostrophes (not a double quote) where you want one to appear in the data.

"Stuart''s Taxi" should work.
 
Status
Not open for further replies.
Top