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

Incomplete query strings lead to lockup of request parser #15

Open
peschuster opened this issue Jul 19, 2023 · 1 comment
Open

Incomplete query strings lead to lockup of request parser #15

peschuster opened this issue Jul 19, 2023 · 1 comment

Comments

@peschuster
Copy link

After the security fix in PR #14 incomplete query parameters (e.g. /test?foo=bar& or just /test?) lead to a lockup of the HTTP request parser: in HTTPsReq_Handle the value of RxBufLenRem stays at 1 with just the trailing CR (and LF) at RxBufPtr.

Before the patches RxBufLenRem was 0 at this point.

I'd suggest to add the following line
len_rd += len
here (between lines 1191 and 1193):

if (key_val_pair_len == 0u){ /* In the case it's null, the query has been fully ... */
*p_err = HTTPs_ERR_NONE; /* ...parsed and it has finished by a '&'. */
goto exit_update;
}

@yasosa305
Copy link
Member

Hi peschuster

I believe this commit addresses the issue you reported: fa84fe9

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

2 participants