Description
The mconvert function in softmagic.c in file before 5.21, as used in the Fileinfo component in PHP before 5.4.37, 5.5.x before 5.5.21, and 5.6.x before 5.6.5, does not properly handle a certain string-length field during a copy of a truncated version of a Pascal string, which might allow remote attackers to cause a denial of service (out-of-bounds memory access and application crash) via a crafted file.
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | file | 1:5.21+15-1 | — |
| Debian 13 | file | 1:5.21+15-1 | — |
| Debian 12 | file | 1:5.21+15-1 | — |
| Debian 7 | file | 5.11-2+deb7u7 | DSA-3121-1 |
| Debian 7 | php5 | 5.4.36-0+deb7u3 | DSA-3126-1 |
| Debian 6.0 | php5 | 5.3.3-7+squeeze24 | DLA-145-1 |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 14.04 LTS | file | 1:5.14-2ubuntu3.3 | — |
| Ubuntu 14.04 LTS | php5 | 5.5.9+dfsg-1ubuntu4.6 | USN-2501-1 |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| RHEL 7 | file +4 | 5.11-31.el7 | RHSA-2015:2155 |
| RHEL 7 | php +24 | 5.4.16-36.ael7b_1 | RHSA-2015:1135 |
| RHEL 2 | php54 +5 | 2.0-1.el6 | RHSA-2015:1066, RHSA-2015:1053 |
| RHEL 2 | php54-php +24 | 5.4.40-1.el6 | RHSA-2015:1066 |
| RHEL 2 | php54-php-pecl-zendopcache | 7.0.4-3.el6 | RHSA-2015:1066 |
| RHEL 2 | php55-php +26 | 5.5.21-2.el6 | RHSA-2015:1053 |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 12 | php5 | 5.5.14-15.1 | SUSE-SU-2015:0424-1 |
| SLES 11 SP2 | php53 | 5.3.17-47.1 | SUSE-SU-2016:1638-1 |
Oracle Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Oracle Linux 7 | file +4 | 5.11-31.el7 | ELSA-2015-2155 |
| Oracle Linux 7 | php +24 | 5.4.16-36.el7_1 | ELSA-2015-1135 |
| Oracle Linux 7 | php54 +5 | 2.0-1.el7 | ELSA-2015-1066, ELSA-2015-1053 |
| Oracle Linux 7 | php54-php +22 | 5.4.40-1.el7 | ELSA-2015-1066 |
| Oracle Linux 7 | php54-php-imap +1 | 5.4.40-1.el6 | ELSA-2015-1066 |
| Oracle Linux 7 | php54-php-pecl-zendopcache | 7.0.4-3.el7 | ELSA-2015-1066 |
| Oracle Linux 7 | php55-php +26 | 5.5.21-2.0.1.el6 | ELSA-2015-1053 |
Advisories 14
- RHSA-2015:2155 Red Hat Security Advisory: file security and bug fix update Red Hat Security Advisories (RHSA) · Jun 29, 2026
- RHSA-2015:1135 Red Hat Security Advisory: php security and bug fix update Red Hat Security Advisories (RHSA) · Jun 29, 2026
- RHSA-2015:1066 Red Hat Security Advisory: php54 security and bug fix update Red Hat Security Advisories (RHSA) · Jun 29, 2026
- RHSA-2015:1053 Red Hat Security Advisory: php55 security and bug fix update Red Hat Security Advisories (RHSA) · Jun 29, 2026
- USN-2501-1 php5 vulnerabilities Ubuntu Security Notices (USN) · Apr 22, 2026
- DSA-3121-1 file - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DSA-3126-1 php5 - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DLA-145-1 php5 - security update Debian Security (DSA / DLA) · Mar 9, 2026
- SUSE-SU-2015:0424-1 Security update for php5 SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2016:1638-1 Security update for php53 SUSE / openSUSE Security Updates · Feb 4, 2026
- ELSA-2015-1066 Important: php54 security and bug fix update (Oracle Linux 7) Oracle Linux Security Advisories (ELSA) · Feb 4, 2016
- ELSA-2015-1053 Moderate: php55 security and bug fix update (Oracle Linux 7) Oracle Linux Security Advisories (ELSA) · Feb 4, 2016
- ELSA-2015-2155 Moderate: file security and bug fix update (Oracle Linux 7) Oracle Linux Security Advisories (ELSA) · Nov 23, 2015
- ELSA-2015-1135 Important: php security and bug fix update (Oracle Linux 7) Oracle Linux Security Advisories (ELSA) · Jun 23, 2015
References
- HPSBMU03409 vendor-advisory
- 72505 vdb-entry
- APPLE-SA-2015-09-30-3 vendor-advisory
- HPSBMU03380 vendor-advisory
- http://www.oracle.com/technetwork/topics/security/linuxbulletinjan2016-2867209.html
- http://www.oracle.com/technetwork/topics/security/bulletinjul2015-2511963.html
- openSUSE-SU-2015:0440 vendor-advisory
- https://github.com/file/file/commit/59e63838913eee47f5c120a6c53d4565af638158
- http://php.net/ChangeLog-5.php
- http://www.oracle.com/technetwork/topics/security/linuxbulletinoct2015-2719645.html
- https://support.apple.com/HT205267
- SUSE-SU-2015:0436 vendor-advisory
- https://bugs.php.net/patch-display.php?bug=68735&patch=bug68735.patch&revision=1420309079
- SUSE-SU-2015:0424 vendor-advisory
- RHSA-2015:1135 vendor-advisory
- http://bugs.gw.com/view.php?id=398
- GLSA-201701-42 vendor-advisory
- RHSA-2015:1053 vendor-advisory
- [oss-security] 20150205 Re: CVE Request: PHP/file: out-of-bounds memory access in softmagic mailing-list
- RHSA-2015:1066 vendor-advisory
- https://bugs.php.net/bug.php?id=68735