fedora 23
shell weakness #11

4

Weakness Breakdown


Definition:

A shell weakness occurs when a program enables an attacker to execute unexpected commands on the operating system.

Warning code(s):

This causes a new program to execute and is difficult to use safely.

File Name:

oiio-Release-1.5.24/src/libutil/filesystem.cpp

Context:

The highlighted line of code below is the trigger point of this particular Fedora 23 shell weakness.

     boost::system::error_code ec;
# if BOOST_VERSION < 105000
    boost::filesystem3::copy (from.str(), to.str(), ec);
# else
    boost::filesystem::copy (from.str(), to.str(), ec);
# endif
    if (! ec) {
        err.clear();
        return true;
    } else {
        err = ec.message();
        return false;
    }
#else
    return false; // I'm too lazy to figure this out.
#endif
}



bool
Filesystem::rename (string_view from, string_view to, std::string &err)
{
#if BOOST_FILESYSTEM_VERSION >= 3
    boost::system::error_code ec;
# if BOOST_VERSION < 105000
    boost::filesystem3::rename (from.str(), to.str(), ec);
# else
    boost::filesystem::rename (from.str(), to.str(), ec);
# endif
    if (! ec) {
        err.clear();
        return true;
    } else {
        err = ec.message();
        return false;
    }
#else
    return false; // I'm too lazy to figure this out.
#endif
}



bool
Filesystem::remove (string_view path, std::string &err)
{
#if BOOST_FILESYSTEM_VERSION >= 3
    boost::system::error_code ec;
    bool ok = boost::filesystem::remove (path.str(), ec); 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.