보안취약점 개선

This commit is contained in:
KNKIM 2021-12-01 14:18:48 +09:00
parent 8bfa4113d6
commit 0ac722ad9c
7 changed files with 38 additions and 34 deletions

View File

@ -268,11 +268,11 @@ public class QnaController extends NlibCommonController {
}); });
} catch (JsonMappingException e) { } catch (JsonMappingException e) {
// TODO Auto-generated catch block log.error("insertQna Json 변환 처리 오류 JsonMappingException : " + e.toString());
e.printStackTrace();
} catch (JsonProcessingException e) { } catch (JsonProcessingException e) {
// TODO Auto-generated catch block log.error("insertQna Json 변환 처리 오류 JsonProcessingException : " + e.toString());
e.printStackTrace();
} }
if(fileListObj != null && fileListObj.size() > 0) { if(fileListObj != null && fileListObj.size() > 0) {
@ -379,11 +379,11 @@ public class QnaController extends NlibCommonController {
}); });
} catch (JsonMappingException e) { } catch (JsonMappingException e) {
// TODO Auto-generated catch block log.error("updateQnaArticle Json 변환 처리 오류 JsonMappingException : " + e.toString());
e.printStackTrace();
} catch (JsonProcessingException e) { } catch (JsonProcessingException e) {
// TODO Auto-generated catch block log.error("updateQnaArticle Json 변환 처리 오류 JsonProcessingException : " + e.toString());
e.printStackTrace();
} }
if(fileListObj != null && fileListObj.size() > 0) { if(fileListObj != null && fileListObj.size() > 0) {
@ -440,11 +440,11 @@ public class QnaController extends NlibCommonController {
}); });
} catch (JsonMappingException e) { } catch (JsonMappingException e) {
// TODO Auto-generated catch block log.error("updateQnaArticle Json 변환 처리 오류 JsonMappingException : " + e.toString());
e.printStackTrace();
} catch (JsonProcessingException e) { } catch (JsonProcessingException e) {
// TODO Auto-generated catch block log.error("updateQnaArticle Json 변환 처리 오류 JsonProcessingException : " + e.toString());
e.printStackTrace();
} }
if(removedFileListObj != null && removedFileListObj.size() > 0) { if(removedFileListObj != null && removedFileListObj.size() > 0) {
@ -472,7 +472,7 @@ public class QnaController extends NlibCommonController {
int fileSn = 0; int fileSn = 0;
try { try {
fileSn = Integer.parseInt(fileSnStr); fileSn = Integer.parseInt(fileSnStr);
}catch(Exception e) { }catch(NumberFormatException e) {
log.error("삭제할 파일순번 정보 오류입니다. : " + fileSnStr + " OF " + (String)remFinfo.get("streFileNm")); log.error("삭제할 파일순번 정보 오류입니다. : " + fileSnStr + " OF " + (String)remFinfo.get("streFileNm"));
continue; continue;
} }

View File

@ -52,12 +52,8 @@ public class NlibPasswordEncoder implements PasswordEncoder { /* extends EgovPa
return egovPasswordEncoder.encryptPassword(rawPassword.toString()); return egovPasswordEncoder.encryptPassword(rawPassword.toString());
} }
/* 입력된 비밀번호가 일치하는 확인한다. /*
* - rawPassword : 입력된 비밀번호로 암호화되지 않은 비밀번호 * 입력된 비밀번호가 일치하는 확인한다.
* - encodedPassword : 암호화된 비밀번호 (사용자DB에서 읽어온 )
*
* (non-Javadoc)
* @see org.springframework.security.crypto.password.PasswordEncoder#matches(java.lang.CharSequence, java.lang.String)
*/ */
@Override @Override
public boolean matches(CharSequence rawPassword, String encodedPassword) { public boolean matches(CharSequence rawPassword, String encodedPassword) {

View File

@ -2,17 +2,17 @@ package nlib.cmm.fileupload;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.OutputStream; import java.io.OutputStream;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Map; import java.util.Map;
import javax.activation.MimetypesFileTypeMap; import javax.activation.MimetypesFileTypeMap;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Component; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.FileCopyUtils; import org.springframework.util.FileCopyUtils;
import org.springframework.web.servlet.view.AbstractView; import org.springframework.web.servlet.view.AbstractView;
@ -40,6 +40,8 @@ import org.springframework.web.servlet.view.AbstractView;
*/ */
public class DownloadView extends AbstractView { public class DownloadView extends AbstractView {
private static final Logger log = LoggerFactory.getLogger(DownloadView.class);
@Override @Override
protected void renderMergedOutputModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception { protected void renderMergedOutputModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception {
@ -82,8 +84,8 @@ public class DownloadView extends AbstractView {
{ {
FileCopyUtils.copy(fis, out); FileCopyUtils.copy(fis, out);
out.flush(); out.flush();
} catch (Exception e) { } catch (FileNotFoundException e) {
e.printStackTrace(); log.error("renderMergedOutputModel FileNotFoundException ERROR : " + e.toString());
} }
} }
} }

View File

@ -1,6 +1,7 @@
package nlib.cmm.fileupload; package nlib.cmm.fileupload;
import java.io.File; import java.io.File;
import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
@ -29,7 +30,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import nlib.bbs.service.AttachFileService; import nlib.bbs.service.AttachFileService;
import nlib.bbs.service.AttachFileVO; import nlib.bbs.service.AttachFileVO;
import nlib.bbs.service.QnaService;
import nlib.cmm.NlibCommonController; import nlib.cmm.NlibCommonController;
import nlib.cmm.exception.ErrorMessage; import nlib.cmm.exception.ErrorMessage;
import nlib.cmm.service.NlibProperty; import nlib.cmm.service.NlibProperty;
@ -198,9 +198,17 @@ public class FileUploadController extends NlibCommonController {
result.add(atvo); result.add(atvo);
} }
} }
} catch(Exception e) { } catch(SecurityException e) {
ErrorMessage errorMessage = new ErrorMessage("ERROR", "처리에 실패하였습니다 : " + e.toString()); log.error("uploadFilesAjax SecurityException : " + e.toString());
e.printStackTrace(); ErrorMessage errorMessage = new ErrorMessage("ERROR", "처리에 실패하였습니다(1)");
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(errorMessage);
} catch(IllegalStateException e) {
log.error("uploadFilesAjax IllegalStateException : " + e.toString());
ErrorMessage errorMessage = new ErrorMessage("ERROR", "처리에 실패하였습니다(1)");
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(errorMessage);
} catch(IOException e) {
log.error("uploadFilesAjax IOException : " + e.toString());
ErrorMessage errorMessage = new ErrorMessage("ERROR", "처리에 실패하였습니다(1)");
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(errorMessage); return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(errorMessage);
} }
@ -212,7 +220,7 @@ public class FileUploadController extends NlibCommonController {
log.debug("RETURN DATA > json:" + json); log.debug("RETURN DATA > json:" + json);
} catch (JsonProcessingException e) { } catch (JsonProcessingException e) {
json = null; json = null;
e.printStackTrace(); log.error("uploadFilesAjax Error : " + e.toString());
ErrorMessage errorMessage = new ErrorMessage("ERROR", "JSON 변환 처리에 실패하였습니다 : " + e.toString()); ErrorMessage errorMessage = new ErrorMessage("ERROR", "JSON 변환 처리에 실패하였습니다 : " + e.toString());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(errorMessage); return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(errorMessage);
} }

View File

@ -173,8 +173,6 @@ public class RentServiceImpl implements RentService
cVO.setRsrvId(resVO.getInfoItem("rsrvId", "")); cVO.setRsrvId(resVO.getInfoItem("rsrvId", ""));
cVO.setRsrvDd(StringUtil.formatDateStr(resVO.getInfoItem("rsrvDd", ""), "")); cVO.setRsrvDd(StringUtil.formatDateStr(resVO.getInfoItem("rsrvDd", ""), ""));
cVO.setRsrvDivCd(resVO.getInfoItem("rsrvDivCd")); // 대출상태구분코드 cVO.setRsrvDivCd(resVO.getInfoItem("rsrvDivCd")); // 대출상태구분코드
if("1".equals(cVO.getRsrvDivCd())) cVO.setRsrvDivNm("대출신청");
else if("2".equals(cVO.getRsrvDivCd())) cVO.setRsrvDivNm("대출예약");
// 카트에서의 처리 여부 업데이트 // 카트에서의 처리 여부 업데이트
if(fromCart) { if(fromCart) {

View File

@ -142,9 +142,9 @@ public class XmlConverter {
} // while } // while
} catch (XMLStreamException e) { } catch (XMLStreamException e) {
e.printStackTrace(); log.error("getElementValue Error : " + e.toString());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); log.error("getElementValue Error : " + e.toString());
} }
return retMap; return retMap;

View File

@ -221,7 +221,7 @@ $(document).ready(function() {
</div> </div>
<div class="t-state"><p>${rent.useStatusNm }</p></div> <div class="t-state"><p>${rent.useStatusNm }</p></div>
<div class="t-date">${rent.rtnExpctDd }</div> <div class="t-date">${rent.rtnExpctDd }</div>
<div class="t-reser poss">${rent.bookLtRvStatusNm } <div class="t-reser poss">${rent.rsrvDivNm }
<c:if test='${not empty rent.rsrvDd }'> <c:if test='${not empty rent.rsrvDd }'>
(${rent.rsrvDd }) (${rent.rsrvDd })
</c:if> </c:if>