How will I stop Ajax request service from anonymous user in Tikiwiki?

50 Views Asked by At

I found an Ajax service running as I called my Event tracker calendar. [myserver]/tiki-tracker_calendar-list?trackerId=30&beginField=startDate&endField=endDate&resourceField=title&coloringField=null&filters=%0D%0A%7Bfilter%20field%3D%22tracker_field_eventCategory%22%20content%3D%22%22%7D%0D%0A&start=1488085200&end=1491710400&_=1490626987241

If the attacker leverage this and enter: tiki-tracker_calendar-list?trackerId=30&beginField=startDate&endField=endDate&start=0&end=9999999999 The system will return all the events in tracker 30. I tried to enter: `if (! isset($user))

{

header('Location: index.php');

die;

}` in File: /var/www/html/tikisvn15/tiki-ajax_services.php

At line 35

It works. Is there any other way? Would my modification stop the Ajax service from other components?

1

There are 1 best solutions below

2
jonnybradley On

You can set which groups can see what using the Tiki permissions system. See the documentation here

Note that once you have set your tracker not to be visible for anonymous (not logged in) users you will need to rebuild your search index (on Control Panels -> Search) because TrackerCalendar uses the search index extensively.

I would advise against putting arbitrary user checks like this in the tiki code as things will stop working and it will be very hard to work out why, i think.