pam_auth: ALERT - canary mismatch on efree() - heap overflow detected
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
php-auth-pam (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Running the attached PHP program with a correct username and password gives:
1: 1:
ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file 'unknown')
strace shows it uses /etc/pam.d/other, which just includes the common-* setups, which in my case is a standard pam_ldap setup.
$ apt-cache policy php5-auth-pam
php5-auth-pam:
Installed: 0.4-10
Candidate: 0.4-10
Version table:
*** 0.4-10 0
500 http://
100 /var/lib/
$ apt-cache policy php5
php5:
Installed: 5.2.6.dfsg.
Candidate: 5.2.6.dfsg.
Version table:
*** 5.2.6.dfsg.
500 http://
500 http://
100 /var/lib/
5.
500 http://
I have just built a virgin Ubuntu system, with:
$ apt-cache policy php5
php5:
Installed: 5.2.4-2ubuntu5.6
Candidate: 5.2.4-2ubuntu5.6
Version table:
*** 5.2.4-2ubuntu5.6 0
500 http://
500 http://
100 /var/lib/
5.2.4-2ubuntu5 0
500 http://
$ apt-cache policy php5-auth-pam
php5-auth-pam:
Installed: 0.4-10
Candidate: 0.4-10
Version table:
*** 0.4-10 0
500 http://
100 /var/lib/
... which also shows the same problem. This system is using a completely unmodified pam setup (i.e. pam_unix).
Hello,
Bug is in arguments handling:
--8<--
case 2:
if (zend_get_ parameters_ ex(2, &username, &password) ==FAILURE) {
RETURN_ FALSE;
}
break;
case 3:
if (zend_get_ parameters_ ex(3, &username, &password, &status) == FAILURE) {
RETURN_ FALSE;
}
if (!PZVAL_ IS_REF( *status) ) {
php_ error(E_ WARNING, "Error variable must be passed by reference");
RETURN_ FALSE;
}
pval_ destructor( *status) ;
break;
default:
WRONG_ PARAM_COUNT;
break;
cnt = ARG_COUNT(ht);
switch (cnt) {
}
--8<--
Dirty workarounds : r(*status) ;" line and rebuild the package.
- don't use third args. use only two args.
- Comment "pval_destructo