---
description: >-
  https://portswigger.net/web-security/information-disclosure/exploiting/lab-infoleak-on-debug-page
---

# Information disclosure on debug page

## Description

This lab contains a debug page that discloses sensitive information about the application. To solve the lab, obtain and submit the `SECRET_KEY` environment variable.

## Solution

<figure><img src="https://677614291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRWtuMw6xkkeDjZfkcWC%2Fuploads%2Fzt5S742FWVXLFFlGK1Jh%2Fimage.png?alt=media&#x26;token=23b3b5a8-1efd-4c41-984d-a01af7137994" alt=""><figcaption></figcaption></figure>

Searching into page source (CTRL+U) the world 'debug' we found this info disclosure into comments, with a link for this config website: /cgi-bin/phpinfo.php

<figure><img src="https://677614291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRWtuMw6xkkeDjZfkcWC%2Fuploads%2F8hbwMfBdfY0jxWQdXOMP%2Fimage.png?alt=media&#x26;token=54c5d771-712f-4295-9576-efcc37db839f" alt=""><figcaption></figcaption></figure>

Adding it to the orginal URL ([https://0a5400be03dcbfb683c47334006b00dd.web-security-academy.net/cgi-bin/phpinfo.php](https://0a5400be03dcbfb683c47334006b00dd.web-security-academy.net/cgi-bin/phpinfo.php)) we can obtain info about php version and all other configration data (in our case the 'SECRET\_KEY')

<figure><img src="https://677614291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRWtuMw6xkkeDjZfkcWC%2Fuploads%2FhObZ9e7uqKOOIVH38tfq%2Fimage.png?alt=media&#x26;token=32b26331-a6d2-4bb8-8c6f-d5acf9471e20" alt=""><figcaption></figcaption></figure>

<figure><img src="https://677614291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRWtuMw6xkkeDjZfkcWC%2Fuploads%2FBUpUxaafSqPlJv1Kkdjs%2Fimage.png?alt=media&#x26;token=0aa41e45-12c6-4461-8b19-456598c636c9" alt=""><figcaption></figcaption></figure>
