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

HTTP header name matches should be case insensitive. #314

Open
GrahamDumpleton opened this issue Feb 18, 2025 · 0 comments
Open

HTTP header name matches should be case insensitive. #314

GrahamDumpleton opened this issue Feb 18, 2025 · 0 comments

Comments

@GrahamDumpleton
Copy link

Describe the bug

The HTTP specification (https://www.rfc-editor.org/rfc/rfc7230#section-3.2) says:

Each header field consists of a case-insensitive field name followed
by a colon (":"), optional leading whitespace, the field value, and
optional trailing whitespace.

The web socket code does not perform case insensitive matches and expects headers to have capitalised first character. Eg:

    start = strstr(handshake, "\r\nHost: ");
    if (!start) { err("missing Host header"); return 0; }

Source: https://github.com/kasmtech/KasmVNC/blob/5ea11df3c02343f44533f7a44be3b97b9b9471fb/common/network/websocket.c#L647C1-L648C58

This will fail checking and error if a browser or proxy passes/modifies headers such that passed as lower case.

KasmVNC Details

Using kasmweb/alpine-320-desktop:1.16.1 from Docker Hub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant