Static application security testing (SAST)

SAST checks source code for security problems without running it. It helps developers find and fix them before release.

Included in Premium and Ultimate.

In AquilaX

AquilaX SAST finding for SQL injection in app.py, with the affected code and a suggested parameterised query
A SQL injection finding with the affected code and advice on how to fix it.

Screenshots that show scan results use our public test apps, which are vulnerable on purpose. Select an image to enlarge it.

What it looks for

Injection

SQL and command injection.

Unsafe web output

Cross-site scripting (XSS) and similar problems.

Unsafe file access

Path traversal and unsafe XML processing (XXE).

Unsafe requests

Server-side request forgery (SSRF).

Unsafe data loading

Code that loads untrusted objects.

Weak cryptography

Weak algorithms and unsafe settings.

Examples

These examples show common problems and safer ways to write the code. They are not AquilaX results, and scanner coverage can vary.

SQL injection through an f-string

CWE-89PythonCritical
Vulnerable · api/users.py
@app.get("/users")
def get_user():
    user_id = request.args.get("id")
    query = f"SELECT * FROM users WHERE id = {user_id}"
    return db.execute(query).fetchone()
Why it's exploitable

user_id comes straight from the query string and is pasted into the SQL text. Send ?id=1 OR 1=1 and the query matches every row. Add a UNION SELECT and it reads other tables.

The fix
user_id = request.args.get("id", type=int)
return db.execute(
    "SELECT * FROM users WHERE id = %s", (user_id,)
).fetchone()

Path traversal that path.join doesn't stop

CWE-22Node.jsHigh
Vulnerable · routes/files.js
app.get("/download", (req, res) => {
  const file = path.join(__dirname, "uploads", req.query.name);
  res.sendFile(file);
});
Why it's exploitable

path.join resolves ../ segments, it doesn't block them. ?name=../../etc/passwd lands outside uploads/ and Express serves it.

A lot of people believe path.join makes a path safe, and that belief is how this bug gets shipped.

The fix
const base = path.resolve(__dirname, "uploads");
const file = path.resolve(base, req.query.name);
if (!file.startsWith(base + path.sep)) return res.sendStatus(400);
res.sendFile(file);

Unpickling a cookie

CWE-502PythonCritical
Vulnerable · shop/cart.py
@app.route("/cart")
def cart():
    raw = request.cookies.get("cart")
    items = pickle.loads(base64.b64decode(raw))
    return render_template("cart.html", items=items)
Why it's exploitable

The user controls the cookie, and pickle.loads runs code. An object whose __reduce__ returns os.system gives remote code execution on the very first request.

Signing the cookie helps. Moving to a data-only format removes the problem completely.

The fix
# keep the cart server-side, JSON-serialised
items = session.get("cart", [])
return render_template("cart.html", items=items)

What to know

  • Where a trace is available, it shows how data moves from the input to the vulnerable call. Confirmed paths get a higher severity.
  • Extra audit rules are off by default. Audit rules for the most serious types of problem always run.
  • Files over 500 KB are skipped. AquilaX records how many files it skipped.
  • SAST does not run the app, so it can miss problems that depend on how the app is set up.

See all scanners How to fix findings

Questions and answers

What is SAST?

SAST stands for static application security testing. It looks for security problems in code without running the app.

Can I run SAST only on changed files?

Yes. Use a diff scan to check the changed files in a pull or merge request. Run full scans regularly to check the whole project.

Which languages does AquilaX support?

They include JavaScript, TypeScript, Python, Java, Kotlin, Go, PHP, Ruby, C and C++, C#, Scala, Swift, Rust, Elixir and Dart. Coverage differs by scanner, so contact us to check a specific language or framework.

Can I see how user input reaches the vulnerable code?

Yes, where a trace is available. It shows how data moves from where it enters your code to the vulnerable call. If the scanner confirms that path, it raises the severity to match the risk.

What are SAST audit rules?

They are extra checks that you can turn on for a group. They are off by default because they add many findings and make scans take longer. Checks for injection, unsafe deserialization, path traversal, XXE and SSRF always run.

Why was a file not scanned?

SAST skips files over 500 KB, and AquilaX records how many it skipped. Files and folders ignored by your security policy are not scanned either.

Can I mark a SAST finding as a false positive?

Yes. You can set it to True Positive, Unverified, False Positive or Not Exploitable. Your decision stays with the finding even if the code around it moves.

Does SAST replace code review or penetration testing?

No. SAST can miss problems with business logic, access rules or how an app is set up. Use it with code review, DAST and manual testing.

Which plan includes this scanner?

Included in Premium and Ultimate. Compare plans.

Try it on one of your repositories

Create a free account and run a scan. If you need Ultimate, self-hosting or a larger rollout, talk to our team.

No credit card needed. Read the documentation