Export to GitHub

naxsi - issue #56

using uninitialized "naxsi_flag_learning" variable


Posted on Jan 6, 2013 by Quick Wombat

if you set the naxsi_flag_learning in a vhost, your error log gets filled up with messages like this:

2013/01/06 22:46:40 [warn] 9147#0: *4 using uninitialized "naxsi_flag_learning" variable, client: 127.0.0.1, server: _, request: "GET / HTTP/1.1", host: "127.0.0.1" 2013/01/06 22:51:40 [warn] 9147#0: *7 using uninitialized "naxsi_flag_learning" variable, client: 127.0.0.1, server: _, request: "GET / HTTP/1.1", host: "127.0.0.1" 2013/01/06 22:56:40 [warn] 9147#0: *8 using uninitialized "naxsi_flag_learning" variable, client: 127.0.0.1, server: _, request: "GET / HTTP/1.1", host: "127.0.0.1"

Comment #1

Posted on Jan 6, 2013 by Grumpy Camel

It seems that you have set naxsi_flag_learning in a location. It doesn't work. You have to set it outside a location. For example : server {

set naxsi_flag_learning 1;

location / {

do whatever you want

}

}

Comment #2

Posted on Jan 7, 2013 by Quick Wombat

no my config looks like this

server { listen 80;

server_name  _;

include /etc/nginx/proxy_params;

 set $naxsi_flag_learning 1;

location /robots.txt {
    alias /var/www/stuff/norobots.txt;
}
location ~ /\. {
    deny all;
}
location / {
    proxy_pass        http://localhost:8100;
    include    /etc/nginx/naxsi.rules;
}

}

But I have several vhosts (servers), I guess the problem might be that once you use this variable you have to define it in every vhost?

Comment #3

Posted on Jan 7, 2013 by Happy Horse

Hello,

Actually, the bug happens only if your error_log are in debug AND you have multiple server blocks, with at least one of them with naxsi enabled, but not all of them initializing your variable. I do not see any workaround yet (except removing debug flag from your error_log).

Comment #4

Posted on Jan 17, 2013 by Happy Horse

(No comment was entered for this change.)

Comment #5

Posted on Mar 13, 2013 by Happy Horse

(No comment was entered for this change.)

Status: WontFix

Labels:
Type-Enhancement Priority-Low