Repository navigation
Conversation
…environment The profiler route /_profiler/phpinfo prints phpinfo() (environment variables, secrets) to anyone who can reach a dev instance, and it stays reachable when the toolbar is switched off. Turn the toolbar off by default and replace the phpinfo route with one that never matches, so the URL falls through to the profiler token route. The rest of the profiler keeps working. Adds a functional test that boots the dev kernel and checks the route, the response and the toolbar mode. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
The new tests boot the dev kernel without the test database override, breaking database isolation.
1 open finding
What changed in this PR
Hardens the skeleton’s dev defaults by disabling the debug toolbar and blocking the profiler’s phpinfo page while preserving other profiler routes.
Changes:
- Disables the dev toolbar by default.
- Overrides the phpinfo route so it never matches.
- Adds functional checks for the profiler defaults.
| File | Description |
|---|---|
| tests/Functional/Dev/ProfilerTest.php | Tests phpinfo blocking, profiler routes, and toolbar configuration. |
| config/routes/dev/routes.yaml | Prevents the phpinfo route from matching. |
| config/packages/dev/config.yaml | Disables the debug toolbar. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Booting the dev environment skips the database override of the test environment, so the kernel would use the development database instead of the one the test runner provides. Point DATABASE_URL at PIMCORE_TEST_DB_DSN while the test runs and restore the environment afterwards. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…r test Remember the original value and key presence of $_SERVER, $_ENV and the process environment individually, so teardown puts every store back exactly as it was instead of copying one value to all. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Is it really necessary to change Symfony's default behavior here? |
|
@jdreesen Fair question. The toolbar default follows the Dev Steering decision. The phpinfo route is separate: |
|
If that's such an issue, shouldn't it be fixed in Symfony instead? |
… dev Explain the new dev defaults (toolbar off, /_profiler/phpinfo blocked) and the steps to turn each of them back on, including the cache clear that is needed for the change to take effect. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>


Resolves pimcore/service-operations#935
Problem
In the
devenvironment the Symfony profiler exposes/_profiler/phpinfo. It printsphpinfo()- including environment variables and, depending on the setup, secrets - to anyone who can reach the instance. Dev and staging instances are often reachable from the network. The page is served as soon as the profiler is enabled; it ignoresweb_profiler.toolbar, so simply turning the toolbar off does not close it.Root cause
ProfilerController::phpinfoAction()(symfony/web-profiler-bundle 7.4) only checks that the profiler service exists. Core'srouting_dev.yamlimports the profiler routes, and the skeleton did not configure anything for them.Fix
config/packages/dev/config.yaml:web_profiler.toolbar: false- toolbar off by default in dev (Dev Steering decision).config/routes/dev/routes.yaml: redefine the_profiler_phpinforoute under the same name withcondition: "false". The redefinition replaces the original route, so/_profiler/phpinfofalls through to the profiler's/{token}route, which only reports an unknown token. The rest of the profiler keeps working andpath('_profiler_phpinfo')links still generate. Remove the route to get the page back.README.md: new section "Symfony profiler (dev environment)" explaining the new defaults and how to activate the toolbar and the/_profiler/phpinfopage again (including the cache clear that is needed for the change to show up).tests/Functional/Dev/ProfilerTest.php: boots thedevkernel and checks the route match, the response of/_profiler/phpinfo, that other profiler routes still match/generate, and that the toolbar is disabled.Core is untouched. Same change for the demo app: pimcore/demo-enterprise (pimcore/demo-enterprise#551).
Testing
_profiler_phpinfomatched, toolbar enabled). Run with PHPUnit against a Pimcore 2026.3 dev instance (the demo app, which uses the same dev config); not run by this repo's CI, which only does thecreate-project/ install smoke test./_profiler/phpinfono longer returns the phpinfo page (before: 200 with the full page), the toolbar markers disappear from HTML pages,/_profiler/still redirects to the search results.toolbar: truethe toolbar appears, with the_profiler_phpinforoute removed the phpinfo page is served again - both only after a cache clear.Notes
devenvironment of newly created projects;prod/testand existing projects are untouched.APP_ENV=prod/APP_DEBUG=0stays the recommendation for anything reachable from the network.