Page MenuHomePhabricator

File extension is improperly parsed when filename contains a dot
Closed, InvalidPublic

Description

Author: nep

Description:
When uploading a file which contains a . in the filename, the file extension is improperly reported
from implode(). For example, when uploading "ADFVersion1.0.doc", the file extension is determined
as "0.doc"


Version: 1.3.x
Severity: normal

Details

Reference
bz1681

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:16 PM
bzimport set Reference to bz1681.
bzimport added a subscriber: Unknown Object (MLST).

avarab wrote:

SpecialUpload.php (against HEAD and REL1_4)

A patch against HEAD and REL1_4 which fixes the issue.

Attached:

Multiple extensions are checked to protect against multiple extension attacks, such
as uploading "Hack.php.ogg" which would in older versions be passed as OGG but
on some web server configurations would be interpreted as executable PHP.

gangleri wrote:

*** Bug 3836 has been marked as a duplicate of this bug. ***