CVE-2012-1172
The file-upload implementation in rfc1867.c in PHP before 5.4.0 does not properly handle invalid [ (open square bracket) characters in name values, which makes it easier for remote attackers to cause a denial of service (malformed $_FILES indexes) or conduct directory traversal attacks during multi-file uploads by leveraging a script that lacks its own filename restrictions.
What to do
Fixed builds are available from Red Hat: see the table below for the fixed version per release.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Red Hat Enterprise Linux 6 | php | Fixed | 0:5.3.3-14.el6_3 | RHSA-2012:1046 |
| Red Hat Enterprise Linux 6 | php-bcmath | Fixed | 0:5.3.3-14.el6_3 | RHSA-2012:1046 |
| Red Hat Enterprise Linux 6 | php-cli | Fixed | 0:5.3.3-14.el6_3 | RHSA-2012:1046 |
| Red Hat Enterprise Linux 6 | php-common | Fixed | 0:5.3.3-14.el6_3 | RHSA-2012:1046 |
| Red Hat Enterprise Linux 6 | php-dba | Fixed | 0:5.3.3-14.el6_3 | RHSA-2012:1046 |
| Red Hat Enterprise Linux 6 | php-devel | Fixed | 0:5.3.3-14.el6_3 | RHSA-2012:1046 |
| Red Hat Enterprise Linux 6 | php-embedded | Fixed | 0:5.3.3-14.el6_3 | RHSA-2012:1046 |
| Red Hat Enterprise Linux 6 | php-enchant | Fixed | 0:5.3.3-14.el6_3 | RHSA-2012:1046 |
| Red Hat Enterprise Linux 6 | php-gd | Fixed | 0:5.3.3-14.el6_3 | RHSA-2012:1046 |
| Red Hat Enterprise Linux 6 | php-imap | Fixed | 0:5.3.3-14.el6_3 | RHSA-2012:1046 |
| Red Hat Enterprise Linux 6 | php-intl | Fixed | 0:5.3.3-14.el6_3 | RHSA-2012:1046 |
| Red Hat Enterprise Linux 6 | php-ldap | Fixed | 0:5.3.3-14.el6_3 | RHSA-2012:1046 |
| Red Hat Enterprise Linux 6 | php-mbstring | Fixed | 0:5.3.3-14.el6_3 | RHSA-2012:1046 |
| Red Hat Enterprise Linux 6 | php-mysql | Fixed | 0:5.3.3-14.el6_3 | RHSA-2012:1046 |
| Red Hat Enterprise Linux 6 | php-odbc | Fixed | 0:5.3.3-14.el6_3 | RHSA-2012:1046 |
| Red Hat Enterprise Linux 6 | php-pdo | Fixed | 0:5.3.3-14.el6_3 | RHSA-2012:1046 |
| Red Hat Enterprise Linux 6 | php-pgsql | Fixed | 0:5.3.3-14.el6_3 | RHSA-2012:1046 |
| Red Hat Enterprise Linux 6 | php-process | Fixed | 0:5.3.3-14.el6_3 | RHSA-2012:1046 |
| Red Hat Enterprise Linux 6 | php-pspell | Fixed | 0:5.3.3-14.el6_3 | RHSA-2012:1046 |
| Red Hat Enterprise Linux 6 | php-recode | Fixed | 0:5.3.3-14.el6_3 | RHSA-2012:1046 |
| Red Hat Enterprise Linux 6 | php-snmp | Fixed | 0:5.3.3-14.el6_3 | RHSA-2012:1046 |
| Red Hat Enterprise Linux 6 | php-soap | Fixed | 0:5.3.3-14.el6_3 | RHSA-2012:1046 |
| Red Hat Enterprise Linux 6 | php-tidy | Fixed | 0:5.3.3-14.el6_3 | RHSA-2012:1046 |
| Red Hat Enterprise Linux 6 | php-xml | Fixed | 0:5.3.3-14.el6_3 | RHSA-2012:1046 |
| Red Hat Enterprise Linux 6 | php-xmlrpc | Fixed | 0:5.3.3-14.el6_3 | RHSA-2012:1046 |
| Red Hat Enterprise Linux 6 | php-zts | Fixed | 0:5.3.3-14.el6_3 | RHSA-2012:1046 |
| Red Hat Enterprise Linux 5 | php | Fixed | 0:5.1.6-39.el5_8 | RHSA-2012:1045 |
| Red Hat Enterprise Linux 5 | php-bcmath | Fixed | 0:5.1.6-39.el5_8 | RHSA-2012:1045 |
| Red Hat Enterprise Linux 5 | php-cli | Fixed | 0:5.1.6-39.el5_8 | RHSA-2012:1045 |
| Red Hat Enterprise Linux 5 | php-common | Fixed | 0:5.1.6-39.el5_8 | RHSA-2012:1045 |
| Red Hat Enterprise Linux 5 | php-dba | Fixed | 0:5.1.6-39.el5_8 | RHSA-2012:1045 |
| Red Hat Enterprise Linux 5 | php-devel | Fixed | 0:5.1.6-39.el5_8 | RHSA-2012:1045 |
| Red Hat Enterprise Linux 5 | php-gd | Fixed | 0:5.1.6-39.el5_8 | RHSA-2012:1045 |
| Red Hat Enterprise Linux 5 | php-imap | Fixed | 0:5.1.6-39.el5_8 | RHSA-2012:1045 |
| Red Hat Enterprise Linux 5 | php-ldap | Fixed | 0:5.1.6-39.el5_8 | RHSA-2012:1045 |
| Red Hat Enterprise Linux 5 | php-mbstring | Fixed | 0:5.1.6-39.el5_8 | RHSA-2012:1045 |
| Red Hat Enterprise Linux 5 | php-mysql | Fixed | 0:5.1.6-39.el5_8 | RHSA-2012:1045 |
| Red Hat Enterprise Linux 5 | php-ncurses | Fixed | 0:5.1.6-39.el5_8 | RHSA-2012:1045 |
| Red Hat Enterprise Linux 5 | php-odbc | Fixed | 0:5.1.6-39.el5_8 | RHSA-2012:1045 |
| Red Hat Enterprise Linux 5 | php-pdo | Fixed | 0:5.1.6-39.el5_8 | RHSA-2012:1045 |
| Red Hat Enterprise Linux 5 | php-pgsql | Fixed | 0:5.1.6-39.el5_8 | RHSA-2012:1045 |
| Red Hat Enterprise Linux 5 | php-snmp | Fixed | 0:5.1.6-39.el5_8 | RHSA-2012:1045 |
| Red Hat Enterprise Linux 5 | php-soap | Fixed | 0:5.1.6-39.el5_8 | RHSA-2012:1045 |
| Red Hat Enterprise Linux 5 | php-xml | Fixed | 0:5.1.6-39.el5_8 | RHSA-2012:1045 |
| Red Hat Enterprise Linux 5 | php-xmlrpc | Fixed | 0:5.1.6-39.el5_8 | RHSA-2012:1045 |
| Red Hat Enterprise Linux 5 | php53 | Fixed | 0:5.3.3-13.el5_8 | RHSA-2012:1047 |
| Red Hat Enterprise Linux 5 | php53-bcmath | Fixed | 0:5.3.3-13.el5_8 | RHSA-2012:1047 |
| Red Hat Enterprise Linux 5 | php53-cli | Fixed | 0:5.3.3-13.el5_8 | RHSA-2012:1047 |
| Red Hat Enterprise Linux 5 | php53-common | Fixed | 0:5.3.3-13.el5_8 | RHSA-2012:1047 |
| Red Hat Enterprise Linux 5 | php53-dba | Fixed | 0:5.3.3-13.el5_8 | RHSA-2012:1047 |
| Red Hat Enterprise Linux 5 | php53-devel | Fixed | 0:5.3.3-13.el5_8 | RHSA-2012:1047 |
| Red Hat Enterprise Linux 5 | php53-gd | Fixed | 0:5.3.3-13.el5_8 | RHSA-2012:1047 |
| Red Hat Enterprise Linux 5 | php53-imap | Fixed | 0:5.3.3-13.el5_8 | RHSA-2012:1047 |
| Red Hat Enterprise Linux 5 | php53-intl | Fixed | 0:5.3.3-13.el5_8 | RHSA-2012:1047 |
| Red Hat Enterprise Linux 5 | php53-ldap | Fixed | 0:5.3.3-13.el5_8 | RHSA-2012:1047 |
| Red Hat Enterprise Linux 5 | php53-mbstring | Fixed | 0:5.3.3-13.el5_8 | RHSA-2012:1047 |
| Red Hat Enterprise Linux 5 | php53-mysql | Fixed | 0:5.3.3-13.el5_8 | RHSA-2012:1047 |
| Red Hat Enterprise Linux 5 | php53-odbc | Fixed | 0:5.3.3-13.el5_8 | RHSA-2012:1047 |
| Red Hat Enterprise Linux 5 | php53-pdo | Fixed | 0:5.3.3-13.el5_8 | RHSA-2012:1047 |
| Red Hat Enterprise Linux 5 | php53-pgsql | Fixed | 0:5.3.3-13.el5_8 | RHSA-2012:1047 |
| Red Hat Enterprise Linux 5 | php53-process | Fixed | 0:5.3.3-13.el5_8 | RHSA-2012:1047 |
| Red Hat Enterprise Linux 5 | php53-pspell | Fixed | 0:5.3.3-13.el5_8 | RHSA-2012:1047 |
| Red Hat Enterprise Linux 5 | php53-snmp | Fixed | 0:5.3.3-13.el5_8 | RHSA-2012:1047 |
| Red Hat Enterprise Linux 5 | php53-soap | Fixed | 0:5.3.3-13.el5_8 | RHSA-2012:1047 |
| Red Hat Enterprise Linux 5 | php53-xml | Fixed | 0:5.3.3-13.el5_8 | RHSA-2012:1047 |
| Red Hat Enterprise Linux 5 | php53-xmlrpc | Fixed | 0:5.3.3-13.el5_8 | RHSA-2012:1047 |
| Red Hat Enterprise Linux 4 | php | Not affected |
What the vendor says
As published in the CVE record by redhat, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
Vendor advisories:
- http://marc.info/?l=bugtraq&m=134012830914727&w=2 (vendor-advisory)
- http://lists.fedoraproject.org/pipermail/package-announce/2012-May/080070.html (vendor-advisory)
- http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00011.html (vendor-advisory)
- http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00007.html (vendor-advisory)
- http://lists.apple.com/archives/security-announce/2012/Sep/msg00004.html (vendor-advisory)
- http://lists.fedoraproject.org/pipermail/package-announce/2012-May/080041.html (vendor-advisory)
References
- http://marc.info/?l=bugtraq&m=134012830914727&w=2
- http://svn.php.net/viewvc/php/php-src/branches/PHP_5_4/main/rfc1867.c?r1=321664&r2=321663&pathrev=321664
- http://lists.fedoraproject.org/pipermail/package-announce/2012-May/080070.html
- https://bugs.php.net/bug.php?id=54374
- http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00011.html
- https://bugs.php.net/bug.php?id=49683
- https://nealpoole.com/blog/2011/10/directory-traversal-via-php-multi-file-uploads/
- http://svn.php.net/viewvc?view=revision&revision=321664
- http://openwall.com/lists/oss-security/2012/03/13/4
- https://bugs.php.net/bug.php?id=48597
- http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00007.html
- http://isisblogs.poly.edu/2011/08/11/php-not-properly-checking-params/
- http://lists.apple.com/archives/security-announce/2012/Sep/msg00004.html
- http://support.apple.com/kb/HT5501
- https://students.mimuw.edu.pl/~ai292615/php_multipleupload_overwrite.pdf
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.