|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesbasename-check-invalid-character-encoding-patch (last revision 2015-01-09 06:21 UTC by php at tokumaru dot org)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-08-02 20:27 UTC] cmb@php.net
-Status: Open
+Status: Not a bug
[2015-08-02 20:27 UTC] cmb@php.net
[2015-08-02 20:27 UTC] cmb@php.net
-Assigned To:
+Assigned To: cmb
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 22:00:01 2025 UTC |
Description: ------------ Function basename does not check invalid multibyte strings. For example, non-minimum UTF-8 forms are treated as normal file names. This is a potential path-traversal vulnerability like CVE-2008-2938. Test script: --------------- setlocale('LC_CTYPE', 'en_US.utf8'); var_dump(bin2hex(basename("..\xC0\xAFx"))); // \xC0\xAF is a non-minimum UTF-8 form of '/' Expected result: ---------------- string(2) "78" OR string(0) "" Actual result: -------------- string(10) "2e2ec0af78"