This website uses cookies

To provide the highest level of service we use cookies on this site.
Your continued use of the site means that you agree to their use in accordance with our terms and conditions.

Pentest Chronicles

Symfony Profiler in Production – An Entry Point for Sensitive Data Leaks and Remote Code Execution

Jakub Żoczek

January 03, 2025

During a security audit, a web application using an outdated version of the Symfony framework was identified. The analysis revealed the presence of the Symfony Profiler tool, which is commonly used for debugging applications during development.

The Profiler provides detailed information about the application's operation, which is useful for developers. However, in a production environment, its availability can lead to the disclosure of sensitive information and, in some cases, remote code execution on the server.
Access to the Symfony Profiler ToolAccessing the Symfony Profiler is possible by navigating to the /app_dev.php endpoint on the server. Upon accessing the page, a toolbar appears, providing access to various diagnostic features, as shown in the screenshot below: Sensitive Information Accessible in the Profiler The Profiler can expose a wide range of information about the application, including:

• PHP configuration details through the phpinfo() function: • Error details generated during HTTP requests:
• Contents of configuration files, including files containing access credentials or secret tokens:
Remote Code Execution In critical cases, the availability of the Symfony Profiler can allow an attacker to extract a secret token from the configuration files. This token can then be used to exploit another Symfony feature – the /_fragment endpoint. By leveraging this mechanism, an attacker can achieve remote code execution (RCE) on the server.
An exploit demonstrating this attack is publicly available in the following repository: https://github.com/ambionics/symfony-exploits.

After successful exploitation, remote code execution can be confirmed by a result displayed in the browser: Audit Findings in Other Applications During the audit, other web applications with the Symfony Profiler enabled were also identified. However, in these cases, the attack described above could not be successfully executed. Despite the inability to escalate the issue to full RCE, the presence of the Profiler in a production environment still poses a significant security risk. Recommendations To secure web applications against this attack vector, the following steps are recommended:
1. Disable access to the Symfony Profiler in production environments.
2. Upgrade the Symfony framework to the latest stable version.
3. Ensure unique "secret" tokens are used for each application instance.
4. Perform regular security audits to identify potential configuration issues.

Implementing these recommendations can significantly reduce the risk of sensitive data exposure and potential attacks leading to remote code execution on production servers.


#Cybersecurity #WebSecurity #SessionFixation #PenTesting #SecureApplications




Next Pentest Chronicles

When Usernames Become Passwords: A Real-World Case Study of Weak Password Practices

Michał WNękowicz

9 June 2023

In today's world, ensuring the security of our accounts is more crucial than ever. Just as keys protect the doors to our homes, passwords serve as the first line of defense for our data and assets. It's easy to assume that technical individuals, such as developers and IT professionals, always use strong, unique passwords to keep ...

SOCMINT – or rather OSINT of social media

Tomasz Turba

October 15 2022

SOCMINT is the process of gathering and analyzing the information collected from various social networks, channels and communication groups in order to track down an object, gather as much partial data as possible, and potentially to understand its operation. All this in order to analyze the collected information and to achieve that goal by making …

PyScript – or rather Python in your browser + what can be done with it?

michał bentkowski

10 september 2022

PyScript – or rather Python in your browser + what can be done with it? A few days ago, the Anaconda project announced the PyScript framework, which allows Python code to be executed directly in the browser. Additionally, it also covers its integration with HTML and JS code. An execution of the Python code in …

Any questions?

Happy to get a call or email
and help!