bug: /v1/files/
invalid filename will hang the server
#2153
Labels
type: bug
Something isn't working
/v1/files/
invalid filename will hang the server
#2153
Cortex version
dev 2e1dfa0
Describe the issue and expected behaviour
Something like this will hang the server
curl http://127.0.0.1:3928/v1/files -X POST -F "[email protected];filename=../hi" -F purpose=assistants
Digging further, I find that this loop never exits in such cases
cortex.cpp/engine/repositories/file_fs_repository.cc
Lines 20 to 25 in 2e1dfa0
We might want to just sanitize the filename as a string instead of a path i.e. no weird characters, including
/
. This will also solve an issue if the filename appears to be a subdirectory(or we can just store the binary file in a DB 😆)
Steps to Reproduce
No response
Screenshots / Logs
No response
What is your OS?
What engine are you running?
Hardware Specs eg OS version, GPU
No response
The text was updated successfully, but these errors were encountered: