# Change Log (Current)
The format is based on Keep a Changelog (opens new window), and this project adheres to Semantic Versioning (opens new window).
What is a breaking change?
- The old configuration file may not work, for example, if a directive item is removed or renamed.
# [Unreleased]
# Added
# Removed
# Changed
# Fixed
# [10.1.2] - 2022-07-09 UTC+0800
# Fixed
- compatible with
nginx-1.23.0
# [10.1.1] - 2022-01-07 UTC+0800
# Added
- PCRE2 library support.
# Fixed
Memory leak.
CAPTCHA and Under-Attack-Mode sometimes cause infinite page refreshes.
# [10.1.0] - 2021-12-14 UTC+0800
# Added
You can set the directive
waftobypass, in which case no requests will be intercepted, but ngx_waf will still do the detection and logging.The directive
waf_verify_bothas a new parameterSogouSpider, which is used to verify if it is a Sogou crawler.
# Fixed
Garbage collection is not running, which does not lead to memory leaks, but does lead to performance problems.
Sometimes the
[FAKE-BOT]log is printed incorrectly.
# [10.0.1] - 2021-12-05 UTC+0800
# Added
- Added two Easter eggs, which you can find clues in the documentation. These two eggs are not triggered automatically and need to be enabled manually.
# Fixed
- All parameters of the directive
waf_modecorresponding to the request method are not working.
# [10.0.0] - 2021-11-30 UTC+0800
# Added
New directive
waf_zone, used to declare a piece of shared memory that will be used for other directives, such aswaf_cc_deny.New directive
waf_action, used to set actions after intercepting a request, such as returning a specific status code or challenging the client with a captcha.New directive
waf_block_page, used to set the blocking page to return the specified HTML file when the request is blocked.A new embedded variable,
$waf_rate, is used to indicate the number of accesses to the current IP in a period. The period is determined by the parameterrateof the directivewaf_cc_deny, or by the parameterdurationif the IP has been blacked out.The directive
waf_captchahas a new parametermax_fails, which sets the maximum number of attempts for the captcha and the blocking time after it is exceeded.The directive
waf_captchahas a new parameterzonethat specifies a piece of shared memory, which needs to be set if and only if the parametermax_failsis set.The directive
waf_captchahas a new parametersitekey, which needs to be set if and only if the parameterfileis omitted.When you reload nginx, the module keeps as much information in shared memory as possible so that it is not emptied, such as statistics used by CC protection.
# Removed
The directive
waf_http_statushas been removed and the related features have been merged into the directivewaf_action.The parameter
sizeof the directivewaf_cc_denyhas been removed andzoneis now used instead.
# Changed
You can omit the parameter
fileof the directivewaf_under_attack; omitting this parameter will use a built-in file fromassets/under_attack.html.You can omit the argument
fileto the directivewaf_captcha, which when omitted will use a built-in file based on the value of the argumentprov, which comes from the directoryassets/.
# [9.0.6] - 2021-10-10 UTC+0800
# Fixed
- If the directive
try_filesis executed, CAPTCHA may fail.
# [9.0.5] - 2021-10-09 UTC+0800
# New test suite
By chance, I found a test suite: test-nginx (opens new window).
It looked great, so I wrote a lot of test cases and tested with it. Unfortunately I found a lot of bugs, very wise of me.
# Changed
Removed useless debug log.
More debug log.
# Fixed
Sometimes the connection is closed prematurely.
When CAPTCHA is enabled, the request body inspection may be wrong.
CAPTCHA may fail due to HTTP caching.
Memory leak when reloading nginx.
Failed to properly merge directive
waf_cachefrom different contexts.Failed to properly merge directives
waf_cc_denyfrom different contexts.Failed to inherit
Refererblacklist different contexts.Failed to properly handle incorrect command syntax.
Fixed a default rule of URL.
Fixed the following files so that the page can be refreshed automatically after the CAPTCHA is completed.
assets/hCaptcha.htmlassets/reCAPTCHAv2_Checkbox.htmlassets/reCAPTCHAv2_Invisible.htmlassets/reCAPTCHAv3.html
# [9.0.4] - 2021-09-29 UTC+0800
# Fixed
- All inspections are incorrectly skipped when the directive
rewritecauses an internal redirect.
# [9.0.3] - 2021-09-28 UTC+0800
# Changed
- More debug logs.
# Fixed
- Failed to display the CAPTCHA page.
# [9.0.2] - 2021-09-25 UTC+0800
# Fixed
- Sometimes the value of the built-in variable
$waf_blocking_logis wrong.
# [9.0.1] - 2021-09-24 UTC+0800
# Fixed
- Failed to load rules of ModSecurity.
# [9.0.0] - 2021-09-23 UTC+0800
# NOTE
If you would like to upgrade to this version, please see the documentation for guidelines on upgrading across versions.
# Added
Compatible with ModSecurity (opens new window).
Added two directives:
waf_modsecurityandwaf_modsecurity_transaction_id.Added parameter
MODSECURITYto directivewaf_priority.
# Removed
Removed some parameters for directive
waf_mode:LIBINJECTION,LIBINJECTION-SQLI,LIBINJECTION-XSSandADV.Removed the parameter
ADVfrom the directivewaf_priority.Removed dependency libinjection (opens new window).
# Fixes
No longer returns a 404 status code when the captcha succeeds, but a 204 status code instead.
Sometimes a complete inspection of the request body is not performed.
# [8.0.3] - 2021-08-27 UTC+0800
# Fixed
Memory leak.
A field of a structure is not initialized, so you will see a lot of
malloc(size) failed (12: Out of memory)in the error log.
# [8.0.2] - 2021-08-27 UTC+0800
# Fixed
nginx crashes(segmentation fault) after enabling CAPTCHA because the directive
waf_captchawas not properly merged with different contexts.CAPTCHA page cannot be displayed because the directive
waf_captchawas not properly merged with different contexts.If the directive
proxy_passis used, neither Under-Attack-Mode nor CAPTCHA will work properly.
# [8.0.1] - 2021-08-23 UTC+0800
# Added
- No longer generates additional response headers when CC protection returns the status code 444.
# Fixed
Segmentation fault when
User-Agentis empty.The directive
waf_http_statuscould not be merged correctly.
# [8.0.0] - 2021-08-21 UTC+0800
# NOTE
If you would like to upgrade to this version, please see the documentation for guidelines on upgrading across versions.
# Added
Introduced CAPTCHAs for third-party platforms, supporting hCaptcha, reCAPTCHAv2 and reCAPTCHAv3, with the associated directive
waf_captcha.Support recognizing friendly crawlers, including GooleBot, BingBot, BaiduSpider and YandexBot, and automatically allow them after successful recognition, the related command is
waf_verify_bot.CC protection supports enabling CAPTCHA mode, which enables CAPTCHA when the request rate exceeds the limit, and blocks the IP if the CAPTCHA fails three times in a row, and recounts the request rate on the contrary.
# Changed
The syntax of the directive
waf_modehas changed, see the documentation for a guide to cross-version upgrades.The syntax of the directive
waf_cc_denyhas changed, see the documented guide to cross-version upgrades for details.The syntax of the directive
waf_cachehas been changed, see the cross-version upgrade guide in the documentation.Support for modifying the priority of request body inspection.
# Removed
- Removed two parameters of the directive
waf_cache:intervalandpercent.
# [7.1.0] - 2021-08-16 UTC+0800
# Added
- The parameter
rateof the directivewaf_cc_denyallows more formats, such as500r/s,500r/60s,500r/m,500r/60m,500r/h,500r/60hand500r/d.
# [7.0.1] - 2021-08-11 UTC+0800
# Fixed
Failed to parse
0.0.0.0/0correctly when handling IP black and white lists.Compatible with environments that do not support IPV6.
# [7.0.0] - 2021-08-04 UTC+0800
# Changed
Changed the way Under Attack Mode is implemented. It is no longer implemented using redirects, but by modifying the response body.
Removed directive
urifrom configuration itemwaf_under_attack, see documentation for details.Added a directive
fileto the configuration itemwaf_under_attackwhose value should be the absolute path to an HTML file, see the documentation for details.The directive
waf_cc_denyis not allowed at the contexthttp。