[중요]PHP BUG - preg_match() full path disclosure
인터넷을 검색하다 preg_match vulnerability 문제를 언급하는 글이 올라와 읽어보았습니다.
요지는 preg_match함수는 두번째 변수값으로 스트링을 입력받는데 변수에 array를 넣으면 warning이 발생하는데 이 때 스크립트의 full path값이 주어집니다.
스크립트의 full path값이 주어진다면 해커에게는 큰 도움이 되겠죠? 가령 예를 들어 어떤 호스팅 업체는 다음과 같은 경로를 제공합니다: /public/letsgolee/html/gnuboard
이런경우 나의 계정은 letsgolee이며 또한 이 값이 ftp의 username이 되는 경우가 허다합니다.
ftp에서 username을 알았다면 password값을 알아내는 것은 시간문제입니다. 프로그램을 돌려 계속 접속해서 비번을 알아내면 됩니다.
다음은 버그 관련 글입니다: http://bugs.php.net/bug.php?id=49693
그럼 그누보드와 관련된 예제는 코멘트로 달아놓겠습니다.
요지는 preg_match함수는 두번째 변수값으로 스트링을 입력받는데 변수에 array를 넣으면 warning이 발생하는데 이 때 스크립트의 full path값이 주어집니다.
스크립트의 full path값이 주어진다면 해커에게는 큰 도움이 되겠죠? 가령 예를 들어 어떤 호스팅 업체는 다음과 같은 경로를 제공합니다: /public/letsgolee/html/gnuboard
이런경우 나의 계정은 letsgolee이며 또한 이 값이 ftp의 username이 되는 경우가 허다합니다.
ftp에서 username을 알았다면 password값을 알아내는 것은 시간문제입니다. 프로그램을 돌려 계속 접속해서 비번을 알아내면 됩니다.
다음은 버그 관련 글입니다: http://bugs.php.net/bug.php?id=49693
그럼 그누보드와 관련된 예제는 코멘트로 달아놓겠습니다.
|
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기
댓글 2개
http://sir.co.kr/?sod[0]=1&sod[1]=2
다음의 warning이 나타납니다:
Warning: preg_match() expects parameter 2 to be string, array given in /home/v14/common.php on line 258
Warning: Cannot modify header information - headers already sent by (output started at /home/v14/common.php:258) in /home/v14/head.sub.php on line 32
Warning: Cannot modify header information - headers already sent by (output started at /home/v14/common.php:258) in /home/v14/head.sub.php on line 35
Warning: Cannot modify header information - headers already sent by (output started at /home/v14/common.php:258) in /home/v14/head.sub.php on line 36
Warning: Cannot modify header information - headers already sent by (output started at /home/v14/common.php:258) in /home/v14/head.sub.php on line 38
Warning: Cannot modify header information - headers already sent by (output started at /home/v14/common.php:258) in /home/v14/head.sub.php on line 39
Warning: Cannot modify header information - headers already sent by (output started at /home/v14/common.php:258) in /home/v14/head.sub.php on line 40
그누보드는 /home/v14에 그누보드가 들어있군요...
이게 php 5.3이하에서 다 그런다는데...
비밀번호만 알면 패스워드를 알아내는게 쉽다는건 아니지 않나요?
그리고 절대경로가 패스워드보다도 쉽게 유추 가능할 텐데요...
결론적으로는 위 함수에다가 @ 에러억제연산자만 추가하면 된다는거죵?^^