Loophalt logo
// SAST · SECRETS · ZERO DEPENDENCIES

Find the security holes in your code — before someone else does.

Loophalt is a static security scanner that ships as one Python file with zero dependencies. Point it at a codebase and it finds hardcoded secrets, injection flaws, XSS and more — then ranks every finding by priority score and tells you why each one matters and how to fix it.

MIT LICENSE·PYTHON 3.8+·NO PIP INSTALL·RUNS OFFLINE
zsh — loophalt scan
➜ ~ python3 loophalt.py scan ./api-server Loophalt found 55 issue(s): 9 critical, 29 high, 17 medium CRITICAL [P1] CMD001 Command injection via child_process (JS/TS) src/run.js:33 › exec(cmd, (err, out) => res.send(out)); taint: req.query.cmd → cmd → exec why: user input reaching a shell lets attackers append commands that run with the app's privileges — full server compromise. fix: use execFile/spawn with an argument array — never build shell strings from input. CRITICAL [P1] SEC003 Private key in source code config.py:6 › PRIVATE_KEY = """-----BEGIN RSA PRIVATE KEY----- why: a committed private key is a fully compromised identity — anyone who clones the repo owns it. fix: revoke the keypair, purge it from git history, load keys from a secrets manager. HIGH [P2] SQLI002 SQL injection via string formatting (Python) db.py:16 › cur.execute("SELECT * FROM users WHERE id = %s" % uid) fix: parameterized queries — let the driver separate code from data. … 52 more findings ➜ ~
112
security checks
7
languages covered
0
dependencies
1
file — that's the install

DOGFOODED — LOOPHALT SCANS ITS OWN CODEBASE CLEAN · GITHUB ACTION VERIFIED IN CI · SARIF → GITHUB SECURITY TAB

Fig. 01

Built like a tool developers actually keep

TAINT TRACKING

Data-flow, not grep

Loophalt follows user input from source to sink — req.query.cmd → cmd → exec — so findings are real, reachable flows instead of keyword noise.

PRIORITY SCORES

Fix first, not first-found

Every finding carries a priority score (0–100) and a band — P1 to P4 — built from its severity, whether taint tracking verified the flow, and the weakness class. Reports come out sorted fix-first, so the worst holes are always on top.

WHY + FIX

Every finding teaches

Each result explains the risk in plain English and ships the concrete fix. No cryptic rule codes that send you to a wiki — the answer is in the output.

ZERO SETUP

No platform. No account.

No SaaS onboarding, no required config, no telemetry, no API keys. If Python 3 runs — laptop, CI runner, air-gapped box — Loophalt runs. Offline, in seconds.

Fig. 02

112 security tools. Zero jargon.

Every check Loophalt runs, explained the way you'd explain it to a friend. Big plain name first — the technical code stays small, for those who want it. All 112 run together in every scan; nothing to select or configure.

01

🔑 Passwords & Secret Keys

The #1 problem in AI-built apps — secrets typed straight into the code.

🔑

Secret Keys Left in Code

API keys and tokens typed directly into your files — visible to anyone who ever sees the project.

HIGHSEC001
🔓

Passwords Written in Code

A real password sitting in a file instead of a private settings area.

HIGHSEC002
🗝️

Private Key in the Project

The master key file of your server, included in the code folder itself.

CRITICALSEC003
☁️

Cloud Keys Exposed

Amazon/AWS access keys hardcoded — someone could run up cloud bills in your name.

HIGHSEC004
🎲

Secret-Looking Strings

Random-looking strings that behave exactly like passwords, even if nobody labelled them.

MEDIUMSEC005
📜

Secrets Printed in Logs

Passwords or tokens written into log files, where they quietly stay forever.

MEDIUMLOG001
02

🗄️ Database Safety

Ways a visitor can steal, change or delete your data through normal-looking forms.

💉

SQL Injection

Typed input slips into database commands — the classic way entire customer lists get stolen. Covers JavaScript, Python, Go and PHP.

HIGHSQLI001–004
🍃

NoSQL Injection

The same trick aimed at MongoDB-style databases — login forms are the favourite target.

HIGHNOSQL001
📇

LDAP Injection

Company directory lookups built from typed input can be twisted to bypass logins.

HIGHLDAP001
🎯

XPath InjectionNEW

XML searches built from typed input — attackers can pull out data the query was never meant to return.

HIGHXPATH001
💉

SQL Injection (C#)NEW

C# queries built from typed input — string-built SQL in SqlCommand lets an attacker rewrite the query and read or change your data.

HIGHSQLI006
💉

SQL Injection (Rust)NEW

Rust queries built from typed input — string-built SQL via format! or tainted variables in sqlx and rusqlite lets an attacker rewrite the query and read or change your data.

HIGHSQLI007
03

🚪 Hackers' Entry Points

Code that lets a visitor run things on your site or server they should never touch.

🖥️

Cross-Site Scripting (XSS)

Comments and reviews shown without cleaning, so attackers can hide scripts in them. Four patterns covered.

HIGHXSS001–004
🖼️

Unencoded Response.Write (C#)NEW

User input written straight to the page with Response.Write — no encoding, so a crafted value runs as script in every visitor's browser.

HIGHXSS008
⌨️

Command Injection

Visitor input turned into server commands — the attacker ends up driving your machine.

CRITICALCMD001–004
💻

Shell Invocation (C#)NEW

User input routed through cmd.exe or PowerShell via Process.Start — the attacker appends commands that run with the app's privileges.

CRITICALCMD006
💻

Shell Invocation (Rust)NEW

User input routed through a shell via Command::new("sh").arg("-c") — the attacker appends commands that run with the app's privileges.

CRITICALCMD007
🧨

Code Injection (eval)

eval() and friends running text as code — if any of that text comes from a visitor, game over.

CRITICALEVAL001–002
📥

Dynamic Import (Python)NEW

A module name built from visitor input gets imported and run — any installed module becomes the attacker's code.

CRITICALEVAL006
🧨

Node vm Code ExecutionNEW

Visitor input handed to Node's vm module (runInContext, Script, compileFunction) runs as code inside your server process — the sandbox that was never a sandbox.

HIGHEVAL005
📡

Server-Side Request Forgery

Your server tricked into calling internal addresses it should never reveal or reach.

HIGHSSRF001
🧬

Prototype Pollution

A JavaScript flaw where attackers quietly rewrite how your whole app behaves.

HIGHPROTO001
📄

XML External Entity (XXE)

Uploaded XML files that make your server hand over its own private files.

HIGHXXE001
🌀

Regex Denial of Service

A pattern so tangled that one crafted input can freeze your site for everyone.

MEDIUMREDOS001
🌊

Unbounded Request-Body Read (Go)NEW

A Go handler reads the whole request body with io.ReadAll and no size limit — one oversized upload can exhaust the server's memory. Bounded reads with LimitReader stay silent.

MEDIUMDOS001
⏱️

Go HTTP Server With No TimeoutsNEW

A Go server started with ListenAndServe and no read/write timeouts — a slow client can hold a connection open forever (Slowloris). Servers with timeouts set stay silent.

MEDIUMTMO001
🧩

Server-Side Template InjectionNEW

User input used as the template itself — Jinja2, EJS, Pug, Go templates or Twig — lets an attacker run code on your server.

HIGHSSTI001
🧾

Header Injection (Response Splitting)NEW

User-influenced values written into response headers can smuggle extra headers — or a whole fake response — into the reply.

MEDIUMCRLF001
🗜️

XML Entity Expansion (libxmljs)NEW

libxmljs parsers with entity expansion switched on can be fed documents that blow up memory or reach local files.

HIGHXXE002
🖼️

Unsafe HTML SinksNEW

insertAdjacentHTML, Vue v-html and Angular bypassSecurityTrust* render raw HTML — the same hole as innerHTML, in framework clothing.

HIGHXSS005
04

📁 Files & Uploads

Anything your app opens, unzips or accepts from a visitor.

🗂️

Path Traversal

Tricks like "../" that let visitors read files outside the folder they were allowed into.

HIGHPATH001–002
🤐

Zip Slip

A booby-trapped ZIP that writes files anywhere on your server when opened.

HIGHZIP001
📤

Unsafe File Uploads

Upload boxes that never check what kind of file arrived — a favourite break-in route.

HIGHUPL001
📦

Unsafe Deserialization

Saved-data formats (pickle, unserialize) that execute whatever an attacker packed inside.

HIGHDESER001
🧳

Unsafe Deserialization (jsonpickle / v8)NEW

jsonpickle.decode and v8.deserialize rebuild objects from attacker data — code execution hiding in a saved file.

HIGHDESER002
📦

BinaryFormatter Deserialization (C#)NEW

BinaryFormatter.Deserialize on attacker-controlled bytes — the classic .NET gadget-chain route to code execution.

HIGHDESER004
05

🔐 Login, Sessions & Settings

The quiet switches that decide whether your logins and settings actually protect you.

🎫

Login Tokens Never Verified

JWT tokens read but never actually checked — a forged token sails straight in.

HIGHJWT001
🚫

JWT "None" / Weak Secret

Settings that accept unsigned tokens, or secrets so short anyone can guess them.

HIGHJWT002
🧑‍💻

Weak Login Patterns

Authentication shortcuts that look fine and fail quietly under attack.

MEDIUMAUTH001
🛡️

Missing CSRF Protection

Without it, a malicious page can make your logged-in visitors act without knowing.

MEDIUMCSRF001
🌐

Wide-Open CORS

Your app answering data requests from literally any website on the internet.

MEDIUMCORS001
↪️

Open Redirect

Links on your own trusted domain that silently bounce visitors to scam sites.

MEDIUMREDIR001
🧱

Missing Security Headers

Standard browser protections (CSP, frame guards) simply never switched on.

MEDIUMHDR001
🐞

Debug Mode Left On

Developer debug screens still active in the live app — they leak how everything works.

MEDIUMDBG001
💬

Error Details Shown to Visitors

Full technical error messages handed to strangers — a map for attackers.

MEDIUMERR001
🍪

Cookie Without HttpOnlyNEW

Session cookies set without HttpOnly can be stolen by any script that slips onto the page.

MEDIUMCOOKIE001
🔀

CORS Reflects Any OriginNEW

Echoing back any request Origin — or pairing credentials with a wildcard — lets any site act as your user.

HIGHCORS002
⏱️

Secrets Compared with ==NEW

Comparing tokens with == leaks timing hints, and PHP type juggling can turn a wrong secret into a match.

MEDIUMCMP001
🧭

DOM Open RedirectNEW

JavaScript that sends visitors to a URL taken from the page — a phishing link wearing your domain.

MEDIUMREDIR002
06

🔒 Encryption & Connection Safety

How passwords are stored and how data travels.

🔐

MD5 Password Storage

Passwords hashed with MD5 — crackable in seconds with free tools.

HIGHCRY001
🔏

SHA-1 Password Storage

SHA-1 is retired for passwords for a reason — nearly as fast to crack as MD5.

HIGHCRY002
📻

Ancient Ciphers (DES / RC4)

Encryption methods from another era, broken by modern computers.

MEDIUMCRY003
🔁

Hardcoded IV / ECB Mode

Encryption done with a fixed starting value, or ECB mode that leaks patterns in your data.

MEDIUMCRY004–005
🐢

SHA-256 / SHA-512 for PasswordsNEW

Fast hashes are built for speed — exactly what makes passwords crackable. Passwords need a slow hash like bcrypt or Argon2.

HIGHCRY006
🔌

Secure Connection Check Switched Off

TLS verification disabled — your app will happily talk to a fake server.

HIGHTLS001
📶

Outdated TLS Versions

Old connection protocols (TLS 1.0/1.1) that browsers and attackers both left behind.

MEDIUMTLS002
🎰

Predictable Random Values

"Random" codes and tokens an attacker can guess — session IDs, reset links, OTPs.

MEDIUMRAND001–003
🔢

Weak PHP Random for TokensNEW

PHP rand(), mt_rand() and uniqid() are predictable — fine for shuffling a list, fatal for tokens and OTPs.

MEDIUMRAND004
🛑

TLS Validation Off (CERT_NONE)NEW

Certificate checks disabled at the SSL layer — ssl.CERT_NONE, unverified contexts, or NODE_TLS_REJECT_UNAUTHORIZED=0 — let a fake server in.

HIGHTLS003
🔓

TLS Validation Disabled (C#)NEW

C# code that accepts any server certificate — ServerCertificateCustomValidationCallback returning true, or RemoteCertificateValidationCallback switched off — lets a fake server in.

HIGHTLS005
07

☁️ Cloud & Infrastructure

Your code is only half the attack surface — Loophalt also reads the Terraform, Kubernetes and Docker files that run it.

🏗️

Terraform MisconfigurationsNEW

S3 buckets left public, security groups open to the whole internet (0.0.0.0/0), databases with encryption switched off, and IAM policies that allow everything — caught in your .tf files before they ship.

HIGHTF001–004
☸️

Kubernetes Risky SettingsNEW

Privileged containers, privilege escalation left on, pods sharing the host namespaces, and unpinned :latest images — the settings that turn one container into the whole cluster.

HIGHKUB001–004
🐳

Dockerfile PitfallsNEW

Containers running as root, secrets baked into the image, remote scripts piped straight into a shell, and sudo installed in production images.

HIGHDOCK001–005
Every scan runs all 112 tools together — point Loophalt at your project, get one report with a plain-English why and a concrete fix for every finding.
Fig. 03

Loophalt Server Guard — protection for running servers

Scanning code is only half the job. Loophalt Server Guard watches your live web and SSH logs, scores every suspicious IP, rings the alarm — terminal, email, Telegram or webhook — and auto-bans repeat offenders at the firewall, whitelist-protected and dry-run by default. It even runs Loophalt's own scans on the server's code on a schedule, so code holes and live attacks land in one dashboard.

STEP 1 · WATCH

Logs + honeypots, live

Server Guard tails Apache/Nginx access logs and SSH/auth logs in real time — and listens on decoy honeypot ports for anyone poking around.

STEP 2 · SCORE

Every IP gets a score

Probes for /.env and /wp-admin, SQL injection, XSS, traversal, scanner tools and SSH brute force all add points — LOW 5 · MEDIUM 10 · HIGH 25 · CRITICAL 50.

STEP 3 · ALARM

You hear about it instantly

Cross the warn line (40) and an alert goes out; cross the alarm line (75) and it gets louder — always with the attacker's IP and what they tried.

STEP 4 · BAN

Repeat offenders locked out

At 100, the IP is banned at the firewall — iptables, nft or ufw — with an expiry. Your own IPs sit on a whitelist that can never be banned.

🛡️

Server Guard — the runtime tool

Every incident is stored in SQLite, and a local dashboard shows top attackers, active bans and recent incidents. The fake SSH server, fake WordPress and phpMyAdmin logins and fake .env catch probers red-handed — any touch of a decoy is a HIGH incident. And because it's Loophalt, Server Guard runs the same 112 code checks against the server's code on a schedule: new critical or high findings raise the same alarm and the same alerts.

# see it work in 10 seconds — built-in web + SSH attack demo, dry-run ban
python3 sitealarm.py demo

# one-shot analysis of an existing log
python3 sitealarm.py scan-log /var/log/nginx/access.log

# run Loophalt's code checks against the server's code, right now
python3 sitealarm.py codescan

# daemon — watch logs + honeypot + scheduled code scans
python3 sitealarm.py --config sitealarm.json run

# live dashboard — top attackers, active bans, incidents
python3 sitealarm.py dashboard
RUNTIMESERVER GUARD · ZERO DEPENDENCIES
ALERTS

Terminal · email · Telegram · webhook

Each channel is independent and stdlib-only. An alert carries the IP, its score, the rules it hit and sample requests.

HONEYPOT

Decoys that catch pokers

A fake OpenSSH banner, fake WordPress and phpMyAdmin logins, a fake .env and .git/config — touch one and you're scored.

SAFE BY DEFAULT

Whitelist + dry-run

Whitelisted IPs and CIDRs can never be banned, and dry-run logs the exact firewall command it would run — until you switch it off.

INCIDENT STORE

SQLite, not a scrollback

Incidents, scores and bans persist in SQLite, so attackers, incidents and stats stay queryable across restarts.

DASHBOARD

One page, whole picture

Totals, counts by rule and source, top attacker IPs, active bans and recent incidents — plus the Loophalt code-security section.

SERVICE-READY

Runs as a systemd service

An install script and systemd unit are included, and everything — sources, thresholds, channels, firewall — is one JSON config.

Fig. 04

Up and running in one command

Clone it, run it. Machine-readable output for pipelines, human output for people, and --fix-dry prints ready-made fix suggestions as diffs for 16 rules — it never touches your files uninvited.

  terminal
# clone — that's the entire install
git clone https://github.com/loophalt/loophalt
cd loophalt

# scan a project
python3 loophalt.py scan ./your-project

# only criticals and highs, specific folder
python3 loophalt.py scan ./src \
  --severity critical,high

# preview fixes as diffs (dry run)
python3 loophalt.py scan . --fix-dry
  pipeline output
# JSON for your own tooling
python3 loophalt.py scan . --json

# SARIF 2.1.0 for code scanning UIs
python3 loophalt.py scan . --sarif

# exit code 1 on critical/high findings,
# so CI fails the build exactly when it should
python3 loophalt.py scan . ; echo $?
Fig. 05

First-class in GitHub Actions

The official Action runs Loophalt on every push and pull request and uploads SARIF results to your repository's Security tab — findings show up where your team already reviews code.

  .github/workflows/security.yml
name: Security scan
on: [push, pull_request]
permissions:
  security-events: write
jobs:
  loophalt:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: loophalt/loophalt@v1
InputWhat it does
pathDirectory to scan (default: repo root)
severityMinimum severity to report
upload-sarifPublish results to code scanning
fail-on-findingsFail the workflow on critical/high

PINNED AS @v1 · SELF-TESTED IN CI ON EVERY PUSH

Fig. 06

Loophalt questions, answered

What is Loophalt?+

Loophalt is a free, open-source static security scanner that ships as a single Python file with zero dependencies. It scans JavaScript/TypeScript, Python, Go, PHP, Ruby, C# and Rust codebases — plus Terraform, Kubernetes manifests and Dockerfiles — with 112 checks: hardcoded secrets, SQL injection, XSS, command injection, weak crypto and more. It uses taint tracking, gives every finding a priority score (P1–P4) so you fix the worst holes first, and explains why each finding matters and how to fix it.

What are priority scores?+

Every finding carries a priority score from 0 to 100 and a band — P1 (fix now) through P4 — calculated from the finding's severity, whether taint tracking verified the data flow, and the class of weakness. Reports are sorted fix-first, and the score and band travel with the finding in JSON and SARIF output, so the most dangerous holes are always worked first.

How do I install Loophalt?+

There is nothing to install: clone the GitHub repository and run python3 loophalt.py scan ./your-project. If Python 3.8+ runs — laptop, CI runner or air-gapped box — Loophalt runs, fully offline, in seconds.

Does Loophalt send my code to a server?+

No. Loophalt runs entirely on your own machine: no accounts, no telemetry, no API keys and no network calls. Your code never leaves the box you scan it on.

How do I run Loophalt in CI?+

Use the official GitHub Action, loophalt/loophalt@v1: it scans on every push and pull request and uploads SARIF results to your repository's Security tab. From the CLI, Loophalt exits with code 1 on critical/high findings, so any pipeline can fail the build exactly when it should.

What is Loophalt Server Guard?+

Server Guard is Loophalt's runtime companion. It watches live web (Apache/Nginx) and SSH/auth logs, scores every suspicious IP, and alerts you — terminal, email, Telegram or webhook — with the attacker's IP. Repeat offenders are auto-banned at the firewall (iptables, nft or ufw), whitelist-protected and dry-run by default, and decoy honeypot ports catch anyone poking around. It also runs Loophalt's code scans on a schedule, so code holes and live attacks appear in one dashboard.

Is Loophalt really free?+

Yes. Loophalt and Server Guard are MIT-licensed open source on GitHub — free for personal and commercial use, with no paid tier, no sign-up and no usage limits.

Fig. 07

Open source, built in the open

Loophalt is MIT-licensed and maintained in public. A new rule is one focused function plus fixtures — the codebase is a single readable file, so your first contribution is an afternoon, not a week.

Also from the loophalt org: MergeGate — free, open-source PR triage (AI-slop scoring and duplicate-PR detection) for maintainers.