- 메시지 템플릿 등록/수정 시 XSS 필터만 적용하도록 수정 - 문자 변환 건너뛰는 조건에 특정 경로 및 cmd 추가
This commit is contained in:
@@ -158,7 +158,7 @@ class RequestWrapper extends HttpServletRequestWrapper {
|
|||||||
// src 속성 화이트리스트 필터링 - 허용된 프로토콜만 통과
|
// src 속성 화이트리스트 필터링 - 허용된 프로토콜만 통과
|
||||||
value = filterSrcAttribute(value);
|
value = filterSrcAttribute(value);
|
||||||
|
|
||||||
// 리치 텍스트 파라미터는 문자 변환을 건너뛰고 XSS 패턴 필터링만 적용
|
// 리치 텍스트 파라미터와 메시지 템플릿 저장 요청은 문자 변환 없이 XSS 패턴 필터링만 적용
|
||||||
if (!shouldSkipCharConvert()) {
|
if (!shouldSkipCharConvert()) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
value = convertChars(value, sb);
|
value = convertChars(value, sb);
|
||||||
@@ -179,6 +179,15 @@ class RequestWrapper extends HttpServletRequestWrapper {
|
|||||||
if (param == null) {
|
if (param == null) {
|
||||||
return false;
|
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) {
|
for (String skipParam : SKIP_CHAR_CONVERT_PARAMS) {
|
||||||
if (StringUtils.equalsIgnoreCase(param, skipParam)) {
|
if (StringUtils.equalsIgnoreCase(param, skipParam)) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user