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

Large cookies cause buffer overflow #89

Open
aph3rson opened this issue Apr 17, 2024 · 1 comment
Open

Large cookies cause buffer overflow #89

aph3rson opened this issue Apr 17, 2024 · 1 comment

Comments

@aph3rson
Copy link

When using -j, the cookie header can be populated by slowhttptest when sending the request.

However, there's an undocumented 1024-byte limit on the size of this header:

char cookie[1024] = { 0 };

For applications that use large authorization cookies (e.g. JWTs), the cookie may exceed 1024 bytes. Using these cookies on the command line will trigger buffer overflow detection - while you're not overflowing the buffer, you're also not writing a null byte.

Improvements here may include:

  • documenting a max length of 1024 for the Cookie (and Accept) headers.
  • fail if the -j option is longer than this max length
  • improving the cookie variable to allocate a variable-length buffer of just-enough space for the provided cookies
@aph3rson
Copy link
Author

Places that would need to be changed:

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