-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Segmentation fault in example server (/v1/chat/completions route) given incorrect JSON payload #7133
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
Comments
I can reproduce the issue. FYI: you can compile with |
Yes I can confirm the problem. This is because at some places in the code, we access JSON value with
So the fix is to simply change all |
Thank you for the input. Are you going to open a PR or should I do it? |
@JohannesGaessler Since you assigned this issue to yourself, I'll let you open the PR. Feel free to let me know if you need help. |
@justinsteven can you confirm that #7143 fixes the issue? |
@justinsteven also in the future, please disclose vulnerabilities privately as described under https://github.com/ggerganov/llama.cpp/security#reporting-a-vulnerability |
@JohannesGaessler #7143 fixes the segfault but breaks the API, unless I'm doing something especially wrong... :(
I reported this as GHSA-453q-4wfp-gp83 and was asked to submit it as a public issue |
|
Okay, thank you for the clarification. |
Info
Version: af0a5b6
Intel x86_64 with
LLAMA_CUDA=1
Summary
When
./server
is given an invalid JSON payload at the/v1/chat/completions
route, server crashes with a segmentation fault. This denies access to clients until the server is restarted.I stumbled upon this, and haven't thoroughly assessed all APIs or payload parameters for similar crashes. If it's easy enough to look for other routes that are missing the error handling that
/v1/chat/completions
lacks, I think someone should do so (I'm not yet familiar enough with the codebase to look for these)Example
Impact
Given an llama.cpp
./server
endpoint, it can at least be crashed using an invalid payload. This denies the availability of the server and all API endpoints until it is restarted.I have not assessed whether the segfault can have security impact beyond DoS.
The text was updated successfully, but these errors were encountered: