-
Notifications
You must be signed in to change notification settings - Fork 10
Description
Overview
The flute-receiver example writes the received files to a blind location, which lead to security concern and stability issues
rt-libflute/examples/flute-receiver.cpp
Lines 166 to 167 in 56c927f
| FILE* fd = fopen(file->meta().content_location.c_str(), "wb"); | |
| fwrite(file->buffer(), 1, file->length(), fd); |
Bugs
-
Files are written directly using the Content-Location value. A malicious FLUTE stream could forge a Content-Location to potentially overwrite arbitrary files on the receiver.
-
Content-Location is a URI, but the code uses it as-is for the file path. Content-Location should be parsed, probably the path of the URI should be used to create the file path.
-
After opening a file, the code does not check whether the file descriptor is valid. This leads to crash if the file fails to open.
New Feature
It could be nice to have an option to select to which folder files are written