File: CVE-2011-4075.dpatch

package info (click to toggle)
phpldapadmin 1.1.0.5-6%2Blenny2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 5,008 kB
  • ctags: 3,949
  • sloc: php: 17,735; xml: 1,532; sh: 388; makefile: 46
file content (23 lines) | stat: -rw-r--r-- 1,152 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#! /bin/sh /usr/share/dpatch/dpatch-run
## CVE-2011-4075.dpatch by Deon George <wurley@users.sf.net>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: SF Bug #3417184 - PHP Code Injection Vulnerability
## DP: http://phpldapadmin.git.sourceforge.net/git/gitweb.cgi?p=phpldapadmin%2Fphpldapadmin;a=commitdiff_plain;h=76e6dad13ef77c5448b8dfed1a61e4acc7241165

@DPATCH@
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' phpldapadmin-1.1.0.5~/lib/functions.php phpldapadmin-1.1.0.5/lib/functions.php
--- phpldapadmin-1.1.0.5~/lib/functions.php	2011-10-27 11:22:28.000000000 +0100
+++ phpldapadmin-1.1.0.5/lib/functions.php	2011-10-27 12:47:01.000000000 +0100
@@ -2983,8 +2983,9 @@
 		debug_log('Entered with (%s,%s,%s)',1,__FILE__,__LINE__,__METHOD__,
 			$data,$sortby,$rev);
 
-	# if the array to sort is null or empty
-	if (! $data) return;
+	# if the array to sort is null or empty, or if we have some nasty chars
+	if (! preg_match('/^[a-zA-Z0-9_]+(\([a-zA-Z0-9_,]*\))?$/',$sortby) || ! $data)
+		return;
 
 	static $sort_funcs = array();