Modern web penetration testing often shifts from black-box guessing to targeted, evidence-driven exploitation. Different technology stacks—whether built on Node.js, Python, or traditional LAMP architectures—leak distinct signatures through HTTP headers, cookies, framework-specific paths, and error pages.
In this write-up, we dissect four distinct technology stacks (MERN, Next.js, Django, and LAMP), examine their unique fingerprinting signals, and walk through exploiting critical vulnerabilities ranging from Prototype Pollution to unauthenticated RCE.
1. MERN Stack & Prototype Pollution (CVE-2020-8203)
- Stack Identification: Express.js rarely sends an explicit server banner by default, but passive enumeration reveals the connect.sid session cookie and the x-powered-by: Express header. Automated scanners like Nikto also flag insecure cookie attributes (such as a missing HttpOnly flag).
- The Vulnerability: Prototype pollution via Object.prototype manipulation through constructor objects allows attackers to pollute application logic.
- Impact: CVSS 7.4 High — Leads to privilege escalation and authentication bypass.
2. Next.js & Middleware Bypass (CVE-2025-29927)
- Stack Identification: Production-mode Next.js applications running the App Router leak distinct headers like x-nextjs-cache, x-nextjs-prerender, and the definitive hydration array artifact window.__next_f in the page source.
- The Vulnerability: Next.js uses the internal x-middleware-subrequest header to prevent infinite recursion during internal middleware routing. However, the framework fails to validate whether this header originates internally or externally from an unauthenticated client.
- Exploitation: By injecting the repeated middleware module path (x-middleware-subrequest: middleware:middleware:middleware:middleware:middleware), the security gateway is bypassed entirely, granting direct unauthenticated access to protected routes like /dashboard.
- Impact: CVSS 9.1 Critical.
3. Django & SQL Injection via ORDER BY (CVE-2021-35042)
- Stack Identification: Django projects are easily fingerprinted via the WSGIServer or CPython server banner, SecurityMiddleware response headers (x-content-type-options: nosniff, referrer-policy: same-origin), the default csrftoken cookie, and the omnipresent csrfmiddlewaretoken hidden field in POST forms.
- The Vulnerability: When developers bypass the ORM and concatenate user input directly into query parameters—such as an unparameterized order_by() clause—database queries become vulnerable to injection.
- Exploitation: Utilizing error-based SQL injection techniques like updatexml(1, concat(0x7e, (select @@version)), 1) when DEBUG = True surfaces database contents and system versions directly within HTTP 500 error responses.
- Impact: CVSS 9.8 Critical.
4. LAMP Stack & Path Traversal RCE (CVE-2021-41773)
- Stack Identification: Apache explicitly advertises its exact version in the Server response header (e.g., Server: Apache/2.4.49 (Unix)), which maps directly to known vulnerabilities. A 403 Forbidden response on /cgi-bin/ confirms that CGI execution is enabled.
- The Vulnerability: A normalization flaw in ap_normalize_path() within Apache 2.4.49 breaks path traversal filters when sequence encodings like .%2e/ are used before full URL decoding takes place.
- Exploitation: Combining the traversal payload with --path-as-is in curl navigates out of the web root into /bin/sh. Passing shell commands via the HTTP POST body yields remote code execution under the privileges of the web daemon user.
- Impact: CVSS 9.8 Critical.
Key Takeaways
Stop Guessing, Start Targeting: Every web stack leaks identifiable signals. Learning to read headers, cookies, and framework artifacts turns noisy scanning into surgical execution.
Understand the Mechanics: Knowing why a vulnerability exists (such as improper header validation or path normalization errors) is essential for effective remediation and robust security engineering.