|
997 | 997 | }, |
998 | 998 | { |
999 | 999 | type => "config", |
1000 | | - comment => "SecRequestBodyLimitAction ProcessPartial (multipart/CRLF/partial/bad-header in part across limit #2)", |
| 1000 | + comment => "SecRequestBodyLimitAction ProcessPartial (multipart/CRLF/partial/bad-header in part before limit #1)", |
1001 | 1001 | conf => qq( |
1002 | 1002 | SecRuleEngine On |
1003 | 1003 | SecDebugLog $ENV{DEBUG_LOG} |
|
1012 | 1012 | debug => [ qr/Input filter: Bucket type HEAP contains 116 bytes./, 1], |
1013 | 1013 | }, |
1014 | 1014 | match_response => { |
1015 | | - status => qr/^200$/, |
| 1015 | + status => qr/^403$/, |
1016 | 1016 | }, |
1017 | 1017 | request => new HTTP::Request( |
1018 | 1018 | POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt", |
|
1032 | 1032 | }, |
1033 | 1033 | { |
1034 | 1034 | type => "config", |
1035 | | - comment => "SecRequestBodyLimitAction ProcessPartial (multipart/CRLF/parital/bad-header in part across limit #3)", |
| 1035 | + comment => "SecRequestBodyLimitAction ProcessPartial (multipart/CRLF/parital/bad-header in part before limit #2)", |
1036 | 1036 | conf => qq( |
1037 | 1037 | SecRuleEngine On |
1038 | 1038 | SecDebugLog $ENV{DEBUG_LOG} |
|
1047 | 1047 | debug => [ qr/Input filter: Bucket type HEAP contains 117 bytes./, 1], |
1048 | 1048 | }, |
1049 | 1049 | match_response => { |
1050 | | - status => qr/^200$/, |
| 1050 | + status => qr/^403$/, |
1051 | 1051 | }, |
1052 | 1052 | request => new HTTP::Request( |
1053 | 1053 | POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt", |
|
1067 | 1067 | }, |
1068 | 1068 | { |
1069 | 1069 | type => "config", |
1070 | | - comment => "SecRequestBodyLimitAction ProcessPartial (multipart/CRLF/partial/bad-header in part before limit #1)", |
| 1070 | + comment => "SecRequestBodyLimitAction ProcessPartial (multipart/CRLF/partial/bad-header in part before limit #3)", |
1071 | 1071 | conf => qq( |
1072 | 1072 | SecRuleEngine On |
1073 | 1073 | SecDebugLog $ENV{DEBUG_LOG} |
|
1103 | 1103 | }, |
1104 | 1104 | { |
1105 | 1105 | type => "config", |
1106 | | - comment => "SecRequestBodyLimitAction ProcessPartial (multipart/CRLF/partial/bad-header in part before limit #2)", |
| 1106 | + comment => "SecRequestBodyLimitAction ProcessPartial (multipart/CRLF/partial/bad-header in part before limit #4)", |
1107 | 1107 | conf => qq( |
1108 | 1108 | SecRuleEngine On |
1109 | 1109 | SecDebugLog $ENV{DEBUG_LOG} |
|
1139 | 1139 | }, |
1140 | 1140 | { |
1141 | 1141 | type => "config", |
1142 | | - comment => "SecRequestBodyLimitAction ProcessPartial (multipart/CRLF/partial/bad-header in part before limit #3)", |
| 1142 | + comment => "SecRequestBodyLimitAction ProcessPartial (multipart/CRLF/partial/bad-header in part before limit #5)", |
1143 | 1143 | conf => qq( |
1144 | 1144 | SecRuleEngine On |
1145 | 1145 | SecDebugLog $ENV{DEBUG_LOG} |
|
1190 | 1190 | debug => [ qr/Input filter: Bucket type HEAP contains 117 bytes./, 1], |
1191 | 1191 | }, |
1192 | 1192 | match_response => { |
1193 | | - status => qr/^200$/, |
| 1193 | + status => qr/^403$/, |
1194 | 1194 | }, |
1195 | 1195 | request => new HTTP::Request( |
1196 | 1196 | POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt", |
|
1260 | 1260 | debug => [ qr/Input filter: Bucket type HEAP contains 206 bytes./, 1], |
1261 | 1261 | }, |
1262 | 1262 | match_response => { |
1263 | | - status => qr/^200$/, |
| 1263 | + status => qr/^403$/, |
1264 | 1264 | }, |
1265 | 1265 | request => new HTTP::Request( |
1266 | 1266 | POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt", |
|
1325 | 1325 | }, |
1326 | 1326 | { |
1327 | 1327 | type => "config", |
1328 | | - comment => "SecRequestBodyLimitAction ProcessPartial (multipart/CRLF/partial/invalid final boundary before limit #1)", |
| 1328 | + comment => "SecRequestBodyLimitAction ProcessPartial (multipart/CRLF/partial/invalid boundary before limit #1)", |
1329 | 1329 | conf => qq( |
1330 | 1330 | SecRuleEngine On |
1331 | 1331 | SecDebugLog $ENV{DEBUG_LOG} |
|
1337 | 1337 | ), |
1338 | 1338 | match_log => { |
1339 | 1339 | debug => [ qr/Input filter: Bucket type HEAP contains 119 bytes./, 1], |
| 1340 | + error => [ qr/Multipart parsing error: Multipart: Invalid boundary./, 1], |
1340 | 1341 | }, |
1341 | 1342 | match_response => { |
1342 | 1343 | status => qr/^400$/, |
|
1353 | 1354 | Content-Type: text/plain |
1354 | 1355 |
|
1355 | 1356 | value |
1356 | | - --0000!), |
| 1357 | + --0000!) |
1357 | 1358 | ) . "X", |
1358 | 1359 | ), |
1359 | 1360 | }, |
1360 | 1361 | { |
1361 | 1362 | type => "config", |
1362 | | - comment => "SecRequestBodyLimitAction ProcessPartial (multipart/CRLF/partial/invalid final boundary before limit #2)", |
| 1363 | + comment => "SecRequestBodyLimitAction ProcessPartial (multipart/CRLF/partial/invalid boundary before limit #2)", |
1363 | 1364 | conf => qq( |
1364 | 1365 | SecRuleEngine On |
1365 | 1366 | SecDebugLog $ENV{DEBUG_LOG} |
|
1371 | 1372 | ), |
1372 | 1373 | match_log => { |
1373 | 1374 | debug => [ qr/Input filter: Bucket type HEAP contains 120 bytes./, 1], |
| 1375 | + error => [ qr/Multipart parsing error: Multipart: Invalid boundary./, 1], |
| 1376 | + }, |
| 1377 | + match_response => { |
| 1378 | + status => qr/^400$/, |
| 1379 | + }, |
| 1380 | + request => new HTTP::Request( |
| 1381 | + POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt", |
| 1382 | + [ |
| 1383 | + "Content-Type" => "multipart/form-data; boundary=0000", |
| 1384 | + ], |
| 1385 | + normalize_raw_request_data( |
| 1386 | + q( |
| 1387 | + --0000 |
| 1388 | + Content-Disposition: form-data; name="name1"; filename="name1.txt" |
| 1389 | + Content-Type: text/plain |
| 1390 | +
|
| 1391 | + value |
| 1392 | + --0000) |
| 1393 | + ) . "\r!" . "X", |
| 1394 | + ), |
| 1395 | +}, |
| 1396 | +{ |
| 1397 | + type => "config", |
| 1398 | + comment => "SecRequestBodyLimitAction ProcessPartial (multipart/CRLF/partial/invalid final boundary before limit #1)", |
| 1399 | + conf => qq( |
| 1400 | + SecRuleEngine On |
| 1401 | + SecDebugLog $ENV{DEBUG_LOG} |
| 1402 | + SecDebugLogLevel 9 |
| 1403 | + SecRequestBodyAccess On |
| 1404 | + SecRequestBodyLimitAction ProcessPartial |
| 1405 | + SecRequestBodyLimit 119 |
| 1406 | + SecRule REQBODY_ERROR "!\@eq 0" "id:'200001', phase:2,t:none,log,deny,status:400,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}',severity:2" |
| 1407 | + ), |
| 1408 | + match_log => { |
| 1409 | + debug => [ qr/Input filter: Bucket type HEAP contains 120 bytes./, 1], |
| 1410 | + error => [ qr/Multipart parsing error: Multipart: Invalid final boundary./, 1], |
1374 | 1411 | }, |
1375 | 1412 | match_response => { |
1376 | 1413 | status => qr/^400$/, |
|
1427 | 1464 | }, |
1428 | 1465 | { |
1429 | 1466 | type => "config", |
1430 | | - comment => "SecRequestBodyLimitAction ProcessPartial (multipart/LF/partial/bad-header in part across limit #2)", |
| 1467 | + comment => "SecRequestBodyLimitAction ProcessPartial (multipart/LF/partial/bad-header in part before limit #1)", |
1431 | 1468 | conf => qq( |
1432 | 1469 | SecRuleEngine On |
1433 | 1470 | SecDebugLog $ENV{DEBUG_LOG} |
|
1442 | 1479 | debug => [ qr/Input filter: Bucket type HEAP contains 111 bytes./, 1], |
1443 | 1480 | }, |
1444 | 1481 | match_response => { |
1445 | | - status => qr/^200$/, |
| 1482 | + status => qr/^403$/, |
1446 | 1483 | }, |
1447 | 1484 | request => new HTTP::Request( |
1448 | 1485 | POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt", |
|
1461 | 1498 | }, |
1462 | 1499 | { |
1463 | 1500 | type => "config", |
1464 | | - comment => "SecRequestBodyLimitAction ProcessPartial (multipart/LF/parital/bad-header in part before limit #1)", |
| 1501 | + comment => "SecRequestBodyLimitAction ProcessPartial (multipart/LF/parital/bad-header in part before limit #2)", |
1465 | 1502 | conf => qq( |
1466 | 1503 | SecRuleEngine On |
1467 | 1504 | SecDebugLog $ENV{DEBUG_LOG} |
|
1495 | 1532 | }, |
1496 | 1533 | { |
1497 | 1534 | type => "config", |
1498 | | - comment => "SecRequestBodyLimitAction ProcessPartial (multipart/LF/parital/bad-header in part before limit #2)", |
| 1535 | + comment => "SecRequestBodyLimitAction ProcessPartial (multipart/LF/parital/bad-header in part before limit #3)", |
1499 | 1536 | conf => qq( |
1500 | 1537 | SecRuleEngine On |
1501 | 1538 | SecDebugLog $ENV{DEBUG_LOG} |
|
1530 | 1567 | }, |
1531 | 1568 | { |
1532 | 1569 | type => "config", |
1533 | | - comment => "SecRequestBodyLimitAction ProcessPartial (multipart/LF/parital/bad-header in part before limit #3)", |
| 1570 | + comment => "SecRequestBodyLimitAction ProcessPartial (multipart/LF/parital/bad-header in part before limit #4)", |
1534 | 1571 | conf => qq( |
1535 | 1572 | SecRuleEngine On |
1536 | 1573 | SecDebugLog $ENV{DEBUG_LOG} |
|
1580 | 1617 | debug => [ qr/Input filter: Bucket type HEAP contains 112 bytes./, 1], |
1581 | 1618 | }, |
1582 | 1619 | match_response => { |
1583 | | - status => qr/^200$/, |
| 1620 | + status => qr/^403$/, |
1584 | 1621 | }, |
1585 | 1622 | request => new HTTP::Request( |
1586 | 1623 | POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt", |
|
1648 | 1685 | debug => [ qr/Input filter: Bucket type HEAP contains 196 bytes./, 1], |
1649 | 1686 | }, |
1650 | 1687 | match_response => { |
1651 | | - status => qr/^200$/, |
| 1688 | + status => qr/^403$/, |
1652 | 1689 | }, |
1653 | 1690 | request => new HTTP::Request( |
1654 | 1691 | POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt", |
|
1711 | 1748 | }, |
1712 | 1749 | { |
1713 | 1750 | type => "config", |
1714 | | - comment => "SecRequestBodyLimitAction ProcessPartial (multipart/LF/partial/invalid final boundary before limit #1)", |
| 1751 | + comment => "SecRequestBodyLimitAction ProcessPartial (multipart/LF/partial/invalid boundary before limit #1)", |
1715 | 1752 | conf => qq( |
1716 | 1753 | SecRuleEngine On |
1717 | 1754 | SecDebugLog $ENV{DEBUG_LOG} |
|
1723 | 1760 | ), |
1724 | 1761 | match_log => { |
1725 | 1762 | debug => [ qr/Input filter: Bucket type HEAP contains 114 bytes./, 1], |
| 1763 | + error => [ qr/Multipart parsing error: Multipart: Invalid boundary./, 1], |
1726 | 1764 | }, |
1727 | 1765 | match_response => { |
1728 | 1766 | status => qr/^400$/, |
|
1744 | 1782 | }, |
1745 | 1783 | { |
1746 | 1784 | type => "config", |
1747 | | - comment => "SecRequestBodyLimitAction ProcessPartial (multipart/LF/partial/invalid final boundary before limit #2)", |
| 1785 | + comment => "SecRequestBodyLimitAction ProcessPartial (multipart/LF/partial/invalid final boundary before limit #1)", |
1748 | 1786 | conf => qq( |
1749 | 1787 | SecRuleEngine On |
1750 | 1788 | SecDebugLog $ENV{DEBUG_LOG} |
|
1756 | 1794 | ), |
1757 | 1795 | match_log => { |
1758 | 1796 | debug => [ qr/Input filter: Bucket type HEAP contains 115 bytes./, 1], |
| 1797 | + error => [ qr/Multipart parsing error: Multipart: Invalid final boundary./, 1], |
1759 | 1798 | }, |
1760 | 1799 | match_response => { |
1761 | 1800 | status => qr/^400$/, |
|
0 commit comments