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 Mark J. Millard, 17 years ago

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.

at System.Data.ExpressionParser.Parse()
at System.Data.DataExpression..ctor(DataTable table, String expression, Type type)
at System.Data.DataView.set_RowFilter(String value)
at GRINGlobal.Client.Common.LookupTablePicker.RefreshList()
at GRINGlobal.Client.Common.LookupTablePicker.timerDelay_Tick(Object sender, EventArgs e)
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Loaded Assemblies
mscorlib

Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3603 (GDR.050727-3600)
CodeBase: ​file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll


GRINGlobal-CuratorTool

Assembly Version: 1.0.3660.32558
Win32 Version: 1.0.3660.32558
CodeBase: ​file:///C:/Program%20Files/GRIN-Global/GRIN-Global%20Curator%20Tool/GRINGlobal-CuratorTool.exe


System.Windows.Forms

Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: ​file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll


System

Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: ​file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll


System.Drawing

Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: ​file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll


System.Data

Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: ​file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll


System.Xml

Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
CodeBase: ​file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll


System.Core

Assembly Version: 3.5.0.0
Win32 Version: 3.5.30729.1 built by: SP
CodeBase: ​file:///C:/WINDOWS/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll


GRINGlobal.Client.Common

Assembly Version: 1.0.3639.29568
Win32 Version: 1.0.3639.29568
CodeBase: ​file:///C:/Program%20Files/GRIN-Global/GRIN-Global%20Curator%20Tool/GRINGlobal.Client.Common.DLL


AccessionForm

Assembly Version: 1.0.3659.37532
Win32 Version: 1.0.3659.37532
CodeBase: ​file:///C:/Program%20Files/GRIN-Global/GRIN-Global%20Curator%20Tool/Forms/AccessionForm.dll


ImageForm

Assembly Version: 1.0.3639.29568
Win32 Version: 1.0.3639.29568
CodeBase: ​file:///C:/Program%20Files/GRIN-Global/GRIN-Global%20Curator%20Tool/Forms/ImageForm.dll


InventoryForm

Assembly Version: 1.0.3639.29568
Win32 Version: 1.0.3639.29568
CodeBase: ​file:///C:/Program%20Files/GRIN-Global/GRIN-Global%20Curator%20Tool/Forms/InventoryForm.dll


OrderForm

Assembly Version: 1.0.3639.29569
Win32 Version: 1.0.3639.29569
CodeBase: ​file:///C:/Program%20Files/GRIN-Global/GRIN-Global%20Curator%20Tool/Forms/OrderForm.dll


System.Web.Services

Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: ​file:///C:/WINDOWS/assembly/GAC_MSIL/System.Web.Services/2.0.0.0__b03f5f7f11d50a3a/System.Web.Services.dll


System.Configuration

Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: ​file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll


2uzjjcca

Assembly Version: 1.0.3639.29568
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: ​file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll


System.Transactions

Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: ​file:///C:/WINDOWS/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll


System.EnterpriseServices

Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: ​file:///C:/WINDOWS/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll


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>

<system.windows.forms jitDebugging="true" />

</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.

comment:2 by bweaver, 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 rlittle, 17 years ago

Priority: major → critical

comment:4 by Pete Cyr, 16 years ago

Status: new → addressed

comment:5 by Pete Cyr, 16 years ago

Status: addressed → released

This was handled in a previous build - please verify and close the ticket.

comment:6 by Mark J. Millard, 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.

Note: See TracTickets for help on using tickets.