Best Practices for determining if a drupal theme is secure?

Events happening in the community are now at Drupal community events on www.drupal.org.
newbie7001's picture

I am a little new to drupal, but one common task for many people is to get theme(s) for their drupal sites. I understand just enough to know a drupal theme could perhaps have a security flaw e.g. xss if check_plain, check_markup, filter_xss not used properly?? However, I like many other newbies do not have enough knowledge to properly test this. (Yes, I did try reading some template preprocess/process functions but w/o an automated theme security test it is rather hard for a newer person to be sure.) In a "parallel universe", I know that twig (symfony2 php framework) automatically escapes ALL templates - thus handling security at the templating engine level not at the actual theme file level - which seems safer. After all, theme developers or designers may not be that aware of xss for example. One of the RAD tools I was looking at is artisteer which seems to be quite popular, however I am not able to adequately determine the security of the generated themes -- does anyone happen to know the answer? Like I said I am a bit new to drupal so sorry in advance if I am asking a stupid question or have misunderstood something basic.

Comments

If a theme overrides and

greggles's picture

If a theme overrides and modifies the php and printed variables for any tpl or theme_ functions then it needs to be reviewed. If a theme is a pure css theme then it is only as insecure as the theme it is based on (and most base themes, especially those in core, are well built).

To test for XSS in a theme I suggest submitting snippets of javascript in every field you can find.

Try out the "vuln" module to automate much of that - 6.x from miccolis or 7.x "soon" version by david stoline

thanks

newbie7001's picture

Wow was not expecting an answer from the man himself. Thanks for responding. Enjoyed listening to you on a couple of online videos greggles (great job).

Don't know quite enough yet on module/theme coding to translate the variable overrides into an actionable plan in my head. (Is there a link to a tutorial somewhere?) Anyways I did download the vuln (drupal 7 link) zipped version but the .info file says core = 6.x (and no readme.txt file for directions).

Any chance of getting a drupal 7 version of your book? All the best.

Security

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: