Opened 17 years ago
Closed 12 years ago
#246 closed defect (fixed)
Single quote in a lookup value appears to cause an exception and the software cannot find the correct lookup even though it exists
| Reported by: | Mark J. Millard | Owned by: | petecyr |
|---|---|---|---|
| Priority: | critical | Milestone: | Beta 3 |
| Component: | Curator Tool | Version: | |
| Severity: | Keywords: | single quote | |
| Cc: | Database Engine: | N/A | |
| Operating System: | XP Pro 32 bit |
Description
We have a georefence lookup which contains a verbatim field many of which have a single quote "'". I was trying to update some records using curator tool v1.0.3660.32558 and found that some of the lookup values were not found. I then used the lookup picker to slowly refine the list until I found the one I wanted. As I did that I got an exception. I did a continue and I was able to find the record and it existed just as I pasted it in with ctrl-v.
Change History (6)
comment:1 by , 17 years ago
comment:2 by , 17 years ago
Looks like CT is currently vulnerable to sql injection. Try adding the following text verbatim to the lookup picker dialog (copy paste it as lookup picker refines on each keystroke).
'; drop table code_value_lang; --
That will drop the code_value_lang table from the local db. This won't affect 'real' data, but could mess up CT functionality. All the text pulled from the GUI needs to be scrubbed before being concatenated into a SQL statement, or better yet it should be parameterized so no special escaping needs to be specified.
comment:3 by , 17 years ago
| Priority: | major → critical |
|---|
comment:4 by , 16 years ago
| Status: | new → addressed |
|---|
comment:5 by , 16 years ago
| Status: | addressed → released |
|---|
This was handled in a previous build - please verify and close the ticket.
comment:6 by , 12 years ago
| Resolution: | → fixed |
|---|---|
| Status: | released → closed |
This appears to have been addressed before Beta 3. Even though georeference table does not exist, the accession_inv_group lookup; big_cooperator_lookup; cooperator_lookup and others contain the apostrophe and seem to be working still in 1.9.6.32.

Her is the lookup value:
Accession source ID
16785
Accession
PI 501676
Georeference
15.25880480 43.60795950 43200 Al Mahwit, Al kata'a
And here is the exception:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
Exception Text
System.Data.SyntaxErrorException: Syntax error: Missing operand after 'a' operator.
Loaded Assemblies
mscorlib
GRINGlobal-CuratorTool
System.Windows.Forms
System
System.Drawing
System.Data
System.Xml
System.Core
GRINGlobal.Client.Common
AccessionForm
ImageForm
InventoryForm
OrderForm
System.Web.Services
System.Configuration
2uzjjcca
System.Transactions
System.EnterpriseServices
JIT Debugging
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.