Skip to content

Manage nul bytes in client requests #256

@captaincoordinates

Description

@captaincoordinates

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions