Great Circle Associates Firewalls
(February 1996)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Re: Java security risk (bypassing firewalls)
From: peter @ nmti . com (Peter da Silva)
Date: Tue, 27 Feb 1996 21:48:50 -0600 (CST)
To: D . Thomas @ vthrc . uq . edu . au (Danny Thomas)
Cc: firewalls @ GreatCircle . COM
In-reply-to: <v02140b08ad592651638a @ [130 . 102 . 4 . 21]> from "Danny Thomas" at Feb 28, 96 07:27:43 am

> The issue isn't what it would do for Java, but having a widely deployed
> snprintf() past BSD4.4 platforms would help other security-conscious code.

I've come to the conclusion that "system()" and "popen()" should be removed
from the standard library, and replaced with something like this:

int spawnv(in, out, path, av)
FILE *in, *out;
char *path;
char **av;
{
	int pid;

	if(out) fflush(out);
	fflush(stdout);
	switch(pid = fork())) {
		case -1: return -1;
		case 0:
			if(in) dup2(0, fileno(in));
			if(out) dup2(1, fileno(out));
			/* code in here to purify the environment
			   and other security stuff */
			execvp(path, av, secure_environment);
			exit(-errno);
		default:
			return pid;
	}
}

... with spawnl/spawnve/spawnle/... and something that works like popen
but takes spawn arguments...

	fp = pipewl("/usr/sbin/sendmail", "sendmail", victim, NULL);

...

	fp = piperl("/usr/bin/finger", "finger", victim, NULL);

This would be enough easier than raw fork/exec to keep people from wanting
to put "-linsecure" on the linker line, while being complete enough to
cover all the cases you need system()/popen(). You could put gets() in there
as well, and sprintf, and so on...

Interpreters that provide a hook to popen (like Tcl, "open |....") should
also provide an alternate mechanism. Tcl has a good safe exec but you can't
safely open a pipe...


References:
Indexed By Date Previous: NEC's New PrivateNet Firewall Product (fwd)
From: curt @ ibu . sj . nec . com (Curt Dodson)
Next: A repost: NT Firewalls
From: pmoen @ sbnsw . com . au
Indexed By Thread Previous: Re: Java security risk (bypassing firewalls)
From: D . Thomas @ vthrc . uq . edu . au (Danny Thomas)
Next: Pentagon displays due respect for hackers
From: Sick Puppy <sikpuppy @ maestro . com>

Google
 
Search Internet Search www.greatcircle.com