The following issues were found

Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h
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: 54 Column: 28 CWE codes: 362

                  unsigned status() const { return m_status; };
    String response_text() const;

    DOM::ExceptionOr<void> open(const String& method, const String& url);
    DOM::ExceptionOr<void> send();

    DOM::ExceptionOr<void> set_request_header(const String& header, const String& value);

    String get_response_header(const String& name) { return m_response_headers.get(name).value_or({}); }

            

Reported by FlawFinder.

Userland/Libraries/LibWebSocket/Impl/AbstractWebSocketImpl.h
1 issues
read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 30 Column: 24 CWE codes: 120 20

                  virtual String read_line(size_t size) = 0;

    virtual bool can_read() = 0;
    virtual ByteBuffer read(int max_size) = 0;

    virtual bool send(ReadonlyBytes) = 0;

    virtual bool eof() = 0;


            

Reported by FlawFinder.

Userland/Utilities/watch.cpp
1 issues
usleep - This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified
Security

Line: 129 Column: 13 CWE codes: 676
Suggestion: Use nanosleep(2) or setitimer(2) instead

                  while (true) {
        int usecs_to_sleep = usecs_from(now, next_run_time);
        while (usecs_to_sleep > 0) {
            usleep(usecs_to_sleep);
            now = get_current_time();
            usecs_to_sleep = usecs_from(now, next_run_time);
        }
        // Clear the screen, then reset the cursor position to the top left.
        warn("\033[H\033[2J");

            

Reported by FlawFinder.

Userland/Libraries/LibWebSocket/Impl/TCPWebSocketConnectionImpl.h
1 issues
read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 33 Column: 24 CWE codes: 120 20

                  virtual String read_line(size_t size) override;

    virtual bool can_read() override;
    virtual ByteBuffer read(int max_size) override;

    virtual bool send(ReadonlyBytes data) override;

    virtual bool eof() override;


            

Reported by FlawFinder.

Kernel/Arch/x86/common/ProcessorInfo.cpp
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 59 Column: 22 CWE codes: 119 120
Suggestion: Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length

                  u32 max_extended_leaf = CPUID(0x80000000).eax();

    if (max_extended_leaf >= 0x80000004) {
        alignas(u32) char buffer[48];
        u32* bufptr = reinterpret_cast<u32*>(buffer);
        auto copy_brand_string_part_to_buffer = [&](u32 i) {
            CPUID cpuid(0x80000002 + i);
            *bufptr++ = cpuid.eax();
            *bufptr++ = cpuid.ebx();

            

Reported by FlawFinder.

Userland/Libraries/LibWebSocket/Impl/TLSv12WebSocketConnectionImpl.h
1 issues
read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 32 Column: 24 CWE codes: 120 20

                  virtual String read_line(size_t size) override;

    virtual bool can_read() override;
    virtual ByteBuffer read(int max_size) override;

    virtual bool send(ReadonlyBytes data) override;

    virtual bool eof() override;


            

Reported by FlawFinder.

Kernel/KString.h
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 40 Column: 5 CWE codes: 119 120
Suggestion: Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length

                  }

    size_t m_length { 0 };
    char m_characters[0];
};

}

namespace AK {

            

Reported by FlawFinder.

Kernel/KResult.h
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 165 Column: 20 CWE codes: 119 120
Suggestion: Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length

              
private:
    union {
        alignas(T) char m_storage[sizeof(T)];
        KResult m_error;
    };
    bool m_is_error { false };
    bool m_have_storage { false };
};

            

Reported by FlawFinder.

Userland/Services/AudioServer/Mixer.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: 32 Column: 20 CWE codes: 362

                        "AudioServer[mixer]"))
    , m_config(move(config))
{
    if (!m_device->open(Core::OpenMode::WriteOnly)) {
        dbgln("Can't open audio device: {}", m_device->error_string());
        return;
    }

    pthread_mutex_init(&m_pending_mutex, nullptr);

            

Reported by FlawFinder.

Userland/Services/ChessEngine/ChessEngine.cpp
1 issues
srand - This function is not sufficiently random for security-related functions such as key and nonce creation
Security

Line: 37 Column: 5 CWE codes: 327
Suggestion: Use a more secure technique for acquiring random values

                  // FIXME: Add different ways to terminate search.
    VERIFY(command.movetime.has_value());

    srand(get_random<u32>());

    Core::ElapsedTimer elapsed_time;
    elapsed_time.start();

    MCTSTree mcts(m_board);

            

Reported by FlawFinder.