Find the security holes in your code — before someone else does.
Loophole 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 tells you why each one matters and how to fix it.
DOGFOODED — LOOPHOLE SCANS ITS OWN CODEBASE CLEAN · GITHUB ACTION VERIFIED IN CI · SARIF → GITHUB SECURITY TAB
Built like a tool developers actually keep
Data-flow, not grep
Loophole follows user input from source to sink — req.query.cmd → cmd → exec — so findings are real, reachable flows instead of keyword noise.
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.
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 — Loophole runs. Offline, in seconds.
61 security tools. Zero jargon.
Every check Loophole 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 61 run together in every scan; nothing to select or configure.
🔑 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.
Passwords Written in Code
A real password sitting in a file instead of a private settings area.
Private Key in the Project
The master key file of your server, included in the code folder itself.
Cloud Keys Exposed
Amazon/AWS access keys hardcoded — someone could run up cloud bills in your name.
Secret-Looking Strings
Random-looking strings that behave exactly like passwords, even if nobody labelled them.
Secrets Printed in Logs
Passwords or tokens written into log files, where they quietly stay forever.
🗄️ 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.
NoSQL Injection
The same trick aimed at MongoDB-style databases — login forms are the favourite target.
LDAP Injection
Company directory lookups built from typed input can be twisted to bypass logins.
🚪 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.
Command Injection
Visitor input turned into server commands — the attacker ends up driving your machine.
Code Injection (eval)
eval() and friends running text as code — if any of that text comes from a visitor, game over.
Server-Side Request Forgery
Your server tricked into calling internal addresses it should never reveal or reach.
Prototype Pollution
A JavaScript flaw where attackers quietly rewrite how your whole app behaves.
XML External Entity (XXE)
Uploaded XML files that make your server hand over its own private files.
Regex Denial of Service
A pattern so tangled that one crafted input can freeze your site for everyone.
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.
Header Injection (Response Splitting)NEW
User-influenced values written into response headers can smuggle extra headers — or a whole fake response — into the reply.
XML Entity Expansion (libxmljs)NEW
libxmljs parsers with entity expansion switched on can be fed documents that blow up memory or reach local files.
Unsafe HTML SinksNEW
insertAdjacentHTML, Vue v-html and Angular bypassSecurityTrust* render raw HTML — the same hole as innerHTML, in framework clothing.
📁 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.
Zip Slip
A booby-trapped ZIP that writes files anywhere on your server when opened.
Unsafe File Uploads
Upload boxes that never check what kind of file arrived — a favourite break-in route.
Unsafe Deserialization
Saved-data formats (pickle, unserialize) that execute whatever an attacker packed inside.
Unsafe Deserialization (jsonpickle / v8)NEW
jsonpickle.decode and v8.deserialize rebuild objects from attacker data — code execution hiding in a saved file.
🔐 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.
JWT "None" / Weak Secret
Settings that accept unsigned tokens, or secrets so short anyone can guess them.
Weak Login Patterns
Authentication shortcuts that look fine and fail quietly under attack.
Missing CSRF Protection
Without it, a malicious page can make your logged-in visitors act without knowing.
Wide-Open CORS
Your app answering data requests from literally any website on the internet.
Open Redirect
Links on your own trusted domain that silently bounce visitors to scam sites.
Missing Security Headers
Standard browser protections (CSP, frame guards) simply never switched on.
Debug Mode Left On
Developer debug screens still active in the live app — they leak how everything works.
Error Details Shown to Visitors
Full technical error messages handed to strangers — a map for attackers.
Cookie Without HttpOnlyNEW
Session cookies set without HttpOnly can be stolen by any script that slips onto the page.
CORS Reflects Any OriginNEW
Echoing back any request Origin — or pairing credentials with a wildcard — lets any site act as your user.
Secrets Compared with ==NEW
Comparing tokens with == leaks timing hints, and PHP type juggling can turn a wrong secret into a match.
DOM Open RedirectNEW
JavaScript that sends visitors to a URL taken from the page — a phishing link wearing your domain.
🔒 Encryption & Connection Safety
How passwords are stored and how data travels.
MD5 Password Storage
Passwords hashed with MD5 — crackable in seconds with free tools.
SHA-1 Password Storage
SHA-1 is retired for passwords for a reason — nearly as fast to crack as MD5.
Ancient Ciphers (DES / RC4)
Encryption methods from another era, broken by modern computers.
Hardcoded IV / ECB Mode
Encryption done with a fixed starting value, or ECB mode that leaks patterns in your data.
Secure Connection Check Switched Off
TLS verification disabled — your app will happily talk to a fake server.
Outdated TLS Versions
Old connection protocols (TLS 1.0/1.1) that browsers and attackers both left behind.
Predictable Random Values
"Random" codes and tokens an attacker can guess — session IDs, reset links, OTPs.
Weak PHP Random for TokensNEW
PHP rand(), mt_rand() and uniqid() are predictable — fine for shuffling a list, fatal for tokens and OTPs.
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.
Loophole Server Guard — protection for running servers
Scanning code is only half the job. Loophole 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 Loophole's own scans on the server's code on a schedule, so code holes and live attacks land in one dashboard.
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.
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.
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.
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 Loophole, Server Guard runs the same 61 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 Loophole'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
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.
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.
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.
SQLite, not a scrollback
Incidents, scores and bans persist in SQLite, so attackers, incidents and stats stay queryable across restarts.
One page, whole picture
Totals, counts by rule and source, top attacker IPs, active bans and recent incidents — plus the Loophole code-security section.
Runs as a systemd service
An install script and systemd unit are included, and everything — sources, thresholds, channels, firewall — is one JSON config.
Up and running in one command
Clone it, run it. Machine-readable output for pipelines, human output for people, and --fix-dry prints mechanical fix suggestions as diffs — it never touches your files uninvited.
# clone — that's the entire install git clone https://github.com/rootsiemen/loophole cd loophole # scan a project python3 loophole.py scan ./your-project # only criticals and highs, specific folder python3 loophole.py scan ./src \ --severity critical,high # preview fixes as diffs (dry run) python3 loophole.py scan . --fix-dry
# JSON for your own tooling python3 loophole.py scan . --json # SARIF 2.1.0 for code scanning UIs python3 loophole.py scan . --sarif # exit code 1 on critical/high findings, # so CI fails the build exactly when it should python3 loophole.py scan . ; echo $?
First-class in GitHub Actions
The official Action runs Loophole 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.
name: Security scan on: [push, pull_request] permissions: security-events: write jobs: loophole: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: rootsiemen/loophole@v1
| Input | What it does |
|---|---|
| path | Directory to scan (default: repo root) |
| severity | Minimum severity to report |
| upload-sarif | Publish results to code scanning |
| fail-on-findings | Fail the workflow on critical/high |
PINNED AS @v1 · SELF-TESTED IN CI ON EVERY PUSH
Loophole questions, answered
What is Loophole?+
Loophole is a free, open-source static security scanner that ships as a single Python file with zero dependencies. It scans JavaScript/TypeScript, Python, Go and PHP codebases with 61 checks — hardcoded secrets, SQL injection, XSS, command injection, weak crypto and more — using taint tracking, and explains why each finding matters and how to fix it.
How do I install Loophole?+
There is nothing to install: clone the GitHub repository and run python3 loophole.py scan ./your-project. If Python 3.8+ runs — laptop, CI runner or air-gapped box — Loophole runs, fully offline, in seconds.
Does Loophole send my code to a server?+
No. Loophole 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 Loophole in CI?+
Use the official GitHub Action, rootsiemen/loophole@v1: it scans on every push and pull request and uploads SARIF results to your repository's Security tab. From the CLI, Loophole exits with code 1 on critical/high findings, so any pipeline can fail the build exactly when it should.
What is Loophole Server Guard?+
Server Guard is Loophole'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 Loophole's code scans on a schedule, so code holes and live attacks appear in one dashboard.
Is Loophole really free?+
Yes. Loophole 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.
Open source, built in the open
Loophole 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.

Loophole