Results 1 to 2 of 2

Thread: Rest - does it prevent sql injection?

  1. #1
    Sin OB is offline Junior Member
    Join Date
    Nov 2011
    Location
    Bristol
    Posts
    4

    Default Rest - does it prevent sql injection?

    I am using JavaScript JQuery to directly pull data from Sugar via the REST interface to an external system. So far this is working very well.

    My question is; does SugarCrm perform any data sanitation on the rest_data that I am sending in when getting information from the API. I want to make sure there is no risk of SQL injection to sugar using a direct JavaScript solution.

    So, lets say I have the following JavaScript and I pass this to the REST server as part of a request to get_entry_list.

    Code:
    var rest = {"session":session_id, 
                'module':'Products',
                'query':'products.account_id = "'+account_id+'" and products.status="Ship"',
                'order_by':'',
                'offset':'0',
                'select_fields':new Array('name','id', 'available_to_all_c', 'book_value','description'),
                'max_result':'50',
                'deleted':'false'};
    The account_id above is dynamic based on user input. Will the API on SugarCrm side perform any sanitation to catch any malicious code before it hits the database?

    The last reference I have found to this was the following thread in 2009 that appears to indicate that it does not perform any checking. See http://www.sugarcrm.com/forums/f154/...71/index2.html - post 12, I'm hoping that this is no longer the case?

  2. #2
    Sin OB is offline Junior Member
    Join Date
    Nov 2011
    Location
    Bristol
    Posts
    4

    Default Re: Rest - does it prevent sql injection?

    I haven't found anything on the sugar side to indicate that it performs any checking/sanitation. Yikes.

    Solution: Avoid direct JavaScript call to SugarCrm API. For safety I've implemented a server side wrapper to clean up any user inputs before shooting the query off to the SuarCrm API.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Enhance query calls to prevent SQL injection
    By dBrian in forum Developer Help
    Replies: 4
    Last Post: 2011-10-28, 02:42 PM
  2. sql injection
    By paul.scherrer in forum Help
    Replies: 1
    Last Post: 2010-10-25, 04:52 PM
  3. sql injection - id field
    By blackradius in forum Developer Help
    Replies: 4
    Last Post: 2010-04-21, 04:21 AM
  4. Replies: 0
    Last Post: 2007-11-04, 05:28 PM
  5. SQL Injection/Overwrite
    By sunside in forum General Discussion
    Replies: 4
    Last Post: 2007-04-18, 11:17 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •