Skip to content

flute-receiver example writes files insecurely and may crash #27

@ypo

Description

@ypo

Overview
The flute-receiver example writes the received files to a blind location, which lead to security concern and stability issues

FILE* fd = fopen(file->meta().content_location.c_str(), "wb");
fwrite(file->buffer(), 1, file->length(), fd);

Bugs

  1. 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.

  2. 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.

  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions