The following issues were found

Userland/DevTools/HackStudio/Locator.cpp
1 issues
open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 179 Column: 15 CWE codes: 362

                  close();
}

void Locator::open()
{
    m_textbox->set_focus(true);
    if (!m_textbox->text().is_empty()) {
        m_textbox->select_all();
        m_popup_window->show();

            

Reported by FlawFinder.

Userland/Utilities/grep.cpp
1 issues
open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 156 Column: 24 CWE codes: 362

              
        auto handle_file = [&matches, binary_mode](StringView filename, bool print_filename) -> bool {
            auto file = Core::File::construct(filename);
            if (!file->open(Core::OpenMode::ReadOnly)) {
                warnln("Failed to open {}: {}", filename, file->error_string());
                return false;
            }

            while (file->can_read_line()) {

            

Reported by FlawFinder.

Userland/DevTools/HackStudio/ProjectFile.cpp
1 issues
open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 57 Column: 38 CWE codes: 362

                      return;

    m_document = CodeDocument::create(m_name);
    auto file_or_error = Core::File::open(m_name, Core::OpenMode::ReadOnly);
    if (file_or_error.is_error()) {
        warnln("Couldn't open '{}': {}", m_name, file_or_error.error());
        // This is okay though, we'll just go with an empty document and create the file when saving.
        return;
    }

            

Reported by FlawFinder.

Userland/DevTools/HackStudio/ProjectTemplate.cpp
1 issues
open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 33 Column: 37 CWE codes: 362

              
RefPtr<ProjectTemplate> ProjectTemplate::load_from_manifest(const String& manifest_path)
{
    auto config = Core::ConfigFile::open(manifest_path);

    if (!config->has_group("HackStudioTemplate")
        || !config->has_key("HackStudioTemplate", "Name")
        || !config->has_key("HackStudioTemplate", "Description")
        || !config->has_key("HackStudioTemplate", "IconName32x"))

            

Reported by FlawFinder.

Userland/Utilities/gron.cpp
1 issues
open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 56 Column: 42 CWE codes: 362

                  if (!path) {
        file = Core::File::standard_input();
    } else {
        auto file_or_error = Core::File::open(path, Core::OpenMode::ReadOnly);
        if (file_or_error.is_error()) {
            warnln("Failed to open {}: {}", path, file_or_error.error());
            return 1;
        }
        file = file_or_error.value();

            

Reported by FlawFinder.

Userland/DevTools/HackStudio/TerminalWrapper.h
1 issues
There is an unknown macro here somewhere. Configuration is required. If C_OBJECT is a macro then please configure it.
Error

Line: 15

              namespace HackStudio {

class TerminalWrapper final : public GUI::Widget {
    C_OBJECT(TerminalWrapper)
public:
    virtual ~TerminalWrapper() override;

    void run_command(const String&);
    void kill_running_command();

            

Reported by Cppcheck.

Userland/DevTools/HackStudio/ToDoEntriesWidget.h
1 issues
There is an unknown macro here somewhere. Configuration is required. If C_OBJECT is a macro then please configure it.
Error

Line: 15

              namespace HackStudio {

class ToDoEntriesWidget final : public GUI::Widget {
    C_OBJECT(ToDoEntriesWidget)
public:
    virtual ~ToDoEntriesWidget() override { }

    void refresh();


            

Reported by Cppcheck.

Userland/DevTools/HackStudio/main.cpp
1 issues
getenv - Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once
Security

Line: 114 Column: 17 CWE codes: 807 20
Suggestion: Check environment variables carefully before using them

              static void update_path_environment_variable()
{
    StringBuilder path;
    path.append(getenv("PATH"));
    if (path.length())
        path.append(":");
    path.append("/usr/local/bin:/usr/bin:/bin");
    setenv("PATH", path.to_string().characters(), true);
}

            

Reported by FlawFinder.

Userland/Applications/SoundPlayer/SampleWidget.h
1 issues
There is an unknown macro here somewhere. Configuration is required. If C_OBJECT is a macro then please configure it.
Error

Line: 18

              
class SampleWidget final : public GUI::Frame
    , public Visualization {
    C_OBJECT(SampleWidget)
public:
    virtual ~SampleWidget() override;

    void set_buffer(RefPtr<Audio::Buffer>) override;


            

Reported by Cppcheck.

Userland/DevTools/Inspector/main.cpp
1 issues
open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 121 Column: 28 CWE codes: 362

              
    auto& help_menu = window->add_menu("&Help");
    help_menu.add_action(GUI::CommonActions::make_help_action([](auto&) {
        Desktop::Launcher::open(URL::create_with_file_protocol("/usr/share/man/man1/Inspector.md"), "/bin/Help");
    }));
    help_menu.add_action(GUI::CommonActions::make_about_action("Inspector", app_icon, window));

    auto& widget = window->set_main_widget<GUI::Widget>();
    widget.set_fill_with_background_color(true);

            

Reported by FlawFinder.