-
Notifications
You must be signed in to change notification settings - Fork 35
Description
Issue created from this thread.
Discussion is required on whether titiler-pgstac should attempt to strip unsupported data (specifically nul bytes) in client requests. There are currently differences in how nul bytes are handled by nginx and gunicorn / uvicorn. nginx removes them by default but gunicorn and uvicorn do not.
If a nul byte is permitted past input validation it can result in a Postgres exception and an HTTP 500 response with a Postgres error message.
curl -I -X GET 'http://localhost:8081/collections/invalid%00id/info'I propose that middleware should be used to strip unsupported data to avoid unintentionally exposing implementation detail to the client. I believe that only a malicious user would intentionally include nul bytes in requests to titiler-pgstac, perhaps as part of an attempt to probe the system for vulnerabilities.