MySQL Injection을 예방하기 위해 $bo_table을 사용하세요~


2018-10-20 02:01
25,398
1
2
본문
앞선 글에 덧붙여 MySQL Query문을 조금만 변경하면 더 완벽할 것 같습니다. ^ ^;;
MySQL Injection을 예방하기 위해 /common.php에서 Query String으로 입력된 $bo_table 값을 trim을 이용하여 Strip하고 정상적인 알파벳, 숫자 및 Underscore(_)를 제외한 나머지 모든 문자열을 치환한 $bo_table을 사용하는 것으로 바꿀 것을 강력히 권장합니다. 그누보드에서 이미 잘 만들어 둔 구조를 무너뜨릴 뻔 하였습니다.
$bo_table = preg_replace('/[^a-z0-9_]/i', '', trim($_REQUEST['bo_table']));
FROM:
WHERE bid.bo_table = '".$_REQUEST['bo_table']."';";
TO:
WHERE bid.bo_table = '".$bo_table."';";
반드시 꼭 변경하시기 바랍니다. {이모티콘:rabbit_38}


포인트 210
경험치 989
[레벨 3] - 진행률
65%
가입일
2018-10-16 07:26:31
서명
미입력
자기소개
Web Application Programmer with PHP and ASP
- CodeIgniter, Laravel, Joomla, WordPress
- ASP/C# .NET, .NET Core
최신글이 없습니다.
최신글이 없습니다.
댓글목록1
zeussis님의 댓글
축하합니다. 첫댓글 포인트 39포인트를 획득하였습니다.