Case Study

Four criticals, one legacy stack

A confidential engagement for a client operating a long-lived PHP application. We were given full source access for a combined white-box code review and penetration test. Within a short assessment window we identified four high-impact vulnerabilities, each formally documented and delivered as a remediation-focused report. The client is unnamed under NDA; the findings below are shared with permission and generalised so no system is identifiable.

Engagement

Engagement at a glance

Scope

White-box review & penetration test of a legacy PHP application

Full source access

Result

Four high-to-critical findings, each with a working proof of concept

Short assessment window

Delivery

Formal written report with severity ratings and prioritised remediation

Client under NDA

Key findings

Critical · Authentication

Account Takeover via Mobile OAuth

An exposed endpoint in the mobile OAuth flow could be coerced into issuing a valid session token for any account, needing nothing more than the target's email address. In practice this meant full impersonation of any user, including privileged ones. Root cause was a missing authorisation check on a token-issuing route; remediated by binding token issuance to an authenticated, verified device grant.

Critical · Injection

Remote Code Execution

User-controlled input reached a system shell context through a query parameter, allowing arbitrary commands to run on the host and, from there, full system access. We demonstrated controlled command execution without disrupting the live environment. Remediated by removing the shell call in favour of a safe native API and strictly validating all input.

High · SSRF

Server-Side Request Forgery

A server-side fetch built on file_get_contents() trusted a user-supplied target, letting an attacker make the server issue requests to arbitrary remote and internal endpoints. This opens the door to internal network reconnaissance and cloud metadata theft. Remediated with an allow-list of permitted hosts and protocol restrictions on outbound requests.

High · XSS

Cross-Site Scripting via Sharing

Several front-end fields rendered user input without escaping. Combined with the application's built-in sharing feature, this let a malicious payload be delivered straight to other users, turning a routine share into a vehicle for session theft and account compromise. Remediated with context-aware output encoding and a content security policy.

Why source access mattered

Three of the four findings would have been difficult to reach from a black-box position. The OAuth token-issuing route was not linked from anywhere in the application; it existed to serve a mobile client and was discoverable only by reading the route definitions. The shell call behind the remote code execution finding was reachable through a parameter that looked innocuous from the outside. A black-box test would plausibly have found the cross-site scripting and missed the rest.

From symptom to pattern

The unescaped output we found was not confined to the field where we first noticed it. Once we had identified the pattern, a search across the codebase found the same mistake in several other templates, some of which were not reachable by a user at the time but would have become so with a single routing change.

Reported as four separate symptoms, these would have been four patches. Reported as a pattern, it was one change to how the application escapes output, applied everywhere at once.

Each issue was reproduced, evidenced, and handed over with a clear, prioritised remediation path. Having source access let us trace every finding to its root cause rather than stopping at the symptom, so the fixes closed the underlying pattern across the codebase instead of a single endpoint.

If any of this looks like your stack, the conversation starts with scope. Tell us what you have built and what worries you about it.