Michel Arboi wrote:
> On Sun, May 18, 2008 at 11:14 PM, Jan-Oliver Wagner
> <[EMAIL PROTECTED]> wrote:
>> Are you saying that Thomas is wrong?
> 
> Or at least, not very precise.
> 
>>> Maybe I already had it.
>> Are you saying you even implemented this already?
> 
> IIRC, since the beginning of NASL2.
> 
>> Why are you in doubt?
> 
> I am not in doubt.

NASL2 demonstrates this problem very clearly.  The
examples I previously cited highlighted it.
But for those who might question that I completely screwed
it up, let me be more explicit by way of example:

Script:

$cat testme.nasl
#!/usr/local/bin/nasl

if(description)
{
script_d(1);
}

function testme(port)
{
     x = 5;
}

x = 1;
display(string(x, "\n"));
testme(port:22);
display(string(x, "\n"));



Now, results from running this against both 2.1.0 as well
as 2.2.5 (on which OpenVAS is based):

$ which nasl
/usr/local/bin/nasl
$ nasl -v
nasl 2.1.0

Copyright (C) 1999 - 2003 Renaud Deraison <[EMAIL PROTECTED]>
Copyright (C) 2002 - 2003 Michel Arboi <[EMAIL PROTECTED]>

See the license for details


$ ./test.nasl
** WARNING : packet forgery will not work
** as NASL is not running as root
1
5

<snip complete removal and reinstall of nessus 2.2.5>

$ nasl -v
nasl 2.2.5

Copyright (C) 2002 - 2004 Tenable Network Security

See the license for details

$ ./test.nasl
** WARNING : packet forgery will not work
** as NASL is not running as root
1
5

Both of these results demonstrate quite clearly how the author of
a function "testme" can use a variable "x" that has no explicit
declarations, intend the variable to be local, yet have consequences
that the caller's scope is used.  All of the previous examples
I cited were examples of this problem.  In many cases, it was
obvious that authors _attempted_ to avoid the problem by using
"local_var" constructs.  But since they in many cases forgot
to do so, or missed one or more variables, the problem persists.

Perhaps Tenable has gone ahead and corrected the scripts themselves
to avoid this situation.  It does not, address the root problem,
which through inheritance, OpenVAS has in the daemon.

If I'm wrong, _constructive_ criticism is more than welcome.
But, unless I misunderstand when NASL2 was released, I don't
think I've made a mistake here.

Thomas

_______________________________________________
Openvas-discuss mailing list
[email protected]
http://lists.wald.intevation.org/mailman/listinfo/openvas-discuss

Reply via email to