(원본)
bbs/new.php
https://github.com/gnuboard/gnuboard5/commit/d5b7dd165db0abd9d0fcf0b590ca4edc52db1b7f
$gr_id = isset($_GET['gr_id']) ? substr(preg_replace('#[^a-z0-9_]#i', '', $_GET['gr_id']), 0, 10) : '';
(수정본)
common.php에서, 모든 $gr_id를 마스킹 해버립니다.
$gr_id는 함부로 쓰면 안되는 시스템 변수이니까요.
아래는 PDO를 이용해서 $group을 가져 오는 것이랍니다.
인젝션이 안되요.ㅋ...
불당팩에는 오래전에 들어가 있는 코드 입니다.
// adm/board_list.php에서 gr_id를 배열로 쓰기 때문에, is_array를 체크해야 합니다. =..=...
if (isset($gr_id) && !is_array($gr_id)) {
$gr_id = preg_match("/^[a-zA-Z0-9_]+$/", $gr_id) ? $gr_id : "";
$stmt = $pdo_db->prepare(" select * from {$g4['group_table']} where gr_id = :gr_id ");
$stmt->bindParam(":gr_id", $gr_id);
$group = pdo_fetch($stmt);
}
- opencode.co.kr -