Skip to content

Should we add InvalidHeaderValue and return it for invalid maybe malicious header values like `X-Foo: \x80\x81 #3389

@Agent-Hellboy

Description

@Agent-Hellboy

Currently, we're ignoring invalid and potentially malicious header values.
I’m not sure if proxies should handle this or if the framework should take care of it, but I think Gunicorn could consider adding a check here:

https://github.com/benoitc/gunicorn/blob/master/gunicorn/http/message.py#L70

...and raise a specific error that can be captured and handled here:

https://github.com/benoitc/gunicorn/blob/master/gunicorn/workers/base.py#L206

please check https://www.rfc-editor.org/rfc/rfc9110.html#name-field-values

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions