10 Commits
Author SHA1 Message Date
samwaf 24227923e8 feat: strengthen WAF detection coverage and gate the new inspection paths
Detection engine:
- Normalize request data (body, cookies, form and JSON values, request headers)
  before inspection instead of only the URL query string, so encoded variants
  are evaluated consistently.
- Extend XSS / SQLi / command-injection inspection to request bodies and to
  custom request headers; bodies and headers are scanned per value rather than
  as one blob to keep false positives low.
- Add a configurable body inspection mode (body_detect_mode: observe/block/off,
  default observe) so the new deep checks record rather than block until an
  operator confirms them, plus body_detect_field_exclude to skip fields that
  legitimately carry rich text.
- Keep false positives down on the new paths: skip structured values, require a
  corroborating signal before flagging body/header XSS, and leave dual-use
  keywords out of the fallback lists.
- Path traversal is now normalized and judged on whether it escapes the site
  root instead of matching literally; this also clears a long-standing false
  positive on legitimate in-site relative paths. Adds a sensitive-file list.
- Scanner detection now covers all request headers and known probe paths.

Plugins:
- Suspend plugin loading pending signing and admission work. The code path is
  retained but gated off, and shipped disabled by default.

Validated against a local test corpus and a 33k real-traffic benchmark:
detection improved across every category while the real-traffic false-positive
count stayed flat.
2026-08-23 11:29:22 +08:00
samwafgo 6d0a506b83 feat: scanner detection — inspect User-Agent, case-insensitive, expand fingerprints (#962) 2026-08-20 13:30:02 +08:00
samwaf 3a690a97bb feat: add XSS detection tests for libinjection and wafenginecore
- Introduced comprehensive test cases for XSS character detection in `libinjection-go/check_test.go`.
- Added tests for XSS checks in query values and form submissions in `wafenginecore/checkxss_test.go`.
- Tests cover various scenarios including false positives and real XSS cases.
2026-03-19 16:20:16 +08:00
samwaf e68c1e809d fix:check logic
#170
2025-03-04 14:53:40 +08:00
samwaf 2e421bff10 feat:update libinjection version 2025-02-05 09:52:42 +08:00
samwaf d0ffe56c1b fix:修正检测内部修改weblog无效的问题 2024-08-09 10:40:14 +08:00
samwaf 32a6acc741 fix:改动把状态库和日志库进行分离 2023-11-09 16:12:08 +08:00
samwaf 6e7cc81889 fix:暂时把style得不归xss有问题 2023-11-05 15:01:08 +08:00
samwaf 8cd5806a06 feat:1.重新设计记录记录方式 2.修正早期form检测问题 3.增加扫描工具识别 2023-11-01 16:14:36 +08:00
samwaf d466bcb8b0 sqli库 2022-12-26 16:53:25 +08:00