Security input validation with dual response modes: legal deterrence (NIS2/GDPR compliant audit trail) or comedy (hiking boots for hackers). TIBET provenance. OWASP aware.
Project description
inject-bender
Security input validation with dual response modes: legal deterrence (NIS2/GDPR compliant audit trail) or comedy (hiking boots for hackers).
Every detected attack is logged with TIBET provenance tokens.
Install
pip install inject-bender
With TIBET audit trail:
pip install inject-bender[tibet]
With FastAPI middleware:
pip install inject-bender[api]
Quick Start
from inject_bender import InjectBender
bender = InjectBender(mode="legal") # or "comedy"
result = bender.bend("'; DROP TABLE users; --")
if result["was_attack"]:
print(result["formatted"])
print(f"Incident: {result['incident_id']}")
Detection Only
from inject_bender import detect
is_attack, attack_type = detect("SELECT * FROM users WHERE 1=1")
# (True, "sql_injection")
Modes
| Mode | Response | Use Case |
|---|---|---|
legal |
Law citations, NIS2 audit trail, incident reports | Production, enterprise |
comedy |
Hiking boot ads (Skippie & Odin) | Development, demos, honeypots |
silent |
Detect and log only | Monitoring, WAF integration |
custom |
Your own response function | Any |
ASGI Middleware
from fastapi import FastAPI
from inject_bender.middleware import InjectBenderMiddleware
app = FastAPI()
app.add_middleware(InjectBenderMiddleware, mode="legal")
CLI
inject-bender check "'; DROP TABLE users; --"
inject-bender bend --mode comedy "<script>alert('xss')</script>"
inject-bender laws
inject-bender demo
Attack Types Detected
SQL Injection, XSS, Command Injection, Path Traversal, Prompt Injection, LDAP Injection, XML/XXE, Header Injection, Template Injection (SSTI).
NIS2 Compliance
- Automatic incident detection and logging
- Immutable TIBET audit trail
- Report generation: NIS2, AP (Autoriteit Persoonsgegevens), Politie
- 24-hour deadline tracking
Legal Mapping
Dutch/EU criminal law per attack type: Sr art. 138ab (computervredebreuk), Sr art. 350a (gegevensvernieling), AVG/GDPR art. 32/33/34, EU AI Act, EU 2013/40.
License
MIT — Humotica AI Lab 2025-2026
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file inject_bender-0.3.0.tar.gz.
File metadata
- Download URL: inject_bender-0.3.0.tar.gz
- Upload date:
- Size: 16.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc96bd7ac903b5ed51b7b86994f08f1176d98de6d9a7a2e1cd33e9de0cfd3b5b
|
|
| MD5 |
5a8c3f9abd2e4ab9bbadd862fe1186bc
|
|
| BLAKE2b-256 |
0c3a0b71d0b00b4d2556e34a630adde0159da6cd6b06b2d1a7554821a64cb82c
|
File details
Details for the file inject_bender-0.3.0-py3-none-any.whl.
File metadata
- Download URL: inject_bender-0.3.0-py3-none-any.whl
- Upload date:
- Size: 19.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95676ff79919dc11f9e9a93ab7c9c3cbfd13d0a1ed2f806c07b0ef2442a0de39
|
|
| MD5 |
a250cc1c18e9467ca01e202e48ecda44
|
|
| BLAKE2b-256 |
81c9843b1ea84a3a21b4857fc79e6fb5a0ca3e0b50129af8a3ed60b776aab128
|