Skip to content
Pwnversity
WEB-INFO-DISCLOSUREintermediate · 15 min · upd. 2026-11

Information disclosure

OWASP A02:2025CWE-200CWE-209CWE-215CWE-540

Information disclosure happens when the application unintentionally hands over data it shouldn’t: credentials in an HTML comment, the full SQL query in an error message, the absolute path of the code, environment variables on a debug page. On its own it’s usually low or medium severity; its value lies in what it unlocks. An absolute path makes an LFI or an upload work; an exact version points to a known exploit; a signing key lets you forge sessions. Before exploiting anything, look at what the application gives away.

flowchart LR
    H["Raw HTML<br/>comments, hidden, data-*"] --> I["Information"]
    E["Error traces<br/>broken input or protocol"] --> I
    D["Debug and diagnostics<br/>phpinfo, Werkzeug, actuator"] --> I
    F["Exposed files<br/>.git, .env, backups, .map"] --> I
    I --> R["Absolute path → LFI, upload"]
    I --> V["Version → known exploit"]
    I --> Q["SQL query → SQLi"]
    I --> K["Key or secret → forge session, service access"]

The attacker needs no privileges: they read what the application already sends, or trigger errors the application doesn’t handle. What they get falls into two groups:

  • Directly exploitable data: credentials, API keys, other users’ session tokens, signing keys (SECRET_KEY, APP_KEY).
  • Data that steers the attack: paths, versions, table and column names, internal hosts, unlinked endpoints.

The second group is the most common and the most underrated in reports.

The sources, from most passive to most active:

Source What it tends to give away Example
HTML and JS served by the server Test credentials, endpoints, front-end config <!-- TODO: remove admin/admin123 -->
Response headers Software and version Server: Apache/2.4.49, X-Powered-By: PHP/7.4.3
Error messages and traces Absolute paths, framework, queries, code fragments Fatal error in /var/www/html/app/db.php on line 42
Debug mode Environment variables, configuration, sometimes a console Django’s yellow page, the Werkzeug debugger
Diagnostic endpoints Full configuration, memory, other users’ requests phpinfo.php, /actuator/heapdump, trace.axd
Exposed files Code, history, credentials /.git/, /.env, backup.zip, .DS_Store, app.js.map
API documentation Every endpoint with its parameters /swagger.json, /openapi.json, /api-docs

Exposed files and JavaScript code have their own pages: see hidden content and files and JavaScript analysis. This page focuses on the rest.

The HTML the server sends isn’t what the browser paints. The browser inspector shows the processed DOM, in whatever state the JavaScript left it, which may have removed or changed nodes; what you want is the raw response, with curl or View source (Ctrl+U).

Where What’s usually there
Comments <!-- … --> Test credentials, internal paths, developer notes
<input type="hidden"> Tokens, IDs, role flags (is_admin=0)
data-* attributes Endpoints, service keys, configuration
SPA initial state window.__INITIAL_STATE__ = {…}, <script id="__NEXT_DATA__">: users, configuration, endpoints
src, href, integrity Resource paths and library versions

A single finding is rarely enough. The usual pattern is chaining: the endpoint comes from a comment, the token from a hidden field, and together they give access to an unlinked resource.

A badly handled exception returns the call stack. To trigger it you give the application something it doesn’t expect:

What to break How
The data type An array where it expects text (id[]=1), text where it expects a number, null, a JSON object
The content A quote ', unusual Unicode characters, huge values, IDs that don’t exist or are negative
The protocol A disallowed method (PUT, DELETE), a mismatched Content-Type, a malformed JSON body, an invalid header

Each framework looks different, and some give away much more than a trace:

Framework Signal What it can give you
Flask / Werkzeug in debug mode Debugger page with an interactive trace A Python console in the browser, protected by a PIN that can be computed from system data
Django with DEBUG = True Yellow page with a trace; the 404 lists the URL patterns Settings (anything that looks sensitive is masked: SECRET_KEY doesn’t show), local variables in the trace, every route in the application
Laravel with APP_DEBUG=true Whoops (up to 5.8) or Ignition (6+) Whoops: $_ENV and $_SERVER, including APP_KEY unless filtered with debug_blacklist. Ignition: request, routes, queries and versions; its risk lies in CVE-2021-3129
Spring Boot Whitelabel Error Page Tells you it’s Spring; the /actuator endpoints are the next thing to check
ASP.NET with customErrors off Yellow Screen of Death Stack, paths, .NET and ASP.NET versions
PHP with display_errors=On Warning: … in /var/www/html/… The absolute docroot path
Node.js / Express in development Plain-text call stack Project paths and modules

A forgotten info.php, test.php or phpinfo.php dumps the whole PHP configuration. What to look at first:

What Why
$_ENV, $_SERVER Database passwords, API keys, tokens passed as environment variables
DOCUMENT_ROOT, SCRIPT_FILENAME Absolute paths: where to read with LFI or where to write with an upload
PHP version and extensions Known bugs and capabilities (for example whether curl, ssh2, imagick are present)
disable_functions Which execution functions are still available (system, exec, passthru, shell_exec, proc_open, popen)
open_basedir How far an LFI can reach
allow_url_include Whether remote inclusion (RFI) is possible
file_uploads, upload_tmp_dir Where the temporary files of any upload land

phpinfo() also prints the request’s cookies, including HttpOnly ones. An XSS that can’t read document.cookie can still request the phpinfo() page and read the session cookie from the output.

Endpoint Technology What it exposes
/actuator/env, /actuator/configprops Spring Boot Configuration and variables (Spring Boot 3 masks values by default). Since Boot 2 only health is exposed over HTTP: if these respond, someone enabled them
/actuator/mappings Spring Boot Every endpoint in the application, including those fuzzing won’t find
/actuator/heapdump Spring Boot JVM memory dump: secrets, active sessions, user data
trace.axd ASP.NET with remote tracing Other users’ recent requests, with headers, cookies and session
/server-status Apache mod_status In-flight requests, client IPs, URLs with parameters
/debug/pprof/ Go Runtime profiles; cmdline returns the arguments the process was started with

A memory dump with active sessions is straight account takeover: nothing else needs to break.

Ventana de terminal
# Raw response and headers
curl -si http://app.lab.local/ | head -20
# Comments, hidden fields, data-* and SPA state
curl -s http://app.lab.local/ | grep -noiE '<!--.*-->|type="?hidden"?[^>]*|data-[a-z-]+="[^"]*"|__(INITIAL_STATE|NEXT_DATA)__'
# Keywords
curl -s http://app.lab.local/ | grep -niE 'api[_-]?key|token|secret|passw|internal|staging|todo'

Repeat on every relevant page, not just the home page: the user dashboard, forms and error pages tend to have more.

Ventana de terminal
# Unexpected type: array instead of a value
curl -s "http://app.lab.local/item?id[]=1"
# Quote: SQL error, often with the query
curl -s "http://app.lab.local/item?id=1'"
# Disallowed method and malformed body
curl -s -X PUT http://app.lab.local/api/items
curl -s http://app.lab.local/api/items -H 'Content-Type: application/json' -d '{"id":'
# A non-existent path on a framework in debug mode (Django lists its routes)
curl -s http://app.lab.local/does-not-exist-xyz | grep -iE 'urlpatterns|Using the URLconf'

What you get and what to chain it to:

What shows up Next step
Absolute path (/var/www/html/...) Paths for LFI and a target for an upload with traversal
Framework and exact version Look for known bugs (searchsploit, NVD)
SQL query with tables and columns SQLi with the structure already known
SECRET_KEY, APP_KEY, JWT key Forge session cookies or JWTs
Internal hosts and IPs SSRF targets, always within scope
Debug console Direct RCE, or after computing the PIN
Ventana de terminal
# Typical diagnostic files (ffuf with .php extension and auto-calibration)
ffuf -u http://app.lab.local/FUZZ -w /usr/share/seclists/Discovery/Web-Content/common.txt \
-e .php -ac -mc 200 | grep -iE 'info|test|debug|status'
# phpinfo: the important bits on one line each
curl -s http://app.lab.local/info.php | sed 's/<[^>]*>/ /g' | \
grep -iE 'DOCUMENT_ROOT|disable_functions|open_basedir|allow_url_include|PASS|KEY|TOKEN|SECRET'
# Spring Boot Actuator
# (Boot 2+ under /actuator/; Boot 1.x at the root)
for e in env mappings configprops heapdump; do
for p in actuator/$e $e; do
printf '%s /%s\n' "$(curl -s -o /dev/null -w '%{http_code}' http://app.lab.local/$p)" "$p"
done
done

A heapdump is an HPROF file of hundreds of MB. For a first pass, strings heapdump | grep -iE 'password|secret|token|jsessionid|Authorization' is enough (with JVMs before 9 strings are UTF-16, so repeat with strings -el); for proper analysis, use Eclipse MAT or VisualVM. Only download it if scope allows: it contains real user data.

  1. Read the raw HTML and headers of every key page.
  2. Trigger errors on every parameter (type, content, protocol) and note what leaks.
  3. Look for diagnostic pages and API documentation.
  4. Cross-reference what you find: every leaked piece is the input to another page.
  5. In the report, explain the chain: “the trace gives the path, the path makes the LFI work”.
  • curl and grep for the raw response.
  • Burp Suite (page): Search across the whole history, and the passive scanner, which flags many of these patterns.
  • ffuf (page) with SecLists for diagnostic files.
  • nuclei (page): exposures and misconfiguration templates.
  • Eclipse MAT to analyse Java memory dumps.

Severity is set by what the data gets you. A PHP version in a header is informational; a Laravel APP_KEY can end in RCE (CVE-2018-15133); a heapdump with sessions is account takeover. If you report in bug bounty, demonstrate impact with the next step in the chain instead of stopping at “the version is disclosed”.

  • Bursts of 500 errors from one IP, especially with unexpectedly typed parameters.
  • Requests to diagnostic paths (phpinfo, /actuator/*, trace.axd, /server-status, /console).
  • Large downloads from diagnostic endpoints (heapdump).

Web server and CDN access logs, application error logs (with the request ID), WAF.

  1. Generic errors for the user, with detail only in the logs, linked by a request ID the user can give to support.
  2. Debug mode off in production, checked in the deployment pipeline (DEBUG, APP_DEBUG, display_errors, customErrors).
  3. Remove diagnostic files and don’t deploy them: phpinfo.php should never reach the final artefact.
  4. Actuator: expose only health over HTTP, the rest on a management port unreachable from outside and behind authentication.
  5. Headers without versions: ServerTokens Prod, expose_php = Off, drop X-Powered-By.
  6. Review production HTML: no development comments and no data in the initial state that the user doesn’t need.
  7. Secret scanning in CI over code and artefacts. See secrets management.

Remove the exposure, rotate any secret that was visible (even once deleted, it may already have been copied), invalidate sessions if memory or tracing was exposed, and review access logs for that resource during the exposure window.

  • CVE-2021-3129 (Laravel Ignition, 2021): with debug mode on, the Ignition error page (before 2.5.2) allowed unauthenticated RCE. Debug mode in production turned an error page into a way in.
  • CVE-2018-15133 (Laravel, 2018): anyone who knew APP_KEY could forge encrypted values that the application deserialised, leading to RCE. The key often comes from debug pages or an exposed .env.
  • Patreon (2015): Patreon acknowledged that a debug version of its site was publicly accessible; Detectify later showed it exposed the Werkzeug debugger, which at the time gave a Python console without a PIN.
  • Exposed Spring Boot Actuator: a recurring pattern in bug bounty and audits; a public heapdump hands over credentials and sessions without any code bug.

Product-specific CVEs in NVD (https://nvd.nist.gov/vuln/search) and GitHub Advisories (https://github.com/advisories).

  • Raw HTML reviewed on key pages (comments, hidden, data-*, SPA state).
  • Software and version headers noted.
  • Errors triggered on every parameter: type, content and protocol.
  • Debug mode checked (error page, Django 404, Werkzeug console).
  • Diagnostic endpoints searched for (phpinfo, actuator, trace.axd, server-status).
  • Exposed API documentation searched for.
  • Every leaked piece chained to its next step and impact demonstrated.