CVE-2025-8264
Description
Versions of the package z-push/z-push-dev before 2.7.6 are vulnerable to SQL Injection due to unparameterized queries in the IMAP backend. An attacker can inject malicious commands by manipulating the username field in basic authentication. This allows the attacker to access and potentially modify or delete sensitive data from a linked third-party database. Note: This vulnerability affects Z-Push installations that utilize the IMAP backend and have the IMAP_FROM_SQL_QUERY option configured. Mitigation Change configuration to use the default or LDAP in backend/imap/config.php php define('IMAP_DEFAULTFROM', ''); or php define('IMAP_DEFAULTFROM', 'ldap');
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
z-push/z-push-devPackagist | < 2.7.6 | 2.7.6 |
Patches
1deb044a40e97Merge pull request #161 from matidau/cve20258264
1 file changed · +6 −1
src/backend/imap/user_identity.php+6 −1 modified@@ -208,9 +208,14 @@ function getIdentityFromSql($username, $domain, $identity, $encode = true) { $dbh = new PDO(IMAP_FROM_SQL_DSN, IMAP_FROM_SQL_USER, IMAP_FROM_SQL_PASSWORD, unserialize(IMAP_FROM_SQL_OPTIONS)); ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->getIdentityFromSql() - Connected to SQL Database")); - $sql = str_replace('#username', $username, str_replace('#domain', $domain, IMAP_FROM_SQL_QUERY)); + //replace config placeholdes with parameter placeholders + $sql = str_replace("'#username'", ":username", str_replace("'#domain'", ":domain", str_replace("'#username@#domain'", ":usernameatdomain", IMAP_FROM_SQL_QUERY))); + $usernameatdomain = $username . '@' . $domain; ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->getIdentityFromSql() - Searching From with filter: %s", $sql)); $sth = $dbh->prepare($sql); + if(mb_strpos($sql, ':username') !== false) $sth->bindValue(':username', $username, PDO::PARAM_STR); + if(mb_strpos($sql, ':domain') !== false) $sth->bindValue(':domain', $domain, PDO::PARAM_STR); + if(mb_strpos($sql, ':usernameatdomain') !== false) $sth->bindValue(':usernameatdomain', $usernameatdomain, PDO::PARAM_STR); $sth->execute(); $record = $sth->fetch(PDO::FETCH_ASSOC); if ($record) {
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
9- github.com/advisories/GHSA-w832-w3p8-cw29ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2025-8264ghsaADVISORY
- github.com/Z-Hub/Z-Push/blob/af25a2169a50d6e05a5916d1e8b2b6cd17011c98/src/backend/imap/user_identity.php%23L211C9-L214C25nvdWEB
- github.com/Z-Hub/Z-Push/commit/deb044a40e97dab1814da9aa8330c0a590957fc5ghsaWEB
- github.com/Z-Hub/Z-Push/pull/161nvdWEB
- github.com/Z-Hub/Z-Push/pull/161/commits/f981d515a35ac4c303959af21dce880a5db02786nvdWEB
- security.snyk.io/vuln/SNYK-PHP-ZPUSHZPUSHDEV-10908180nvdWEB
- xbow.com/blog/xbow-zpush-sqlighsaWEB
- xbow.com/blog/xbow-zpush-sqli/nvd
News mentions
0No linked articles in our index yet.