천

charset=euc-kr

· 2010-04-08 (목) 01:27:08 · 1748
// index.php 가 있는곳의 상대경로
// php 인젝션 ( 임의로 변수조작으로 인한 리모트공격) 취약점에 대비한 코드
// prosper 님께서 알려주셨습니다.
if (!$g4_path || preg_match("/:\/\//", $g4_path))
die("<meta http-equiv='content-type' content='text/html; charset=$g4[charset]'><script language='JavaScript'> alert('잘못된 방법으로 변수가 정의되었습니다.'); </script>");
//if (!$g4_path) $g4_path = ".";
$g4['path'] = $g4_path;

일부페이지에서 외계어로 나타나는 현상이 발생해
<meta http-equiv="content-type" content="text/html; charset=euc-kr"> 를 넣어줫더니
정상적으로 나타났습니다;;

근대 생각해보니;;common.php 에서 정의를 왜안해주는가에요 ;;

보니까 조건이 붙어있는대요;;
if (!$g4_path || preg_match("/:\/\//", $g4_path))
die("<meta http-equiv='content-type' content='text/html; charset=$g4[charset]'><script language='JavaScript'> alert('잘못된 방법으로 변수가 정의되었습니다.'); </script>");

이걸
<meta http-equiv="content-type" content="text/html; charset=$g4[charset]">
으로 바꿔버리면 안되나요?
취약점 대비코드라 되있어서 좀 불안한감이 있내요 ㅠㅠ'
댓글을 작성하시려면 로그인이 필요합니다.

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
10-04-08 조회 1,585
10-04-08 조회 1,184
10-04-08 조회 1,386
10-04-08 조회 1,862
10-04-08 조회 1,491
10-04-08 조회 1,749
10-04-07 조회 1,814
10-04-07 조회 2,096
10-04-07 조회 1,766
10-04-07 조회 1,605
10-04-07 조회 1,451
10-04-07 조회 1,846
10-04-07 조회 1,165
10-04-07 조회 1,597
10-04-07 조회 1,588
10-04-07 조회 1,612
10-04-07 조회 1,613
10-04-07 조회 1,598
10-04-07 조회 1,591
10-04-07 조회 1,309