Security concerns with cache_get() and cache_set() are there any security concerns with Drupal's cache_set() and cache_get() functions?
I mean, I receive some values through an Ajax-GET-request. Can I pass them to the two functions with the following validation?

Javascript:

//token was passed through drupal_add_js() to Drupal.settings.my_module
var url = path + token + '/' + var1 + '/' + var2;
$.get(url);


Page callback:

function my_module_ajax_callback($token, $var1, $var2) {  
  if (!empty($_SERVER['HTTP_X_REQUESTED_WITH'])
      &amp;&amp; strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'
      &amp;&amp; is_numeric($var1)
      &amp;&amp; drupal_valid_token($token, $var1)) {

    if (is_numeric($var2) &amp;&amp; $var2 &gt;= 0 &amp;&amp; $var2 &lt; 3600) {
      //can I pass $var1 and $var2 to cache_get() and cache_set() at this point? e.g.:
      cache_set(var1, var2);
      //Are there still security risks?
    }
  }
}


I would welcome every advise.

Thanks!

Daniel
currently there are no known  bugs which would cause any security issue using cache_set and cache_get. You can put any values there
both key and value are escaped. 
for example you can try this key '; drop table abr;--'
and it will be saved without any issues