X Tutup
The Wayback Machine - https://web.archive.org/web/20201029105831/https://github.com/directus/api/pull/1956
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrects level of 'env' key/value for default/unknown project app configuration to prevent leaking of technical information #1956

Conversation

@SoftwareEngineerChris
Copy link

@SoftwareEngineerChris SoftwareEngineerChris commented Jul 6, 2020

I noticed that the ping app and "unknown" project app configurations always fell back to a development configuration. So when hitting an unknown endpoint (e.g. example.com/test) which would be routed via the unknown-project app, the response would contain details that should probably be kept private, such as PHP file paths and such. This is since these apps still use the regular error handlers, which return more information when in development configuration.

It looks like it was the intention for these two apps to default to a production configuration, but because the env had been placed in an object called app instead of the root, the error handling code couldn't find it where it expected it, and therefore defaulted to "development".

As a side note, it looks like there are a few places in the codebase that default to development e.g. ->get('env', 'development'). Perhaps these should default to production to be on the safer side?

Before fix:
Before

After fix:
After

@SoftwareEngineerChris SoftwareEngineerChris changed the title Corrects level of 'env' key/value for default/unknown project app configuration Corrects level of 'env' key/value for default/unknown project app configuration to prevent leaking of technical information Jul 6, 2020
@benhaynes benhaynes requested a review from rijkvanzanten Jul 6, 2020
everyx added a commit to fengsi-io/api that referenced this pull request Oct 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.
X Tutup