DEV Community

Cover image for PHP2Shell: How to Identify Vulnerable PHP Backends Through Mobile App Security Testing
MyAppScan
MyAppScan

Posted on

PHP2Shell: How to Identify Vulnerable PHP Backends Through Mobile App Security Testing

PHP2Shell: How to Identify Vulnerable PHP Backends Through Mobile App Security Testing

Mobile applications are often treated as standalone products, but most modern applications depend heavily on backend APIs.

You can have a securely implemented Android or iOS application and still expose your users to serious security risks through vulnerable backend infrastructure.

PHP2Shell is a good example of why mobile application security testing should go beyond the APK or IPA.

In this article, we'll explore what PHP2Shell means for mobile applications, how to identify potentially affected PHP backends, and what penetration testers should investigate.

  1. What Is PHP2Shell?

PHP2Shell refers to two PHP runtime vulnerabilities:

  • CVE-2026-109618
  • CVE-2026-109619

These vulnerabilities can potentially lead to remote code execution (RCE) on affected PHP servers.

The vulnerabilities target PHP runtime internals rather than a particular PHP framework or CMS.

This means that applications using Laravel, Symfony, custom PHP APIs, or other PHP-based solutions may require investigation.

The important distinction: PHP2Shell is a server-side vulnerability, not an Android or iOS vulnerability.

  1. Can a Mobile Application Be Affected?

Yes, indirectly.

Consider a typical mobile application architecture:

Android / iOS Application
|
| HTTPS
v
API Gateway
|
v
PHP Backend
|
v
Database

The mobile application communicates with backend APIs over HTTPS.

If those APIs are powered by a vulnerable PHP runtime, the backend infrastructure may be exposed.

Potential consequences include:

  • Remote code execution on the server.
  • Exposure of sensitive application data.
  • Compromise of API credentials.
  • Unauthorized access to backend resources.
  • Service disruption.

This does not mean that an attacker can automatically execute code on the mobile device itself.

The vulnerable component is the backend PHP runtime.

  1. Step One: Identify Backend API Endpoints

Start by identifying the endpoints used by the mobile application.

Static Analysis

For Android applications, useful tools include:

  • JADX
  • APKTool
  • MobSF

Search the decompiled application for:

https://api.example.com
https://backend.example.com
/api/v1/
/auth/login

Look for:

  • API base URLs.
  • Authentication endpoints.
  • File upload endpoints.
  • WebView destinations.
  • Third-party integrations.

For iOS, inspect the application binary and associated configuration files using appropriate iOS static analysis tools.

Remember that identifying an API hostname does not tell you which backend technology it uses.

Dynamic Analysis

Use Burp Suite or mitmproxy to intercept application traffic.

Perform normal application operations:

  1. Login and registration.
  2. Profile updates.
  3. File uploads.
  4. Image uploads.
  5. Password recovery.
  6. Data retrieval.
  7. Other authenticated operations.

Build an inventory of backend hosts and endpoints.

This inventory becomes the foundation of the backend security assessment.

  1. Step Two: Identify PHP Indicators

Once you have identified the API endpoints, inspect their HTTP responses.

For example:

HTTP/2 200 OK
Content-Type: application/json
X-Powered-By: PHP/8.4.26

Other possible indicators include:

Set-Cookie: PHPSESSID=xxxxxxxx

You may also encounter PHP-related error messages or PHP-specific endpoint paths.

You can inspect response headers using:

curl -I https://api.example.com

However, these indicators are not conclusive.

An application can remove its PHP headers, customize its session cookies, or expose extensionless API routes.

No PHP header does not mean no PHP backend.

Likewise, identifying PHP does not confirm PHP2Shell.

  1. Step Three: Investigate Multipart Upload Endpoints

One particularly interesting area during PHP backend assessments is multipart request handling.

PHP2Shell research describes attack paths involving PHP multipart request processing and session upload progress functionality.

Mobile applications commonly use multipart requests for:

  • Profile pictures.
  • Document uploads.
  • Chat attachments.
  • Image uploads.
  • Import functionality.

For example:

POST /api/upload HTTP/1.1
Host: api.example.com
Content-Type: multipart/form-data; boundary=----Boundary

------Boundary
Content-Disposition: form-data; name="file"; filename="image.jpg"
Content-Type: image/jpeg

[FILE CONTENT]
------Boundary--

During testing, identify all endpoints accepting multipart/form-data.

Investigate the backend's PHP configuration, especially:

  • PHP session upload progress settings.
  • PHP runtime version.
  • PHP-FPM configuration.
  • Request processing configuration.
  • Memory limits.

Do not assume that every multipart endpoint is vulnerable. The actual exposure depends on the affected runtime and applicable conditions.

  1. Step Four: Verify the PHP Runtime Version

The next step is determining whether the backend uses an affected PHP release.

The initial fixed releases for the affected branches were:

PHP Branch| Initial fixed release
PHP 8.5| 8.5.12
PHP 8.4| 8.4.27
PHP 8.3| 8.3.36
PHP 8.2| 8.2.35

For example, if an API response exposes:

X-Powered-By: PHP/8.4.26

This is a reason to investigate further.

It is not sufficient evidence to report confirmed PHP2Shell exploitation.

Ask the backend or infrastructure team to verify:

  1. The actual PHP runtime version.
  2. Whether the relevant security patches are installed.
  3. Whether all PHP workers are running the patched version.
  4. Whether the affected configuration and execution paths are present.

Always consult the official PHP security advisory for the latest releases and branch-specific guidance.

  1. Can You Test PHP2Shell Through Burp Suite?

Burp Suite is useful for identifying backend endpoints, examining HTTP requests, and understanding how the mobile application communicates with its server.

However, Burp Suite alone cannot confirm whether the PHP runtime is vulnerable.

A practical assessment workflow looks like this:

    Mobile Application
            |
            v
      Burp Suite
            |
            v
    Identify API Hosts
            |
            v
   Identify PHP Indicators
            |
            v
  Identify Multipart Endpoints
            |
            v
  Request Runtime Verification
            |
            v
   Validate Patch Status
            |
            v
   Report Confirmed Exposure
Enter fullscreen mode Exit fullscreen mode

Avoid blindly sending public proof-of-concept payloads to production APIs.

PHP2Shell testing may involve memory corruption and resource exhaustion. Testing should be performed in an authorized environment with appropriate safeguards.

  1. How Should You Report It?

If you identify a potentially affected backend during a mobile application penetration test, document it separately from client-side vulnerabilities.

Suggested finding:

Title: Potential PHP2Shell Exposure in Mobile Application Backend

Affected Component: Backend API infrastructure.

Description:

During the mobile application security assessment, API endpoints were identified that appear to use PHP.

The backend may be running a PHP runtime affected by CVE-2026-109618 and CVE-2026-109619.

If the affected runtime and configuration conditions are present, successful exploitation could result in remote code execution on the backend server.

Recommendation:

  • Upgrade affected PHP installations to fixed releases.
  • Verify PHP-FPM and other PHP worker processes have restarted.
  • Review PHP configuration and session upload progress settings.
  • Review server logs for suspicious activity.
  • Investigate possible compromise if the server was exposed while vulnerable.

Important: Do not classify the issue as confirmed PHP2Shell solely because an HTTP response reveals an affected PHP version.

  1. Scan Your Mobile Applications with MyAppScan

Identifying backend vulnerabilities is only one part of a comprehensive mobile application security assessment. The mobile application itself also needs to be assessed for security weaknesses.

If you're a developer, penetration tester, or security researcher looking for a way to analyze mobile application security, check out "MyAppScan" (https://myappscan.com).

"https://myappscan.com" (https://myappscan.com)

MyAppScan is an online mobile application vulnerability scanner designed to help identify potential security weaknesses in mobile applications.

It provides an additional layer of security testing to help developers and security professionals assess their mobile applications and identify issues that may require further investigation.

Whether you're developing a new mobile application or conducting a security assessment, MyAppScan can be a useful addition to your mobile application security toolkit.

Give it a try: https://myappscan.com

  1. Final Thoughts

Mobile application security is not limited to reverse engineering APKs, analyzing IPA files, or identifying insecure local storage.

Backend infrastructure is an equally important part of the attack surface.

PHP2Shell demonstrates why penetration testers should investigate the technologies powering mobile application APIs.

The next time you perform a mobile application assessment, don't stop after identifying insecure client-side functionality.

Investigate the backend.

Because sometimes, the biggest vulnerability in a mobile application isn't inside the application at all.


References

Disclaimer: This article is intended for authorized security testing and educational purposes only.

Top comments (0)