Bugzilla – Bug 6203
audit record not inserted for RSL argument containing single quotes
Last modified: 2009-01-08 14:01:27
You need to log in before you can comment on or make changes to this bug.
Begin forwarded message: From: Yuriy <yuriy.halytskyy@gmail.com> Date: July 1, 2008 11:28:42 PM CDT To: gt-user <gt-user@globus.org> Subject: [gt-user] Problem with GRAM Audit database Hi, GRAM audit database is not updated when an RSL for the job contains fields with single quotes. Is it a bug in GRAM or am I missing something? For example the following script creates record in audit: <job> <executable>/bin/echo</executable> <directory>/home/grid-bestgrid</directory> <argument>a</argument> <jobType>single</jobType> </job> And the following does not: <job> <executable>/bin/echo</executable> <directory>/home/grid-bestgrid</directory> <argument>'a'</argument> <jobType>single</jobType> </job> Both jobs execute successfully. We use globus from VDT 1.10. Regards, Yuriy
Is this a sign that database input is not being properly sanitized? Is there an SQL injection vulnerability?
Hi Jim, Can you give an example for sanitizing DB input values and an SQL injection vulnerability? Thanks, Stu
http://en.wikipedia.org/wiki/Sql_injection
Yes, is seems that database input is not being properly sanitized, and yes, there seems to be an SQL injection vulnerability. Yuriy should have seen an exception in the container logfile indicating that something went wrong when trying to upload an audit record into the database. In 4.0.x audit logging single quotes in a job description cause problems, because the SQL string is created manually and looks like INSERT INTO gram_audit_table (job_grid_id, local_job_id, ...) values (...,'feller','a4171c1e-850a-11dd-a8d4-0013d4c3b957', ...); Any non-escaped single quote destroys the intended syntax here, and currently they are not escaped in 4.0.x. 4.2.x is not effected as we handle database upload differently. I'll prepare a patch for this.
Fix committed to 4.0 branch. The fix is to escape single quotes. Let me know if anyone would like to have a patch.
fix will be in 4.0.9