리치 텍스트 파라미터 처리 조건 추가
eapim-admin CI / build (push) Has been cancelled

- 메시지 템플릿 등록/수정 시 XSS 필터만 적용하도록 수정
- 문자 변환 건너뛰는 조건에 특정 경로 및 cmd 추가
This commit is contained in:
Rinjae
2026-09-09 09:52:47 +09:00
parent a235b0656c
commit 145ad37499
@@ -158,7 +158,7 @@ class RequestWrapper extends HttpServletRequestWrapper {
// src 속성 화이트리스트 필터링 - 허용된 프로토콜만 통과
value = filterSrcAttribute(value);
// 리치 텍스트 파라미터는 문자 변환을 건너뛰고 XSS 패턴 필터링만 적용
// 리치 텍스트 파라미터와 메시지 템플릿 저장 요청은 문자 변환 없이 XSS 패턴 필터링만 적용
if (!shouldSkipCharConvert()) {
StringBuilder sb = new StringBuilder();
value = convertChars(value, sb);
@@ -179,6 +179,15 @@ class RequestWrapper extends HttpServletRequestWrapper {
if (param == null) {
return false;
}
// 상세 화면은 .view로 열리지만 등록/수정 데이터는 .json으로 POST됨.
// 문자 발송에 사용되는 입력값이 HTML 엔티티로 저장되지 않도록 함.
if ("POST".equalsIgnoreCase(getMethod())
&& "/onl/apim/template/messageTemplateMan.json".equals(getServletPath())) {
String cmd = super.getParameter("cmd");
if ("INSERT".equals(cmd) || "UPDATE".equals(cmd)) {
return true;
}
}
for (String skipParam : SKIP_CHAR_CONVERT_PARAMS) {
if (StringUtils.equalsIgnoreCase(param, skipParam)) {
return true;