David Slack - Web developer

mod_security and Drupal 7

The story

I'd been working on a website (http://luckyfingers.co.uk/) for a few hours when the site died for no apparent reason. It was late so I left it for next time. I went on the site a couple of days later and all seemed fine until I installed a module on Drupal 7, at that point the site went off!

I checked in the browsers and it was gone, then tried to access the files via ftp and the server was gone.

At this point I guessed it was the fire wall blocking my IP address. To make sure, I used a mobile device and sure enough the site was fine.

What had happened?

After some emails back and forth with the host  (Dataflame) I got them to give me the log entries which told me it was jQuery Cookie file, Cross-site Scripting (XSS) Attack,  mod_security and rule 95004 causing the problems.

Armed with this info I searched the web for answers and it seems I'm not alone in this one. It seems there is a rule in mod_security that blocks files with the word 'cookie'! Since Drupal 7 uses a jQuery module called 'jquery.cookie.js' this caused the site to block me and any user accessing the site.

After more digging it seems this rule was an out of date rule and one that was changed in 2010 so the host (Dataflame) was using mod_security with an old rule set.

How to stop it?

So at this point we can simply ask the host provider to update their rule set for mod_security on this server, which they might or might not do or we can copy 'jquery.cookie.js' to 'jquery.c.js' and add 

Redirect 302 /misc/jquery.cookie.js /misc/jquery-cookie.js

to the .htaccess file

Latest content

There are lots of developers out there with varying degrees of experience and expertise, some mid level, some junior and some senior. Some...
First thoughts are Symfony is ace!Only been using Symfony for 1 project but the amount of coding it has saved has been worth the time spent...
The Lost and Found website was built by myself (David Slack) and designed by Arm & Eye.The site was created to promote a bar and...

Social networks

Contact me here or catch me on one of
the social networks below


What I'm listening to

My blog

Wednesday, 2 August, 2017 - 06:56
There are lots of developers out there with varying degrees of experience and expertise, some mid level, some junior and some senior. Some developers...
Tuesday, 5 March, 2013 - 09:49
First thoughts are Symfony is ace!Only been using Symfony for 1 project but the amount of coding it has saved has been worth the time spent learning...
Monday, 3 December, 2012 - 10:07
As a web developer and web designer I need to take into account everything on a site from SEO, marketing, usability across devices, the look and feel...

Try this on your mobile

Use your QR reader to read this

You should be able to use this right from the screen

Latest tweets

Calendar

M T W T F S S
 
 
 
 
1
 
2
 
3
 
4
 
5
 
6
 
7
 
8
 
9
 
10
 
11
 
12
 
13
 
14
 
15
 
16
 
17
 
18
 
19
 
20
 
21
 
22
 
23
 
24
 
25
 
26
 
27
 
28
 
29
 
30
 
31
 

You are here

Back to top

Copyright David Slack - Web developer