ebstore pro
// SAST · SECRETS · ZERO DEPENDENCIES

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.

MIT LICENSE·PYTHON 3.8+·NO PIP INSTALL·RUNS OFFLINE
zsh — loophole scan
➜ ~ python3 loophole.py scan ./api-server Loophole found 55 issue(s): 9 critical, 29 high, 17 medium CRITICAL 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 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 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 ➜ ~
61
security checks
5
languages covered
0
dependencies
1
file — that's the install

DOGFOODED — LOOPHOLE 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

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

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 — Loophole runs. Offline, in seconds.

Fig. 02

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.

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
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
⌨️

Command Injection

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

CRITICALCMD001–004
🧨

Code Injection (eval)

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

CRITICALEVAL001–002
📡

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
🧩

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
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
🔌

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
Every scan runs all 61 tools together — point Loophole at your project, get one report with a plain-English why and a concrete fix for every finding.
Fig. 03

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.

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 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
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 Loophole 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 mechanical fix suggestions as diffs — it never touches your files uninvited.

  terminal
# 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
  pipeline output
# 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 $?
Fig. 05

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.

  .github/workflows/security.yml
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
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

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.

Fig. 07

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.