https://blog.naver.com/kamagod/150171082356
Execution error - PCRE limits exceeded (-8): (null).
작성자 : kamagod 작성일 : 2013년 07월 02일 OS : CentOS 5.8 64Bit MODSECURITY...
blog.naver.com
Modsecurity Execution error - PCRE limits exceeded (-47) - CloudLinux Community Forum
Hi, We're occasionally seeing the following errors in the Apache error_log: [Wed Dec 03 11:32:52.775133 2025] [security2:error] [pid 2737351:tid 2737351] [client 186.22.19.226:0] ModSecurity: Rule 563f521ffeb8 [id "-"][file "/etc/apache2/conf.d/modsec_vend
forum.cloudlinux.com
https://github.com/SpiderLabs/owasp-modsecurity-crs/issues/656
[line "768"] - Execution error - PCRE limits exceeded (-8): (null). · Issue #656 · SpiderLabs/owasp-modsecurity-crs
--768ec544-B-- POST /xmlrpc.php?for=jetpack&token=xxxxxxxxHTTP/1.1 Host: xxxxxx User-Agent: Jetpack by WordPress.com Accept: */* Accept-Encoding: deflate, gzip Referer: xxxx Connection: close Conte...
github.com
해당 로그를 해결하기 위해서는 아래의 두 가지 옵션의 값을 조정해야 한다.
SecPcreMatchLimit
SecPcreMatchLimitRecursion
PCRE match limit은 정규표현식을 가지고 Dos 공격 취약성을 낮추기 위한 용도이다.
이 값은 default값이 괴~~엥장히 낮게 잡혀있다.
그래서 이 값을 높이는 것은 Dos 공격에 대한 취약성을 높이는 결과를 낳을 것이다.
하지만 PCRE Error이 발생하는 것이 Dos 공격보다 안좋게 여겨질 수 있다.
따라서 이 값을 조정하는 것이 바람직할 수도 있다.
JBCS 에서는 ${JBCS_HOME}/conf.d/modsecurity.conf 내에서 튜닝하면 된다.
default는 1000 으로 적혀있다.
SecPcreMatchLimit 1000
SecPcreMatchLimitRecursion 1000
아래의 내용은 GPT가 말하는 거라, 완전한 정답 같진 않으니 참고용으로 알고 있자.
🛠 해결 방법 (실무용)
문제 regex 수정 (근본 해결 ⭐)
- .* 남발 금지
- nested 반복 (a+)+ 제거
- 가능하면 lazy (.*?) 사용
만일 modsecurity에 대한 담당자가 따로 있다면, WEB 단계가 아닌 다른 방안을 찾아보는 것도 방법일 거 같다.
'WEB-SERVER > OHS & JBCS & Apache' 카테고리의 다른 글
| [JBCS 2.4.62] 일반 OS 유저가 1024 이하 Port 사용하는 방법 (0) | 2026.05.13 |
|---|---|
| [JBCS] Apache rotatelogs 설정(CustomLog 예시) (0) | 2026.04.27 |
| [Apache/JBCS] SSL인증서 암호 제거 및 Password 자동 입력 방법 (0) | 2026.04.14 |
| mod_proxy(적용) (0) | 2026.04.14 |
| mod_proxy(이론) (1) | 2026.04.14 |