After upgrading to Drupal 4.6, and banner module cvs (April 15 tarball), it seems that Drupalk does not like something about banner when cron runs.
The following problem appears in the log whenever cron is executed:
Possible exploit abuse: invalid data.
And
Terminated request because of suspicious input data: a:3:{i:0;a:1:{i:0;a:2:{i:0;s:1:"1";i:1;s:1:"3";}}i:1;a:2:{i:1;O:8:"stdClass":8:
{s:5:"views";s:5:"16586";s:9:"day_views";s:1:"1";s:13:"day_max_views";
s:1:"0";s:10:"week_views";s:1:"1";
(the message has more data in it, such as the HTML of the ads, ...etc, but I truncated it for brevity.
Both are flagged as security in the log.
Otherwise, the banners display fine. Had to refresh the cache manually first.
Comments
Comment #1
kbahey commentedJeremy
I traced that to this call
file_save_data($data, $cache_file, 1);in the function
_banner_refresh_cache()which is called from the _cron hook.My ad is a text ad, with HTML tags, but no javascript or anything like that.
When I manually refresh the cache, there is no such error.
What could this be?
Comment #2
jeremy commentedThe banner module is not yet patched to work with 4.6. You might want to try applying this patch on your local installation. I hope to work on an official 4.6 release soon.
Comment #3
kbahey commentedAny guesstimate on when a 4.6 release should be expected?
Comment #4
jeremy commentedNot really. Hopefully soon. Maybe this week. I'm looking at it now, but still doing a little work on the 4.5 branch, which I'm currently still using.
Comment #5
kbahey commentedI tested the patch you mentioned. The cron security error is still there.
I did not expect it to fix it, since the problem is in file_save_data() which is called from _banner_refresh_cache().
What is puzzling to me is that this same function is called elsewhere in banner.module, but no errors are reported.
Anyway, a week should be fine.
Comment #6
kbahey commentedI tested the latest cvs tar ball (downloaded today), and the suspicious input error still occurs in the log.
Comment #7
jeremy commentedI still haven't forked the module for 4.6.
Comment #8
kbahey commentedSorry to keep asking, but do you have an estimate for when a 4.6 version will be available?
Comment #9
kbahey commentedI have traced this problem to be the validation done in the valid_input_data() function.
This function checks for the element "style" in the passed info, among many other things, and if it is present, it will terminate and log a security error.
I am using this tag in text ads, such as the following:
Does the use of style pose a security risk that I am unaware of?
Comment #10
kbahey commentedActually, after some more tracing, the "style" element was the not the culprit. It was the "on[a-z]+" regexp. I think this filters the javascript on* events.
If the banner module relies on using onclick to redirect to an ad serving page/script, and these are being blocked by Drupal, what can be done to prevent this, without opening up more possible security exploit points?
Comment #11
kbahey commentedI am closing this issue.
It is not a problem with banner module itself, but rather with 4.6 being more strict about what input it accepts.
The use of OnClick events in the text ad was the cause of this. When I removed it, everything is fine, and cron does not report any security issues.