Skip to main content
Mallory
← Back to News
internet-facing-service-vulnerabilityinitial-access-methodproof-of-concept-releasepayload-delivery-evasion

PHP Session Upload Progress Enables File Inclusion Code Execution

Vulnerability Disclosure · 5 sources · Updated 2mo ago · First seen Sep 4, 2015

PHP Session Upload Progress Enables File Inclusion Code Execution

A HITCON CTF exploit demonstrated how PHP's default session.upload_progress feature can be abused to place attacker-influenced data in a server-side session file and execute it through a local file inclusion (LFI) flaw. Against Ubuntu 18.04 with Apache and PHP 7.2, the technique used multipart upload progress, a timing race before session cleanup, and inclusion of the resulting session file despite the absence of remote file inclusion and a conventional session-start path.

The payload bypassed PHP's default upload-progress prefix and session-file formatting by applying chained Base64-decoding stream filters, transforming the stored session content into executable PHP. The technique illustrates the risk of PHP session-data injection when applications permit attacker-controlled file inclusion; organizations should disable unnecessary upload-progress tracking, restrict session-file access, and eliminate LFI primitives. Separately, older PHP unserialize() flaws involving SplDoublyLinkedList and __wakeup() could expose vulnerable pre-patch versions to memory disclosure or remote code execution when processing attacker-controlled serialized objects.

Do you run this?See affected versions and whether adversaries are exploiting it.
Check your exposure
Event timeline

How this story unfolded

Events from the most recent confirmed update back to the earliest known activity.

4 events · Aug 27, 2015 – Oct 23, 2018
  1. Oct 23, 20188y ago

    Proof-of-concept exploit published for HITCON CTF One Line PHP Challenge

    A public Python exploit script demonstrated the HITCON CTF 2018 One Line PHP Challenge chain by racing PHP_SESSION_UPLOAD_PROGRESS session-file writes and including the resulting session file through three Base64-decoding filters. If successful, its injected PHP payload downloads and executes a Perl script from orange.tw, demonstrating remote command execution.

    My-CTF-Web-Challenges/hitcon-ctf-2018/one-line-php-challenge/exp_for_php.py at master · orangetw/My-CTF-Web-Challenges · GitHub
  2. 2018

    HITCON CTF 2018 One Line PHP Challenge is solved by three teams

    HITCON CTF's One Line PHP Challenge targeted a default Ubuntu 18.04, PHP 7.2, and Apache deployment; three of 1,816 competing teams solved it. The intended chain used session upload-progress data, a race condition, local inclusion of a session file, and chained Base64-decoding PHP stream filters to achieve server-side code execution.

    HITCON CTF 2018 - One Line PHP Challenge | Orange Tsai
  3. Sep 4, 201511y ago

    PHP unserialize use-after-free disclosure released

    The disclosure and proof of concept for the PHP SplDoublyLinkedList deserialization use-after-free vulnerability were released. The flaw affected PHP releases before 5.6.13, 5.5.29, and 5.4.45.

    phpcodz/research/pch-034.md at master · 80vul/phpcodz · GitHub
  4. Aug 27, 201511y ago

    Taoguang Chen writes PHP unserialize use-after-free disclosure

    Taoguang Chen wrote a disclosure describing a use-after-free flaw in PHP unserialize() handling of SplDoublyLinkedList objects and crafted __wakeup() methods. The issue could enable memory disclosure or potentially remote code execution when attacker-controlled serialized data is processed.

    phpcodz/research/pch-034.md at master · 80vul/phpcodz · GitHub
Linked entities

Related entities

Vulnerabilities, threat actors, malware, products, organizations, breaches, and observables Mallory has linked to this story. Indicator values are masked here and available in full in the app.

Open in app →

Affected products

1 linked
Php

Observables

1 linked

Indicator values are masked on this page. See the values in Mallory Domains, IPs, hashes, and URLs are exportable to your SIEM.

Do you run this?See whether adversaries are exploiting this yet, and where the affected versions run in your environment.
Check Your Exposure
Mallory platform

See the full picture, correlated to your attack surface.

This page covers what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which threat actors are using it right now, and what to deploy next.

Exposure mappingMap indicators from this story to your assets and identify affected systems in minutes.
Threat actor evidenceEvery observed campaign, victim, and pivot linked to actors named in this story.
Associated malwareMalware, exploits, and IOCs connected to the activity described here.
Detection signaturesYARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Scheduled alertsGet matching new stories delivered to your team as they break, not the next morning.
AI threadsAsk questions about this story and take action on the answers.