[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Analysis vulnerabilities associated to published security advisories, anyone?



On Wed, Mar 09, 2005 at 07:13:48PM +0000, Steve Kemp wrote:
> On Wed, Mar 09, 2005 at 08:05:40PM +0100, David Schmitt wrote:
> > On Wednesday 09 March 2005 19:13, Steve Kemp wrote:
> > >   A simple script I wrote did that for me already - although there are
> > >  some fixups required as we seem to have a few different spellings
> > >  for different things.  eg. sanitizing vs sanitising.
> > >
> > >   You can see the simple output here along with input and output.
> > >
> > >  http://people.debian.org/~skx/2005/
> > 
> > Nice script. I fixed it up to sanitise 'sanitizations' and sort output by 
> > count. diff attached.
> 
>   Thanks, I've applied it and updated the page.

Based on your code I've modified it (reused some of the code I wrote for
other tasks) so that it can be run in the source code that generates
www.debian.org/security. Attached is both the modified script and the
result. As you will see, since the 'description' tag has not been used
uniformly (sp?) the results are quite strange. I believe it would be best
if we modified all the .data files and added a 'vulntype' tag to all of
them in order to do proper analysis.

Regards

Javier
#!/usr/bin/perl -w

use Getopt::Std;
use Time::gmtime;
use IO::File;
use Date::Parse;
use strict;

my %HASH;
my %DSAcount;
my %dsaref;
my $opt_h;
my $opt_v;

# Stdin options
# -v verbose
getopts('hv');
if ( $opt_h ) {
# Help!
	print "usage: $0 [-vh]\n";
	print "\t-v\tverbose mode\n";
	print "\t-h\tthis help\n";
	exit 0;
}


# Extract data
#parsedirs (".", "data", 2);
parsedirs (".", "wml", 2);

# Print page
countvuln();
printtable();

exit 0;

sub countvuln {
# Count the vulnerabilities in %dsaref based on description
	foreach my $dsa (keys %dsaref) {
		if  ( defined $dsaref{$dsa}{'description'} ) {
			my $type = $dsaref{$dsa}{'description'};
			$type =~ s/ *$//;
			$type =~ s/(overflow|file)s$/$1/;
			$type =~ s/saniti[zs]ing|validation/validation/;
			$type =~ s/unsanitised input/missing input validation/;
			$HASH{ $type } += 1;  # Increase type of flaw.
			$DSAcount{ $type } .= " " . $dsa ;
		}
	}
}

##
##  Simple HTML output
##
sub printtable {
	print "<table>";
	foreach my $key ( sort { $HASH{$b} <=> $HASH{$a} } keys %HASH )
	{
		print "<tr bgcolor=\"#cccccc\"><td>" . $key . "</td><td>" . $HASH{ $key }  . "</tr>\n";

		print "<tr><td></td><td>";
		foreach my $vuln ( split( / /, $DSAcount{ $key } ) )
		{
			next if not length( $vuln );

			$vuln = lc($vuln);
			print "<a href=\"http://www.debian.org/security/2005/$vuln\";>$vuln</a> ";
		}
		print "</td></tr>\n";
	}
	print "</table>";
}

sub parsewmlfile {
	my ($file,$filename) = @_ ;
	my $dsa;
	my $line;
# The filename gives us the DSA we are parsing
	if ( $filename =~ /dsa\-(\d+)/ || $filename =~ /(\d+\w+)/ ) {
		$dsa=$1;
	} else {
		print STDERR "File $file does not look like a proper DSA, not checking\n" if $opt_v;
		return 1;
	}
	print STDERR "Parsing DSA $dsa from file $file\n" if $opt_v;
	open (WMLFILE , $file) || die ("Cannot read $file: $!");
	while ($line=<WMLFILE>) {
		chomp $line;
		if ( $line =~ /description\>(.*?)\<\/define-tag/ )  {
			$dsaref{$dsa}{'description'}=$1;
		}
		last if defined $dsaref{$dsa}{'description'};
	}
	close WMLFILE;
	return 0;
}

sub parsedatafile {
	my ($file,$filename) = @_ ;
	my $dsa;
	my $line;
# The filename gives us the DSA we are parsing
	if ( $filename =~ /dsa\-(\d+)/ || $filename =~ /(\d+\w+)/ ) {
		$dsa=$1;
	} else {
		print STDERR "File $file does not look like a proper DSA, not checking\n" if $opt_v;
		return 1;
	}
	print STDERR "Parsing DSA $dsa from file $file\n" if $opt_v;

	open (DATAFILE , $file) || die ("Cannot read $file: $!");
	while ($line=<DATAFILE>) {
		chomp $line;
		if ( $line =~ /report_date\>([\d\-\/]+)\<\/define-tag/ )  {
			my $dsadate=$1;
			# Just in case...
			$dsadate =~ s/\-(\d)\-/-0$1-/;
			$dsadate =~ s/\-(\d)$/-0$1/;
			$dsaref{$dsa}{'date'}=$dsadate ;
		}
		if ( $line =~ /secrefs\>(.*?)\<\/define-tag/ ) {
			$dsaref{$dsa}{'secrefs'}=$1 ;
			print STDERR "Extracted security references: $dsaref{$dsa}{'secrefs'}\n" if $opt_v;
		}
		$dsaref{$dsa}{'package'}=$1 if ( $line =~ /packages\>(.*?)\<\/define-tag/ ) ;
		$dsaref{$dsa}{'vulnerable'}=$1 if ( $line =~ /isvulnerable\>(.*?)\<\/define-tag/ ) ;
		$dsaref{$dsa}{'fixed'}=$1 if ( $line =~ /fixed\>(.*?)\<\/define-tag/ ) ;
	}
	close DATAFILE;
	return 0;
}

sub parsedirs {
	my ($directory, $postfix, $depth) = @_ ;
	my $dir = new IO::File;
	if ( $depth == 0 ) {
		print STDERR "Maximum depth reached ($depth) at $directory\n" if $opt_v;
		return 0;
	}
	opendir ($dir , $directory) || die ("Cannot read $directory: $!");
	while ( my $file = readdir ($dir) ) {
		print STDERR "Checking $file (for $postfix at $depth)\n" if $opt_v;
		if ( -d "${directory}/${file}"  and ! -l "${directory}/${file}" && $file !~ /^\./ ) {
			print STDERR "Entering directory ${directory}/${file}\n" if $opt_v;
			parsedirs ( "${directory}/${file}", $postfix, $depth - 1 );
		} 
		if ( -r "${directory}/${file}" && $file =~ /$postfix/ && $file !~ /^[\.\#]/ ) {
			parsedatafile($directory."/".$file,$file) if $file =~ /data$/;
			parsewmlfile($directory."/".$file,$file) if $file =~ /wml$/;
		}
	} # of the while
	closedir $dir;
	return 0;
}

buffer overflow168
076 194 458 517 451 578 1ldso 350 527 337 096 124 594 653 367 391 523 193 244 637 410 595 113 579 295 683 508 507 260 309 506 116 300 120 381 254 373 205 644 399 040 19980520 301 213 017 493 171 445 329 525 582 400 287 672 349 275 197 432 677 110 112 646 369 176 629 372 428 359 182 033 632 663 274 645 322 635 128 501 215 064 387 267 354 461 565 520 424 368 611 175 511 062 291 374 649 648 327 320 280 19981112 184 140 412 385 502 314 326 619 621 598 162 334 103 174 214 1libdb 657 074 593 641 640 623 044 20000702 217 328 281 183 384 398 407 376 587 609 190 298 397 321 624 165 186 268 345 516 494 216 069 643 455 179 676 060 550 625 547 406 530 166 141 252 031 19981122 19980110 185 597 248 390 356
several vulnerabilities78
443 358 572 311 495 662 236 234 388 486 288 324 536 379 480 535 312 237 638 607 235 436 652 265 468 475 515 691 519 187 526 232 360 549 543 332 532 434 442 642 241 489 465 361 479 195 524 240 440 423 266 467 481 188 576 239 562 497 472 439 546 667 243 531 669 639 238 448 336 457 482 365 470 654 450 491 196 242
insecure temporary file41
559 118 331 325 340 285 460 341 661 286 308 366 633 137 323 588 426 256 500 610 615 658 353 575 603 622 202 159 679 647 053 305 362 343 339 172 636 577 046 20001225 105
missing input validation27
548 627 686 690 496 678 568 650 542 566 604 469 682 626 689 471 680 552 612 563 688 402 518 504 247 596 631
integer overflow22
226 573 581 272 333 142 589 614 591 433 602 673 222 143 628 599 601 282 149 570 146 408
denial of service17
206 211 415 452 545 414 393 492 409 198 201 317 478 157 318 473 528
remote exploit16
20001122a 200 138 262 20000901 027 257 075 043 066 20001013a 070 106 123 134 111
format string14
684 485 685 447 370 671 513 510 687 616 529 487 670 592
privilege escalation12
463 675 509 161 303 154 681 20001219 668 302 304 173
local exploit10
20000902a 20001217a 041 20000910a 20001120 20000810 20000727 20001014 20001111a 1lynx
cross site scripting9
220 218 221 191 167 163 199 181 169
symlink attack9
059 048 090 20001217 20001122 20001123 20001129 20001130 20001201
remote root exploit9
1samba 045 1mgetty 034 20000911 087 20000719a 086 357
local root exploit9
1svgalib 092 189 1sperl 054 20000902 20001013 20001122b 403
format string vulnerability8
139 028 590 584 521 411 522 258
cross-site scripting7
351 126 533 355 125 371 147
failing function and TLB flush5
454 453 456 514 466
missing privilege release5
430 405 462 665 655
insecure temporary directory5
488 352 583 544 630
directory traversal5
534 346 344 209 499
insecure temporary file creation5
160 279 483 477 292
buffer overflows, integer overflow4
571 313 306 618
local privilege escalation4
20001121 276 270 20001118a
infinite loop4
586 255 261 613
heap overflow4
567 435 404 505
printf format attack3
057 072 061
remote DoS3
077 068 093
insecure execution3
296 293 284
arbitrary program execution3
036 158 204
insecure tempfile handling3
011 037 019
information leak3
431 180 253
missing function return value check3
438 444 441
insecure file creation3
540 446 283
remote buffer overflow3
127 013 012
missing HTML quoting3
251 250 249
arbitrary code execution3
192 490 164
missing boundary check3
417 413 427
buffer overflows, denial of service3
378 380 315
remote denial of service3
129 20001120a 035
possible remote exploit3
20001014a 20001014b 20001118
SQL injection3
347 229 338
remote DoS / exploit3
131 132 133
integer and stack overflow2
560 561
multiple vulnerabilities2
425 307
doubly freed memory2
145 233
vulnerable to symlink attack2
19980317a 19980317e
design flaw2
666 692
arbitrary command execution2
207 203
char-to-int conversion2
278 290
Buffer Overflow2
081 082
possible remote vulnerability2
382 383
local file overwrite2
039 056
integer overflow, buffer overflow2
348 297
symlink vulnerability2
108 553
remote command execution2
178 219
Cryptographic weakness2
273 269
improper setuid-root execution2
310 299
/tmp file creation problem2
19990823b 19990823c
remote root exploit in dhcp client2
20000728 20000628
invalid free(3)2
569 556
unauthorized file access1
114
open mail relay1
437
change default umask1
063
multiple remote exploits1
136
CRLF injection1
210
broken maintainer script1
015
local insecure crontab handling1
024
missing directory validation1
574
buffer overflow, directory traversal1
416
remote root exploit (and others)1
089
insecurely opens files in /tmp1
19980531
missing random seed1
152
sendmail 8.8.5 follows hardlinks when writing /var/tmp/dead.letter1
19970325a
buffer overflow, weak security1
042
misinterprets ISINDEX queries1
19980827e
influencing login1
091
buffer overflows and information leak1
026
insecure temporary files / directories1
620
buffer overflows and memory leak1
228
missing user input validation1
564
remote command invocation1
078
arbitrary file access1
600
remote unauthorized access1
055
local buffer overflow1
20001122c
unauthorized gathering of data1
080
Denial of service vulnerabilities in bind1
19991116
Root exploit in eterm1
19990218
buffer overflow, giving access to group games1
19980613
Symlink attack1
19990612
missing return value check1
660
/tmp race in sail1
19980828d
talkd does not check hostname length1
19970127
incorrect permissions1
335
ASN.1 parsing vulnerability1
394
libc NLSPATH buffer overflow1
19970213
inetd passes privileged groups on to subprocesses1
19970325b
remote DOS & potential buffer overflow1
029
3 remote exploits1
073
potential buffer overruns1
19980317c
proftpd running with incorrect userid, erroneous file removal1
032
remote root exploit in wu-ftpd1
20000623
unsafe temp file1
19981118
improperly sanitised input1
420
remote vulnerability1
422
Denial of service in 2.2-series kernel1
19990607
remote compromise1
20000910
improper variable initialization1
117
tftpd allows retrieval of files with ".." in their path1
19970323
local DoS1
20001125
local root exploit, remote client exploit1
119
Local root exploit1
101
faxsurvey script executes arbitrary commands1
19980827a
insufficient input validation1
617
password expiration1
421
buffer overflow and more1
224
arbitrary script execution1
156
ignored counter boundary1
245
cryptographic weakness1
429
remote exploit in htdig1
19991209
buffer overflow and format string attack1
014
root exploit in splitvt1
20000605a
source code disclosure1
170
buffer overflows in proftpd1
19991111a
buffer overflows, format string1
277
symlink attack in apcd1
20000201
problem with very long pathnames1
19980909
missing quoting, incomplete parser1
294
Buffer overflow in some FTP servers1
19990210
missing input validation, wrong calculation1
396
request-route used a lock file in /tmp1
1modutils
incorrect memory resizing1
289
local tempfile vulnerabilities1
023
insecure packet filtering rules1
389
buffer overflow / DoS1
135
Rare problem with corrupted file permissions1
19990823
local printf format attack1
058
Potential buffer overflow1
100
Uncontrolled program execution1
097
missing input validation processing1
538
"teardrop" attack1
1teardrop
buffer overflow, integer overflow1
651
routed permits remote user file overwrite1
19980317d
opens files in /tmp in an unsecure manner1
19980708
Security problem with temp file handling.1
19990215
access control problem and root exploit1
20000109
local insecure tempfile creation1
022
DoS attack1
104
Buffer overflow in sperl 5.0031
19970417
remote denial of service if using sendsys report mechanism1
19980828b
buffer overflow with very long paths1
19980922
wrong signal handler1
606
broken dropping of privileges1
052
possible shadow file compromise1
20000816
missing escape1
541
users can see files they shouldn't1
19991030
GNU tar sometimes unintentionally creates setuid-root executables.1
19970206a
The imapd, pop2d and pop3d servers allow remote, unauthenticated root access.1
19970302
Security problems corrected in new upstream version1
19990804
sort and tac vulnerable to symlink attack1
19980217
insecure /tmp file1
1xfree3
improper character escaping1
088
/tmp file attack1
1doom
cheating with detached signatures, circumvention of web of trust1
20001225b
uucp uid/gid access1
079
privilege leak1
418
Buffer overflow in INN inews program1
19990907
out of bound access1
498
buffer overflow, symlink problem, ".." directory traversal1
121
buffer overflows, miscellaneous security updates1
19990422
bypassing safe_mode, CRLF injection1
168
remote users can read files with webserver uid1
20000227
multiple problems1
212
math overflow errors1
263
The "screen" program overflows when copying the gecos field.1
19970220
symbolic link can be used to change file permissions1
19990331a
Multiple vulnerabilities in linux kernel1
3
race condition1
20001008
buffer overflows, arbitrary command execution1
364
information exposure1
223
SuperProbe (of XFree86) contains a number of buffer overflow1
19970304
displaying files despite lack of permissions1
19980508b
buffer overflows in bootpd and ftp1
19990104
Still remotely exploitable using buffer overflow1
20000830
incorrect input handling1
395
Improper handling of symlink permissions1
19990220
remotely triggered memory allocation error1
130
cookie path traversal1
459
stack overflow1
231
There is a vulnerability in PHP/FI, a NCSA httpd cgi enhancement1
19970416
Incorrect permissions on xmonisdn1
19990807
missing filename validation1
264
insecure permissions, spurious backup file1
230
Shell meta-characters permitted1
19980211
privacy escalation with Konqueror1
155
Buffer overflow1
19990823a
potential buffer overflow executable1
19980317b
root compromise in ftpwatch1
19990117
settings not honored1
605
daemon exploit1
102
Remote exploit1
067
buffer overflows and format string vulnerabilities1
148
Script problem in mc1
1mc
buffer overflows allowing local root access1
19980828a
file creation and corruption bug in XConsole1
19980509
potentially allows local root exploits1
19980827b
source disclosure1
225
problem with su1
19980513
session ID spoofing1
319
IRC session hijacking1
099
Buffer overflow in older versions of cfingerd1
19990806
buffer overflow causing potential remote root exploits, denial of service1
19980401
setuid ncurses programs allow opening arbitrary file1
19980827d
Vulnerability in POP-2 daemon1
19990607a
creates user "ftp" unauthorized1
19981126
buffer overflow in klock, kvt saves config as root1
19980530a
broken image handling1
464
failure to drop root privileges1
330
programming error1
585
remote exploit in ssh1
19991215a
buffer overflows in minicom if suid1
19980901
possible local exploit in mtr1
20000309
incorrect internal variable handling1
551
Missing PAM support1
025
incorrect signature verification1
20001111
insecure file handling, format string bug1
20001225a
rlogin doesn't check $TERM's length.1
19970206b
IP spoofing attack "land"1
1land
does not drop its root privileges1
19981207
broken boundary check and more1
115
mail group exploit in mailx1
20000605
buffer overflow, format string1
375
illegal file exposition1
150
denial of service, bounce-scanning1
363
untrustworthy privileged binaries1
20001121a
buffer overflows, file and directory exposure1
392
bug in capabilities handling allows root exploits1
20000612
insecure file permissions1
537
symlink attack in make1
20000217
buffer overflow, insecure tempfile handling, denial-of-service attack1
030
buffer overflow in the NFS server1
19991111
insecure socket creation1
1xfree
format strings1
401
format print vulnerability1
107
Buffer overflow in amd1
19990924
Buffer overflow in amd -- update1
19991018a
wrong file permissions1
555
insecure file handling1
1xfree2
allows remote to send arbitrary characters to local terminal1
19980508a
remote misuse of printer1
20001119
buffer overflow in qpopper1
19991215
broken privileges dropping, broken tempfile1
050
Command Execution Via URLs Vulnerability1
20000830a
Format string vulnerability1
085
buffer overflow, incorrect permissions1
316
possible buffer overflows in nslookup and dig1
19980905
information leak, integer underflow1
659
missing argument check1
503
buffer overflow in ftpd1
20000719
INN 1.5 parsecontrol1
1parsecontrol
Information Retrieval1
084
sudo allowed users to run any root command1
19980112b
cross-site scripting, directory traversal1
674
input validation bug1
386
remote exploit in nmh1
20000229
insufficient protection1
20001220
memory corruption1
071
incorrect file removal in boot script1
20000108
buffer overflows and other bugs1
227
unsafe mailcap configuration1
342
Root exploit in cron1
19990830
cross site code execution and privilege escalation1
153
missing filename validation, SQL injection1
419
symbolic link can be used to make any file world readable1
19990331
computer virus1
1bliss
buffer overflow in logging1
19981210
unauthenticated access1
512
Buffer overflow in lsof1
19990220a
insecure tempfile bug, broken mod_rewrite1
021
problem restoring symlinks1
19991202
It may be possible to make metamail execute arbitrary commands1
19970409
unauthorized escalation of privilege (update)1
20000821
Vulnerability in XFree861
19970702a
cross-realm1
476
mail user privilege escalation1
259
unauthorized remote code execution1
20000719b
integer overflows, missing input validation1
608
remote printf format attack1
049
unexpected _javascript_ execution1
051
remote nobody exploit1
018
exposes contents of local file1
20001009
malicious mails can execute arbitrary code1
19980827c
insecure tempfile1
038
information exposure, cross site scripting1
246
pipe exposure1
151
amd ignores nodev option1
19970407
unauthorized password change1
271
Denial of Service in Sendmail1
19991207
bug in access control mechanism1
20000619
remote file append/creation1
065
Buffer overflow in super.1
19990215a
unauthorized port forwarding1
1ssh
weak hostname and username validation1
634
cross-site scripting vulnerability1
109
insecure file access1
656
improper input handling1
144
root exploit in cfingerd1
19990814
UUCP exploit under smail1
19980112a
Vulnerability in elm1
19970702b
broken file permissions1
664
insecure signal handling1
083
buffer overflow, format string bugs1
449
various security problems in nis1
19991027
pre-set password1
554
null pointer dereference1
558
buffer overflow in mountd1
19980904
root exploit1
20000919
opens files in /tmp insecurely1
19980530b
remote Denial of Service1
20001112
multiple security problems1
047
missing privilege dropping1
557
weak administrator authentication1
19990623
failure to drop privileges1
484
reported exploit in dump1
20000328
malloc error (double free)1
122
temp file creation and format string1
016
remote DOS and remote information leak1
020
root compromise1
19980829
missing initialisation1
580
gzexe allows running arbitrary programs1
19980514
local root vulnerability1
095
format string vulnerability and buffer overflow1
098
standard buffer overrun(s) in minicom1
19970210
cross-site scripting hole1
094
Incorrect directory name handling in mirror1
19991018
ACL bypass1
474
insecure program execution1
377
vulnerable to a denial of service1
19980828c
serious security violation1
177
unauthorized escalation of privilege1
20000812
broken safe compartment1
208
temporary directory vulnerability1
539

Attachment: signature.asc
Description: Digital signature


Reply to: