Initial Test: Reware AI in Hunting Vulnerabilities

This post details our very first exploratory test of Reware AI, offering a transparent look at what we found and how our tool performed against some common vulnerabilities in a controlled environment. We also include a comparison with CodeQL, GitHub’s powerful semantic code analysis engine, to provide context on current leading tools. Join us as we share the early insights that are shaping the future of Reware AI.

For this initial test, we utilized a custom-built, intentionally vulnerable Flask application. This application was carefully crafted to contain a diverse set of 24 vulnerabilities, encompassing both traditional coding flaws (like Injections and upload issues), subtle logical issues that often evade conventional security analysis tools.

Let’s look at a specific, simple code example from this application to understand one of the vulnerabilities:

# account.py
from flask import Blueprint, render_template, request, redirect, session

bp = Blueprint('account', __name__, url_prefix='/account')

users = {'admin': 'admin123'} # Hardcoded credentials

@bp.route('/login', methods=['GET', 'POST'])
def login():
    if request.method == 'POST':
        username = request.form['username']
        password = request.form['password']
        if username in users and users[username] == password:
            session['user'] = username
            return redirect('/dashboard/home')
    return render_template('login.html')

In the account.py file, within the login function, the users dictionary contains hardcoded administrative credentials ('admin': 'admin123'). This is a critical security flaw. Hardcoding sensitive information like passwords directly into the source code means that anyone with access to the codebase can instantly compromise the system. It bypasses proper credential management practices (like using environment variables, configuration files, or secure vaults) and makes the application highly vulnerable to unauthorized access if the code is ever exposed, even accidentally.

Here’s a summary of our findings, comparing CodeQL’s detection capabilities with Reware AI’s against a set of known vulnerabilities:

VulnEndpointFileCodeQLReware
SQL Injectionview_profile OR get_user_dataapp/routes/profile.py
Stored XSSsubmit_feedback OR thank_youapp/routes/feedback.py
Log injectionsubmit_feedback()app/routes/feedback.py
Stored XSShomeapp/routes/dashboard.py
Stored XSSlookup_userapp/routes/dashboard.py
Session Fixationlookup_userapp/routes/dashboard.py
Injection in Cookieloginapp/routes/account_admin.py
Cleartext in Cookie / Sensitive Data exposureloginapp/routes/account_admin.py
Insecure Cookie (secure httponly)loginapp/routes/account_admin.py
Hardcoded Secretsaccount_admin globalapp/routes/account_admin.py
Hardcoded SecretsLogin()app/routes/account.py
Insecure File Upload - dangerous extensionuploadapp/routes/media.py
Insecure File Upload - file overwriteuploadapp/routes/media.py
Insecure File Upload - Size DoSuploadapp/routes/media.py
File Upload Size Bomb DoSupload_reportapp/routes/reports.py
File content typeupload_reportapp/routes/reports.py
File name overwrite vulnupload_reportapp/routes/reports.py
Blind SQL Injectioncheck_userapp/routes/verify.py
SQL Injectionitems OR build_queryapp/routes/search.py
Reflected XSS (Subtle)updateapp/routes/settings.py
SSTIupdateapp/routes/settings.py
debug moderunapp/run.py
CSRFGlobalconfig.py
Total Detections916

Despite a promising initial performance, Reware AI did identify 2 false positives in these preliminary results. The primary challenges we are currently focusing on include efficiently parsing mid to large codebases, ensuring the generation of precise contextual understanding for analysis under diverse conditions, optimizing the speed of the initial scan for very large file numbers, and refining our model’s ability to differentiate true positives from false positives when encountering extremely complex or unusually written code. These are crucial areas of ongoing development as we strive for more accuracy and scalability.

Back to All Posts
Share this post: