Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php.vcl breaks timthumb.php #22

Open
missilefish opened this issue Jul 29, 2013 · 2 comments
Open

php.vcl breaks timthumb.php #22

missilefish opened this issue Jul 29, 2013 · 2 comments

Comments

@missilefish
Copy link

Hi All,

This is my first and seemingly only issue I have with this terrific Varnish addition you all have developed. I'd like to find a way to include some kind of exclusion for what timthumb.php would need to run, it is very common with Wordpress themes. My only solution today (terrible with regex) is to comment out that one section below in the php.vcl security module.

http://EXAMPLEDOMAIN.COM/wp-content/themes/MISCTHEME/scripts/timthumb.php?src=http://EXAMPLEDOMAIN.COM/wp-content/uploads/2010/08/filename.png&w=60&h=60&zc=1&q=100

Any suggestions on crafting something awesome to handle this circumstance? Or a variable to set maybe that would allow certain external sources to be named/blessed, like an ACL?

From php.vcl (lines 133-140):

Generic check for remote code inclusion from external sites

    if (req.url ~ "=?(https?|ftps?|php)://") {
           set req.http.X-SEC-RuleName = "Remote site in URL parameter";
           set req.http.X-SEC-RuleId   = "100";
           set req.http.X-SEC-RuleInfo = "Generic check for remote code inclusion from external sites";
           call sec_php_sev1;
    }
@sz00gun
Copy link

sz00gun commented Mar 23, 2015

any solution so far to fix this problem? I have the same problem...

@jhmartin
Copy link

You could make that
if (req.url ~ "=?(https?|ftps?|php)://" && ! req.url ~ "timthumb.php") {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants