티스토리 뷰

개발/보안

Apache Tomcat Directory Traversal Vulnerability

개발자와코더사이가 PM일까? 2018. 3. 25. 18:37
반응형

만약 위의 단어 때문에 저의 블로그에 왔다면..가슴이 아주 아픕니다.

그런 이유는 아마도 당신 사용하는 톰캣 버전이 낮아서 올 가능성이 높기 때문입니다. 

위의 보안 취약점을 해결 하려고 한다면 크게 두 가지 방법이 있습니다.

1. server.xml파일에서 URIEncoding을 utf-8를 사용하지 않는다.

<Connector port="9091" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="9443" acceptCount="100" debug="0" connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="utf-8"/>

2. 톰캣 버전을 5.5.27 이상으로 업데이트한다.


하지만.. 2018년도 새롭게 도입된 프로젝트라면 그 누구도 톰캣 버전을 5.0 대를 쓰지 않을 것이고 또한 자바의 jdk1.4때를 쓰지 않겠죠.


그러면 어떻게 해야 위의 보안 취약점을 해결할 수 있을까요? 

제일 먼저, 더 이상 당신의 솔류션이 기반이 너무 옛날이기 때문에 위의 보안 취약점을 해결할 수 없다고 최대한 해당 사이트 담당자를 설득 시켜야 합니다. 

만약 해당 사이트 담당자가 어떻게든 무조건 해결 해 달라고 한다면... 특정 파일만 보지 못하도록 하자고 조건을 붙이죠. 여기까지 설득을 했다면 당신은 어느 정도 성공했습니다. 그러면 보안 취약점이 되었던 파일을 분석하고 특정파일 확장자가 못 들어오도록 tomcat의 security-constraint 태그에 대해서 공부해서 아래와 같이 막아 봅시다. 해당 파일은 WebRoot/WEB-INF/web.xml에 설정 하시면 됩니다.

거의 두 달 동안 저의 머리를 아프게 했던 사이트에 대해서 위의 방향으로 해결했습니다. 


예전부터 영문으로 블로그를 쓰고 싶었는데.. 아래는 구글번역으로 번역해서 올려 봅니다.  세계는 하나이니깐요. ㅎㅎ


If I came to my blog because of the above words .. my heart is very sore.

That's probably because your version of Tomcat is likely to come up low.


There are two main ways to address the above security vulnerabilities.

1) Do not use URIEncoding utf-8 in the server.xml file.

<Connector port="9091" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="9443" acceptCount="100" debug="0" connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="utf-8"/>

2) Update Tomcat version to 5.5.27 or later.


But, if it's a new project introduced in 2018, nobody will use Tomcat version 5.0 and will not use Java's jdk1.4.

So how do you solve the above security vulnerabilities?

First of all, you should explain to your security officer that your site is no longer able to address the above security vulnerabilities because the infrastructure is too old.

If the person in charge of the site asks me to solve it somehow ... I condition that I do not want to see a specific file. If you persuaded to this point, you have succeeded to some extent. 

Let's analyze tomcat's security-constraint tags so that they are not vulnerable to specific file extensions. You can set the file in WebRoot / WEB-INF / web.xml.

I have resolved the above directions for sites that have hurt my head for almost two months.

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함