NGINX Warden Changelog & Release Notes
All notable changes to NGINX Warden (github.com/routewarden/nginx-warden) are documented here.
The format is based on Keep a Changelog, and NGINX Warden adheres to Semantic Versioning.
[v1.8.0] - 2026-10-30 (Latest)
Added
- AI Bot & Web Crawler Defense:
- Added native detection and blocking of automated LLM scrapers and AI crawlers (
block_ai_botsLua option). - Built-in multi-tier AI bot registry supporting
train_only(default:GPTBot,ClaudeBot,Bytespider,CCBot),all(PerplexityBot,OAI-SearchBot),aggressive, andcustomprofiles viaai_bot_profile. - Added custom User-Agent pattern blocking via
block_user_agentsand allowlisting viaallow_user_agents.
- Added native detection and blocking of automated LLM scrapers and AI crawlers (
- Negative ASN Filtering (
blocked_asns):- Added support for blocking client IP addresses originating from hostile Autonomous Systems or scraping clouds via
blocked_asns(e.g.AS138699) using local offline routing snapshot (asn_db).
- Added support for blocking client IP addresses originating from hostile Autonomous Systems or scraping clouds via
- Active Deception Response Modes (
aiPoison&markovTarpit):- Added
mode = "aiPoison": Serves HTTP 200 withX-Robots-Tag: noindex, nofollow, noaiand adversarial system prompt injection directives. - Added
mode = "markovTarpit": Continuously streams pseudo-coherent Markov text tokens at configured delays (tarpit_delay_ms), exhausting scraper worker capacity.
- Added
- Honeypot Spider Traps & In-Memory IP Ban Table:
- Added
honeypot_trap_pathsto configure invisible honeypot routes in web templates. - Added bounded in-memory sliding-window IP ban table: any crawler accessing a honeypot path is banned for
trap_ban_duration(default:24h), automatically rejecting subsequent requests.
- Added
- Search Engine Impersonator Verification via FCrDNS (
verify_search_engine_bots):- Added Forward-Confirmed Reverse DNS verification setting
verify_search_engine_bots. - Performs reverse DNS PTR lookups and forward IP cross-validation for crawlers presenting Googlebot, bingbot, or Applebot User-Agents against authorized domain suffixes (
.googlebot.com,.google.com,.search.msn.com,.applebot.apple.com). - Includes a bounded in-memory cache with 6-hour TTL (up to 10,000 entries) and 500ms timeout.
- Allows verified search engine spiders through to upstream services while instantly blocking spoofed bots (
search_engine_spoofed).
- Added Forward-Confirmed Reverse DNS verification setting
- Browser Impersonation Detection (
detect_browser_impersonation):- Added
detect_browser_impersonationoption to detect and block bots disguising themselves with desktop/mobile browser User-Agents. - Cross-validates Client Hints (
Sec-CH-UA-Platformmatching OS in User-Agent,Sec-CH-UA-Mobileform factor consistency,Sec-CH-UApresence on modern Chromium $\ge 89$, and brand integrity), Chromium Fetch Metadata (Sec-Fetch-Site,Sec-Fetch-Mode,Sec-Fetch-Dest), and mandatory companion headers (Accept-Language,Accept-Encoding).
- Added
- Script Client & Headless Automation Blocking (
block_script_clients):- Added
block_script_clientsoption to block requests originating from programmatic HTTP client libraries (Pythonrequests,urllib,aiohttp,httpx,Scrapy,curl-cffi,mechanize, PHPGuzzle, Rustreqwest, Nodeaxios,node-fetch,undici, GoGo-http-client, JavaOkHttp,curl,wget) and headless automation frameworks (X-Playwright,X-Puppeteer,X-Selenium,X-Cypress,X-Headless-Chrome,X-Automation,Sec-WebDriver).
- Added
- Edge robots.txt Dynamic Honeypot Injection (
enable_robots_txt_honeypot):- Dynamically injects daily rotating
Disallow: /_rw_trap_<token>/bait into/robots.txtvia pure-Lua HMAC-SHA256 calculation and UTC rollover tolerance. - Automatically synthesizes 200 OK
robots.txtresponses when origin returns 404, trapping non-compliant scrapers intoBanTable.
- Dynamically injects daily rotating
- 10-Engine Global FCrDNS Verification (
verify_search_engine_bots):- Expanded search engine verification to 10 global engines: Google, Bing, Apple, Yandex, Baidu, DuckDuckGo, Yahoo, Naver, Sogou, and Mojeek.
- Chromium GREASE & Header Order Anomaly Detection (
detect_browser_impersonation):- Added Chromium GREASE brand validation (
missing_grease_brand) and HTTP header order anomaly detection (header_order_anomaly).
- Added Chromium GREASE brand validation (
- Datacenter & Cloud Hosting IP Classification (
block_cloud_hosts):- Added
block_cloud_hosts = trueoption to classify and block datacenter scrapers and browser impersonators from AWS, GCP, Azure, Hetzner, DigitalOcean, OVH, Linode, Oracle, ByteDance, with FCrDNS exemptions for legitimate search crawlers.
- Added
- Cryptographic Proof-of-Work Challenge Mode (
powChallenge):- Added
mode = "powChallenge"with response configuration options:pow_difficulty,pow_secret,pow_timeout_seconds. - Serves zero-dependency Web Crypto Hashcash solver (<2KB) returning HTTP 429, allowing solved
rw_powcookie orX-RouteWarden-PoWheader to bypass route blocks while keeping honeypot traps and hard IP bans immutable.
- Added
[v1.7.0] - 2026-10-27
Added
- Offline ASN-Based Allowlisting (
allowed_asns/asn_db):- Added support for Autonomous System Number (ASN) based allowlisting using an offline JSON routing snapshot (
asn_db) parsed into an in-memory lookup table during worker initialization (init_by_lua_block), incurring zero runtime HTTP/DNS latency. - Added Lua configuration table options
allowed_asns = { "AS64500" }andasn_db = "/etc/routewarden/asn.json", with dual-casing support for camelCase keys (allowedASNs,asnDB) when loading sharedroutewarden.jsonpolicy manifests. - Implemented longest-prefix routing table matching supporting both IPv4 and IPv6 addresses, including IPv4-mapped IPv6 addresses (
::ffff:x.x.x.x). - Added hierarchical route preservation: more specific routes allocated to other ASNs do not inherit an allowed parent's bypass. Conflicting prefix origins are rejected during database initialization.
- Non-matching client IPs continue to standard path inspection without rejection; matching client IPs bypass inspection identical to
allowed_ips. - Added integration with
trusted_proxiesto evaluate real client IPs safely without trusting client-supplied ASN headers. - Bundled database compilation utility
scripts/build-asn-db.pyto convert MaxMind GeoLite2/GeoIP2 ASN Blocks CSV files into JSON routing snapshots. - Synchronized
_VERSION = "1.7.0"across all core Lua modules (resty.routewarden.*).
- Added support for Autonomous System Number (ASN) based allowlisting using an offline JSON routing snapshot (
Fixed & Enhanced
- IPv6 Scope & Zone Identifier Sanitization:
- Stripped IPv6 zone identifiers in OpenResty Lua ASN lookups before network prefix matching, ensuring link-local and scoped IPv6 client connections resolve reliably against routing tables.
- Normalizer & Response Modes Refinements:
- Refined URL path normalization edge cases and synchronized response handler fallbacks across all 13 response modes in pure Lua.
- Hardened silent drop connection resets and custom response text delivery.
- AI Bot & Crawler Defense Architecture:
- Published comprehensive AI bot mitigation guide covering active tarpits, gzip bomb counters, and ASN filtering against automated LLM training scrapers (
GPTBot,ClaudeBot,Bytespider,CCBot) in OpenResty.
- Published comprehensive AI bot mitigation guide covering active tarpits, gzip bomb counters, and ASN filtering against automated LLM training scrapers (
- Test Suite Expansion:
- Added new Test::Nginx and pure-Lua test cases in
t/test_routewarden.luaandt/test_asn.lua.
- Added new Test::Nginx and pure-Lua test cases in
[v1.6.0] - 2026-10-20
Added
- Fractional & Floating Point Gzip Decompression Bomb Sizing (
gzip_bomb_mb):- Supported floating-point values for
gzip_bomb_mbinresponse.lua(e.g.,gzip_bomb_mb = 0.5). - Added safe chunk floor guard (
if total_chunks <= 0 then total_chunks = 1 end) preventing empty or negative chunk streaming on sub-megabyte sizes. - Added test coverage in
t/test_response.lua.
- Supported floating-point values for
- Module Version Synchronization (
1.6.0):- Synchronized
_VERSION = "1.6.0"across all core Lua modules:resty.routewarden.config,resty.routewarden.init,resty.routewarden.ip_filter,resty.routewarden.logger,resty.routewarden.normalizer, andresty.routewarden.response. - Updated
version.jsonandVERSIONING.md.
- Synchronized
[v1.5.1] - 2026-10-19
Fixed
- Gzip Decompression Bomb (
gzip_bomb/bomb) Status Code Default:- Fixed
gzip_bombmode defaulting to403instead of200 OKin_M.new()whenstatus_codeis not configured, ensuring crawlers receive an enticing200 OKheader to trigger decompression. - Custom user-configured
status_codevalues remain respected when provided.
- Fixed
[v1.5.0] - 2026-10-16
Key Highlights
- File-Based Configuration (
config_file):- Added new
config_fileoption toroutewarden.new({ config_file = "/etc/routewarden/routewarden.json" })(or passing the file path directly:routewarden.new(filepath)). - Automatically loads and parses shared
routewarden.jsonpolicy manifests, mapping universal camelCase properties (enableDefaultPatterns,blockPatterns,allowedIps,response.mode,statusCode) to native Lua table keys. - Supports OpenResty's built-in
cjson/cjson.safewith an embedded pure-Lua JSON parser fallback for standalone environments. - Inline Lua configuration overrides file settings while preserving file-defined rule slices.
- Missing or malformed configuration files cause a hard startup error with descriptive diagnostics.
- Added unit test coverage in
t/test_config.lua.
- Added new
[v1.4.1] - 2026-10-07
Key Highlights
- Strict Status Code Canonicalization (
status_code):- Removed deprecated
opts.statusandopts.response.statusalias fallbacks in OpenResty Lua configuration (init.lua) in favor of strictly canonicalstatus_code.
- Removed deprecated
- Comprehensive Pattern Test Suite:
- Added full test suite verifying
block_patternsandallow_patternsprecedence, exact URI matching, and custom pattern override behavior across OpenResty phases.
- Added full test suite verifying
[v1.4.0] - 2026-10-05
Key Highlights
- Large Request Body Disk Buffer Fallback (
ngx.req.get_body_file):- Fixed request body inspection bypass when payload size exceeds OpenResty's
client_body_buffer_size. OpenResty buffers large request bodies to temporary disk files wherengx.req.get_body_data()returnsnil. Routewarden now reads up tocheck_body_max_bytesfromngx.req.get_body_file(), ensuring malicious payloads in large requests are inspected.
- Fixed request body inspection bypass when payload size exceeds OpenResty's
- Canonical Directive Standardization & Duplicate Alias Removal:
- Standardized OpenResty Lua configuration on canonical
enable_default_patternsandenable_default_allow_patterns. - Standardized on
block_patternstable replacingpath_patterns. - Standardized on
mode(replacingaction),status_code(replacingstatus),check_body_patterns, andcheck_body_max_bytes. - Removed duplicate aliases in
config.luaandinit.lua.
- Standardized OpenResty Lua configuration on canonical
[v1.3.1] - 2026-10-02
Key Highlights
- Protocol-Relative Open Redirect Prevention (
response.lua):- Hardened redirect destination validation against protocol-relative URL evasion vectors (e.g.,
//attacker.com). - Protocol-relative destinations are safely detected, discarded, and fallback to root
/, preventing open-redirect exploitation.
- Hardened redirect destination validation against protocol-relative URL evasion vectors (e.g.,
- Security Log Schema Normalization (
level: "warn"):- Added
"level": "warn","status_code", and"matched_pattern"across both standard JSON logger (logger.lua) and emergency fallback logging (init.lua). - Ensures field parity with Routewarden observability and SIEM pipelines.
- Added
- CI / Version Scripting Portability:
- Improved in-place sed editing in
scripts/update-version.shfor reliable multi-platform execution across macOS (BSD) and Linux (GNU).
- Improved in-place sed editing in
[v1.3.0] - 2026-10-01
Key Highlights
- Trusted Proxies Support (
trusted_proxies):- Added support for
trusted_proxiesinip_filter.luaandconfig.luasupporting exact IP addresses and CIDR subnets across both IPv4 and IPv6. - Forwarded headers (
X-Forwarded-ForandX-Real-IP) are now only trusted whenngx.var.remote_addrmatches a declared trusted proxy. - Neutralizes IP spoofing vectors where attackers attempt to bypass
allowed_ipsrestrictions by injecting forged headers directly into NGINX.
- Added support for
- Redirect Mode Security Hardening:
- Restricts redirect destination targets to safe protocols (
http,https) or relative paths starting with/. - Malformed or dangerous URI schemes (such as
javascript:) are safely discarded and fallback to/.
- Restricts redirect destination targets to safe protocols (
- RFC 1951 DEFLATE Gzip Bomb Compliance:
- Standardized
gzipbombresponse generation with valid RFC 1951 uncompressed DEFLATE blocks, explicit block lengths, final block markers, and gzip trailers. - Resolves decompression errors across strict HTTP clients and vulnerability scanners while maximizing memory consumption on attacker tooling.
- Standardized
- Structured Log Escaping:
- Enhanced JSON escaping in
logger.luato convert all ASCII control characters ([\1-\31%z]) into standard\u00XXunicode escape sequences. - Prevents log corruptions and malformed JSONL outputs when handling malicious binary payloads or control-character injection attempts.
- Enhanced JSON escaping in
- Response Content-Type Headers:
- Explicitly sets
Content-Typeheaders forgzipbombandinfinitestreamresponse modes.
- Explicitly sets
- Normalizer Scope Fix:
- Resolved local variable scoping issue for
raw_uri_pathinnormalizer.lua.
- Resolved local variable scoping issue for
[v1.2.1] - 2026-09-24
Key Highlights
- Query Parameter Attack Surface Hardening (
check_query):- OpenResty Lua inspector evaluates both parameter keys and parameter values.
- Prevents query key injection bypasses (
/?sensitive_file=valueor/?settings.py=).
- Client IP Extraction & Port/Bracket Normalization (
clean_ip):- Automatically strips port suffixes (
:8080) and IPv6 brackets ([...]) fromX-Forwarded-ForandX-Real-IPheaders prior to CIDR evaluation.
- Automatically strips port suffixes (
- OpenResty Concurrency Bug Fix:
- Made the
compiledcache table strictly local withincompile_regexto prevent race conditions across concurrent requests in OpenResty worker processes.
- Made the
- Default Security Logging (
security_log = true):- Enabled
security_log = trueby default inconfig.luafor multi-gateway parity with Traefik and Caddy.
- Enabled
- Lua Regex Hyphen Escaping:
- Escaped hyphens (
%-) outside character classes in fallback pure-Lua pattern matching, preventing Lua's-magic quantifier from misinterpreting regexes in environments without PCRE.
- Escaped hyphens (
- Configuration Parsing Aliases:
- Added support for singular aliases (
path_pattern,block_pattern,allow_pattern,allowed_ip) and single-string values in configuration tables.
- Added support for singular aliases (
- Silent Drop Event Parity:
- Fixed security event logger to accurately emit
action = "silentDrop"when silent drop (HTTP 444) triggers.
- Fixed security event logger to accurately emit
[v1.2.0] - 2026-09-24
Key Highlights
- Routewarden CLI Compilation Target (
--target nginx):rwarden generate --target nginxgenerates production-readyinit_by_lua_blockLua configuration tables directly fromroutewarden.json.
- Enhanced Test Suites (
test_config.lua):- Comprehensive unit test suites validating configuration tables, singular aliases, and CIDR checks.
[v1.1.0] - 2026-09-20
Key Highlights
- Worker-Level Regex Caching:
- Reuses compiled PCRE matchers across repeated requests and instances to minimize LuaJIT GC pressure.
- Context Auto-Population:
- Enhanced
warden:check()to automatically extract HTTP method, URI, query string, remote address, and headers directly fromngxcontext when called without arguments.
- Enhanced
- Expanded Default Block Patterns:
- Coverage for private keys (
*.pem,*.key), container manifests (Dockerfile*),.DS_Store, and CMS configs.
- Coverage for private keys (
[v1.0.0] - 2026-09-20
Key Highlights
- Initial GA Release of
nginx-warden:- Production-ready Lua middleware for OpenResty and NGINX with
lua-nginx-module. - Executes directly inside worker memory during the
access_by_luaphase without extra proxy latency. - Zero external dependencies: pure OpenResty standard libraries (
ngx.re,resty.string, bit operations). - Complete parity with Go implementations:
- Multi-layer recursive percent-decoding (
%252e%252e). - Semicolon matrix parameter stripping (
/;param/.env). - Windows backslash normalization (
\..\). - Null-byte injection scrubbing (
%00). - Canonical path resolution and dot-segment traversal protection.
- Multi-layer recursive percent-decoding (
- Full suite of 13 response modes supported including HTTP 444 silent drops and reverse slowloris tarpits.
- Structured JSON security logging compatible with CrowdSec parsers.
- Production-ready Lua middleware for OpenResty and NGINX with