Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit bfa9060

Browse files
committed
Merge branch 'hotfix/zf2014-06'
ZF2014-06 patch Conflicts: README.md
2 parents 1def582 + 29fff0e commit bfa9060

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ IMPORTANT FIXES FOR 1.12.9
2222
users of unpatched PHP versions (PHP 5.5 <= 5.5.11, PHP 5.4 <= 5.4.27, all
2323
versions of PHP 5.3 and below). If you use `Zend_Ldap` and are on an affected
2424
version of PHP, we recommend upgrading immediately.
25+
- **ZF2014-06** `Zend_Db_Adapter_Sqlsrv` had a potential SQL injection
26+
vulnerability via improperly quoted null bytes. The code has been updated to
27+
ensure proper quoting and thus remove the security vector. If you are using
28+
`Zend_Db_Adapter_Sqlsrv` and manually quoting values via the adapter, we
29+
encourage you to upgrade immediately.
2530

2631
See http://framework.zend.com/changelog for full details.
2732

library/Zend/Db/Adapter/Sqlsrv.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ protected function _quote($value)
314314
return sprintf('%F', $value);
315315
}
316316

317+
$value = addcslashes($value, "\000\032");
317318
return "'" . str_replace("'", "''", $value) . "'";
318319
}
319320

tests/Zend/Db/Adapter/SqlsrvTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,4 +558,15 @@ public function getDriver()
558558
{
559559
return 'Sqlsrv';
560560
}
561+
562+
/**
563+
* test that quote() escapes null byte character
564+
* in a string.
565+
*/
566+
public function testAdapterQuoteNullByteCharacter()
567+
{
568+
$string = "1\0";
569+
$value = $this->_db->quote($string);
570+
$this->assertEquals("'1\\000'", $value);
571+
}
561572
}

0 commit comments

Comments
 (0)