Skip to content
Info disclosure Write-up Beginner

How I was able to find multiple vulnerabilities of a Symfony Web Framework web application

The Symfony debug mode and profiler were left enabled on a production subdomain, exposing a profiler token and phpinfo page. The attacker used the profiler to read the application's configuration file, which contained database and mail server credentials.

Abid Ahmad Follow

Published on infosecwriteups.com

I’m Abid Ahmad, Cyber Security Student & Ethical Hacker. Today I’ll explain how I found multiple vulnerabilities on a web application that used the Symfony Web Framework where Symfony profiler/debug mode was enabled.

Abid Ahmad, on infosecwriteups.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 3 min read.

Context

The target was a web application built on the Symfony PHP framework, reached through a subdomain of a larger programme. For the write-up the site is referred to as https://redacted.com, with the vulnerable host being https://sub.redacted.com.

Symfony ships with a Profiler component. The profiler collects detailed information about each request, such as configuration, request data and environment details, and exposes it through a web interface. It only works when debug mode is enabled. Symfony defines three environments by default: dev, test and prod. The profiler and debug tooling are meant for the development stage, and Symfony recommends turning them off in production. When they are left on, the profiler becomes an information disclosure surface: it exposes sensitive details of the application that an attacker can abuse.

Setup

No accounts, roles or credentials were needed. The work was active reconnaissance against a host that was already publicly reachable. The tools used were:

  1. A browser.
  2. The Wappalyzer browser add-on, to fingerprint the technology stack.
  3. FFUF, to fuzz for directories and files.

No version of FFUF or Wappalyzer is given. The only version detail in the report is Symfony 3.4, which appears when the researcher looks up the default configuration file location.

Finding it

The first step was simply browsing the subdomain and checking which technologies it used. Wappalyzer identified https://sub.redacted.com as running the Symfony web framework.

From the original on infosecwriteups.com

With the framework known, the next phase was asset discovery. Directory fuzzing with FFUF turned up a file called app_dev.php. The report says finding this file indicates that debug mode for Symfony might be enabled.

From the original on infosecwriteups.com

Exploitation

Step 1: Confirm debug mode through the development front controller

The file was requested directly in the browser:

Browsing it confirmed that debug mode was enabled. The response also handed over a profiler token that could be used to access the Symfony Profiler, and it disclosed the location of a phpinfo file.

From the original on infosecwriteups.com

At this point the researcher rated the finding as Medium severity. The debug toolbar is known to allow reading files, which can expose sensitive information, so the next step was to push the finding further.

Step 2: Locate the default configuration file

Research into Symfony documentation and articles established that for Symfony version 3.4 the default database configuration file lives at:

Text
app/config/parameters.yml
Symfony version 3.4 configuration documentation (https://symfony.com/doc/3.4/best_practices/configuration.html) From the original on infosecwriteups.com

Symfony version 3.4 configuration documentation (https://symfony.com/doc/3.4/best_practices/configuration.html)

From the original on infosecwriteups.com

Step 3: Read the configuration file

The configuration file was then opened. It returned database and mail server credentials.

Root cause

The application was running with debug mode enabled in an environment that was reachable from the internet. That switched on the Symfony Profiler and the development front controller app_dev.php, which together expose internals of the application, including the ability to read files such as app/config/parameters.yml. The file holds database and mail server credentials.

The mistake is a deployment and configuration one: the production environment should have had debug mode off, and the development front controller should not have been reachable. The framework's own recommendation to disable debug mode in production was not followed.

Impact

The exposed credentials have a wide range of consequences. They can be used in data breaches, in system compromise, in loss of brand reputation, and they carry financial risk. The report does not enumerate which systems the database and mail credentials unlocked, nor how far the access extended.

Fix

Disable debug mode by setting APP_DEBUG to false. Debug mode should be disabled in the production environment.

Variants to test

When a target is fingerprinted as Symfony, check the debug surface before anything else. The report lists these paths to try:

Text
https://example.com/_profiler
https://example.com/app_dev.php/_profiler
https://example.com/app_dev.php

A configuration file that returns database or mail server credentials confirms the same class of finding.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 10 min read.

What happened, in plain words

A security researcher was looking at a website that turned out to be built with a tool called Symfony. Symfony is a framework: a ready-made set of building blocks that programmers use to build web applications faster, instead of writing everything from scratch. Think of it like a flat-pack kitchen: the cupboards, hinges and screws are all supplied, and the builder just assembles them.

Symfony comes with a special feature called the Profiler. The Profiler is a diagnostic panel, a bit like the service menu on a television or the diagnostic port in a car. It is meant for the people building the site, so they can see exactly what happened on each page load: what settings were used, what data came in, and details about the environment the site runs in. It is extremely useful while building, and extremely dangerous if left switched on once the site is live for the public.

The Profiler only works when a setting called debug mode is turned on. Debug mode is a switch that makes the application show lots of extra detail about errors and internals, again to help developers. Symfony has three standard environments, which are named setups the application can run in: dev (development), test (testing) and prod (production, meaning the real live site). Symfony itself recommends that the Profiler and debug tools are switched off in production. Sometimes developers forget, and the site goes live with the diagnostic panel still open to anyone on the internet.

When that happens, the Profiler becomes what security people call an information disclosure: the site hands out private details about itself to anyone who asks. The researcher in this report found exactly that, and then used it to read a configuration file containing database and mail server credentials.

Understanding Symfony Profiler and debug mode

Before the steps, it helps to understand the two pieces involved.

The Profiler. Every time your browser asks a website for a page, the server does work behind the scenes: it reads settings, looks at the request, talks to a database, and so on. The Profiler records all of that for each request and presents it in a web page you can browse. It is like a flight recorder in a plane: it captures what happened so someone can review it afterwards. For a developer this is invaluable. For an attacker it is a map of the inside of the application.

Debug mode. This is the master switch. With debug mode off, the Profiler does not run and the application keeps its internals to itself. With debug mode on, the Profiler is available and the application is far more talkative than it should be. The report puts it bluntly: Symfony is a secure framework, but enabling debug mode makes it extremely vulnerable.

Why would a developer ever leave it on? Because during development it saves enormous time. The Debug component gives programmers tools to trace problems in their PHP code (PHP is the programming language Symfony is written in). It is genuinely helpful while building. The mistake is carrying that convenience into the live site. The report compares it to a developer simply forgetting to switch it off before the site went public.

How the vulnerabilities were found, step by step

For the write-up the target is called https://redacted.com, and the vulnerable part was a subdomain of it, https://sub.redacted.com. A subdomain is a smaller site that sits under a main domain name, like a separate room inside the same building. No accounts, passwords or special access were needed: everything described here was done against a host that was already reachable by anyone on the internet.

Three tools were used:

  1. A normal web browser.
  2. The Wappalyzer browser add-on. An add-on is a small extra program you install into your browser. Wappalyzer looks at a website and guesses which technologies built it, a bit like reading the ingredients list on a food packet.
  3. FFUF, a command-line tool that tries many possible file and folder names against a website very quickly. Think of it as trying every key on a large keyring in a lock, one after another, to see which one opens the door.

Step 1: Work out what the site is built with

The researcher started by simply browsing the subdomain and checking which technologies it used. Wappalyzer identified https://sub.redacted.com as running the Symfony web framework.

From the original on infosecwriteups.com

Why start here? Because knowing the framework tells you which known weaknesses and default file locations to look for. It is the difference between searching a house blindfolded and being told the layout first. Once Symfony was known, the researcher knew that a development entry point and a Profiler might exist.

Step 2: Look for hidden files

Next came asset discovery, which simply means finding out what files and folders exist on the site that are not linked from its menus. The researcher used FFUF to try many directory and file names. This turned up an interesting file called app_dev.php.

From the original on infosecwriteups.com

Why does that filename matter? In Symfony, app_dev.php is the development front controller. A front controller is the single entry point that every request passes through, like the main reception desk of a building: whatever you want inside, you first go through reception. The _dev in the name marks it as the development version of that desk. If it is reachable on a live site, it indicates debug mode might be enabled, because that development entry point is only meant to be used while building.

Step 3: Confirm debug mode in the browser

The researcher then opened that file directly in the browser:

Line by line, this is just a single web address. https:// means a secure, encrypted connection to the site. sub.redacted.com is the host being tested. /app_dev.php is the path to the development front controller file. Typing it into the address bar asks the server: please run this file and show me the result.

Browsing it confirmed that debug mode was enabled. The response also handed over a profiler token, which is a short string the Profiler uses to identify a particular recorded request so you can open its details. A token here works like a cloakroom ticket: it is the reference number that lets you collect the specific item stored for you. With that token, the Symfony Profiler could be accessed. The same response also disclosed the location of a phpinfo file. phpinfo is a standard PHP page that prints a large amount of detail about the server's setup, so knowing where it lives is another door to private information.

From the original on infosecwriteups.com

At this point the researcher rated the finding as Medium severity. Severity is a rough measure of how much damage a weakness could cause. Medium means it matters, but on its own it is not the worst case. The researcher knew that the Symfony debug toolbar can be used to read files from the server, and reading files can expose sensitive information, so the next step was to push the finding further and see how bad it could get.

Step 4: Find out where the configuration file lives

The researcher read articles and the official Symfony documentation. Documentation is the instruction manual published by the makers of a piece of software. From it, the researcher learned that in Symfony version 3.4 the default database configuration file is stored at:

Text
app/config/parameters.yml

Line by line, this is a file path, not a web address. app is a folder, config is a folder inside it, and parameters.yml is the file itself. The .yml ending means the file is written in YAML, a simple text format for settings, where each line is usually a name followed by a value. A configuration file is where an application keeps its settings, and settings often include passwords. Knowing the default location is useful because many installations never move the file from where the framework puts it by default.

Symfony version 3.4 configuration documentation (https://symfony.com/doc/3.4/best_practices/configuration.html) From the original on infosecwriteups.com

Symfony version 3.4 configuration documentation (https://symfony.com/doc/3.4/best_practices/configuration.html)

From the original on infosecwriteups.com

Step 5: Read the configuration file

The researcher then opened that configuration file. It returned database and mail server credentials. Credentials means usernames and passwords: the keys that let someone log in to the database and to the mail server. The database is where the site stores its data, and the mail server is what sends its emails. Getting both sets of keys is like finding the master keyring for the building rather than a single door key.

Why this was possible

The application was running with debug mode enabled in an environment that anyone on the internet could reach. That switched on two things at once: the Symfony Profiler and the development front controller app_dev.php. Together they expose the internals of the application, including the ability to read files such as app/config/parameters.yml, which holds database and mail server credentials.

The mistake is a deployment and configuration one. The production environment should have had debug mode off, and the development front controller should never have been reachable from outside. The framework's own recommendation to disable debug mode in production was not followed.

Impact

The exposed credentials have a wide range of consequences. They can be used in data breaches, in system compromise, in loss of brand reputation, and they carry financial risk. A data breach means private information being accessed or stolen. System compromise means an outsider gaining control of systems they should not have. The report does not say which systems the database and mail credentials unlocked, nor how far the access extended.

Fix

Disable debug mode by setting APP_DEBUG to false. Debug mode should be disabled in the production environment. APP_DEBUG is the setting name Symfony reads to decide whether debug mode is on; setting it to false switches the diagnostic behaviour off.

Variants to test

When a target is identified as Symfony, check the debug surface before anything else. The report lists these paths to try:

Text
https://example.com/_profiler
https://example.com/app_dev.php/_profiler
https://example.com/app_dev.php

Line by line: the first address goes straight to the Profiler interface. The second goes to the Profiler through the development front controller. The third opens the development front controller itself. A configuration file that returns database or mail server credentials confirms the same class of finding.

Glossary

  • Add-on: a small extra program installed into a browser to add a feature, such as identifying the technologies a site uses.
  • Asset discovery: the process of finding files, folders and other resources on a site that are not linked from its visible pages.
  • Configuration file: a file where an application stores its settings, often including usernames and passwords.
  • Credentials: a username and password (or similar pair) used to log in to a system.
  • Data breach: an incident where private information is accessed or stolen by someone who should not have it.
  • Database: the organised store where a website keeps its data, such as user records and content.
  • Debug mode: a setting that makes an application reveal extra internal detail to help developers; dangerous if left on in a live site.
  • Deployment: the act of putting a finished application onto a live server for public use.
  • Development front controller: the single entry file used while building a Symfony application (app_dev.php), not meant to be reachable in production.
  • Documentation: the official instruction manual published by the makers of a piece of software.
  • Environment: a named setup an application runs in, such as dev, test or prod.
  • FFUF: a command-line tool that rapidly tries many file and folder names against a website.
  • Framework: a ready-made set of building blocks programmers use to build applications faster.
  • Front controller: the single entry point through which every request to an application passes.
  • Information disclosure: a weakness where a system reveals private details about itself to someone who should not see them.
  • Mail server: the system that sends and receives a website's email.
  • phpinfo: a standard PHP page that prints detailed information about the server's setup.
  • PHP: the programming language Symfony is written in and that many websites run on.
  • Plain form: stored without encryption, so anyone who reads the file can read the value directly.
  • Production: the live environment that real users access.
  • Profiler: a Symfony diagnostic panel that records and displays details of each request; only available when debug mode is on.
  • Profiler token: a short string that identifies a particular recorded request so its details can be opened.
  • Severity: a rough measure of how much damage a weakness could cause.
  • Subdomain: a smaller site sitting under a main domain name, such as sub.redacted.com under redacted.com.
  • Symfony: a popular framework for building web applications in PHP.
  • System compromise: a situation where an outsider gains control of systems they should not have access to.
  • Token: a short string used as a reference or key, here to retrieve a specific Profiler record.
  • Wappalyzer: a browser add-on that identifies which technologies a website is built with.
  • YAML: a simple text format for settings files, usually written as a name followed by a value on each line.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.