charset=euc-kr > 그누4 질문답변

그누4 질문답변

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

charset=euc-kr 정보

charset=euc-kr

본문

// 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]">
으로 바꿔버리면 안되나요?
취약점 대비코드라 되있어서 좀 불안한감이 있내요 ㅠㅠ'
  • 복사

댓글 전체

© SIRSOFT
현재 페이지 제일 처음으로