|
273 | 273 | "SecRuleEngine On", |
274 | 274 | "SecRule ARGS:subject \"@rxGlobal %{ARGS:patt}\" \"id:4001,phase:2,deny\"" |
275 | 275 | ] |
| 276 | + }, |
| 277 | + { |
| 278 | + "enabled": 1, |
| 279 | + "version_min": 300000, |
| 280 | + "title": "Testing Operator :: !@rxGlobal with PCRE match limits exceeded does not match (issue #3123)", |
| 281 | + "client": { |
| 282 | + "ip": "200.249.12.31", |
| 283 | + "port": 123 |
| 284 | + }, |
| 285 | + "server": { |
| 286 | + "ip": "200.249.12.31", |
| 287 | + "port": 80 |
| 288 | + }, |
| 289 | + "request": { |
| 290 | + "headers": { |
| 291 | + "Host": "localhost", |
| 292 | + "User-Agent": "curl/7.38.0", |
| 293 | + "Accept": "*/*", |
| 294 | + "Content-Length": "0", |
| 295 | + "Content-Type": "application/x-www-form-urlencoded" |
| 296 | + }, |
| 297 | + "uri": "/?rxtest=wwwwwwwwwwwwwwwwwwwwwowwwwwwwwwww", |
| 298 | + "method": "HEAD", |
| 299 | + "body": [ |
| 300 | + "" |
| 301 | + ] |
| 302 | + }, |
| 303 | + "response": { |
| 304 | + "headers": { |
| 305 | + "Date": "Mon, 13 Jul 2015 20:02:41 GMT", |
| 306 | + "Last-Modified": "Sun, 26 Oct 2014 22:33:37 GMT", |
| 307 | + "Content-Type": "text/html", |
| 308 | + "Content-Length": "8" |
| 309 | + }, |
| 310 | + "body": [ |
| 311 | + "no need." |
| 312 | + ] |
| 313 | + }, |
| 314 | + "expected": { |
| 315 | + "debug_log": "rxGlobal: regex error 'MATCH_LIMIT' for pattern", |
| 316 | + "error_log": "Matched \"Operator `StrEq' with parameter `1' against variable `MSC_PCRE_LIMITS_EXCEEDED'", |
| 317 | + "http_code": 200 |
| 318 | + }, |
| 319 | + "rules": [ |
| 320 | + "SecRuleEngine On", |
| 321 | + "SecPcreMatchLimit 2", |
| 322 | + "SecRule ARGS:rxtest \"!@rxGlobal (w+)+$\" \"id:1,phase:1,deny,status:403,t:trim\"", |
| 323 | + "SecRule MSC_PCRE_LIMITS_EXCEEDED \"@streq 1\" \"id:2,phase:1,pass,t:trim,block\"" |
| 324 | + ] |
| 325 | + } |
| 326 | +, |
| 327 | + { |
| 328 | + "enabled": 1, |
| 329 | + "version_min": 300000, |
| 330 | + "title": "Testing Operator :: !@rxGlobal with invalid macro-expanded pattern does not match (issue #3123)", |
| 331 | + "client": { |
| 332 | + "ip": "200.249.12.31", |
| 333 | + "port": 123 |
| 334 | + }, |
| 335 | + "server": { |
| 336 | + "ip": "200.249.12.31", |
| 337 | + "port": 80 |
| 338 | + }, |
| 339 | + "request": { |
| 340 | + "headers": { |
| 341 | + "Host": "localhost", |
| 342 | + "User-Agent": "curl/7.38.0", |
| 343 | + "Accept": "*/*", |
| 344 | + "Content-Length": "27", |
| 345 | + "Content-Type": "application/x-www-form-urlencoded" |
| 346 | + }, |
| 347 | + "uri": "/?patt=%28", |
| 348 | + "method": "POST", |
| 349 | + "body": [ |
| 350 | + "subject=wwww" |
| 351 | + ] |
| 352 | + }, |
| 353 | + "response": { |
| 354 | + "headers": { |
| 355 | + "Date": "Mon, 13 Jul 2015 20:02:41 GMT", |
| 356 | + "Last-Modified": "Sun, 26 Oct 2014 22:33:37 GMT", |
| 357 | + "Content-Type": "text/html", |
| 358 | + "Content-Length": "8" |
| 359 | + }, |
| 360 | + "body": [ |
| 361 | + "no need." |
| 362 | + ] |
| 363 | + }, |
| 364 | + "expected": { |
| 365 | + "debug_log": "Error with regular expression: \"\\(\"", |
| 366 | + "error_log": "Matched \"Operator `StrEq' with parameter `1' against variable `MSC_PCRE_ERROR'", |
| 367 | + "http_code": 200 |
| 368 | + }, |
| 369 | + "rules": [ |
| 370 | + "SecRuleEngine On", |
| 371 | + "SecRule ARGS:subject \"!@rxGlobal %{ARGS:patt}\" \"id:4001,phase:2,deny,status:403\"", |
| 372 | + "SecRule MSC_PCRE_ERROR \"@streq 1\" \"id:4002,phase:2,pass,log\"" |
| 373 | + ] |
276 | 374 | } |
277 | 375 | ] |
0 commit comments