From d2fdb44888c9f600e6d26c317e152cb1e40b748a Mon Sep 17 00:00:00 2001 From: cms42 Date: Sat, 13 May 2023 01:51:58 +0800 Subject: [PATCH 1/5] fix a potential Path Traversal Injection --- public/download.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/download.php b/public/download.php index 6690bdcee..f2a9c3494 100644 --- a/public/download.php +++ b/public/download.php @@ -40,7 +40,7 @@ function denyDownload() $oldip = $user['ip']; $user['ip'] = getip(); $CURUSER = $user; - $id = $_REQUEST['id']; + $id = (int)$_REQUEST['id']; } else { $id = (int)$_GET["id"]; if (!$id) From f1a7b3f128ddedf6d4c5bb4f876ecd2b15340c4b Mon Sep 17 00:00:00 2001 From: cms42 Date: Sat, 13 May 2023 02:27:51 +0800 Subject: [PATCH 2/5] fix potential Command Injection --- public/take-increment-bulk.php | 1 + 1 file changed, 1 insertion(+) diff --git a/public/take-increment-bulk.php b/public/take-increment-bulk.php index c339258e9..5e5f3394d 100644 --- a/public/take-increment-bulk.php +++ b/public/take-increment-bulk.php @@ -38,6 +38,7 @@ if (empty($conditions)) { stderr("Error","No valid filter"); } +$_POST['duration'] = (int)$_POST['duration']; if ($isTypeTmpInvite && (empty($_POST['duration']) || $_POST['duration'] < 1)) { stderr("Error","Invalid duration"); } From fb9406be489020b0f44315d52ca91a88f4bd53ba Mon Sep 17 00:00:00 2001 From: cms42 Date: Sun, 14 May 2023 22:36:57 +0800 Subject: [PATCH 3/5] Handle user input in a more robust way --- public/login.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/login.php b/public/login.php index 5b6e56b98..2080593b4 100644 --- a/public/login.php +++ b/public/login.php @@ -32,7 +32,7 @@ } $s .= "\n"; ?> -
+ ".$lang_login['text_select_lang']. $s . ""); From c6f23f514cbd3e5bcb2e4f24c546367b3bfcf582 Mon Sep 17 00:00:00 2001 From: cms42 Date: Mon, 15 May 2023 11:25:18 +0800 Subject: [PATCH 4/5] added rel="noopener" for safe reason --- include/functions.php | 4 ++-- lang/chs/lang_complains.php | 2 +- lang/chs/lang_mybonus.php | 2 +- lang/chs/lang_settings.php | 2 +- lang/cht/lang_complains.php | 2 +- lang/cht/lang_mybonus.php | 2 +- lang/cht/lang_settings.php | 2 +- lang/en/lang_complains.php | 2 +- lang/en/lang_settings.php | 2 +- nexus/Install/install/install.php | 2 +- nexus/Install/settings.default.php | 2 +- nexus/Install/update/update.php | 2 +- nexus/PTGen/PTGen.php | 2 +- public/aboutnexus.php | 2 +- public/complains.php | 6 +++--- public/downloadnotice.php | 16 ++++++++-------- public/index.php | 2 +- public/invite.php | 2 +- public/promotionlink.php | 4 ++-- public/recover.php | 2 +- public/usercp.php | 2 +- public/userdetails.php | 6 +++--- .../jquery.datetimepicker.full.min.js | 2 +- public/vendor/layer-v3.5.1/test.html | 4 ++-- public/vendor/layui/layui.js | 2 +- 25 files changed, 39 insertions(+), 39 deletions(-) diff --git a/include/functions.php b/include/functions.php index b48eff8ad..17019f27e 100644 --- a/include/functions.php +++ b/include/functions.php @@ -2668,7 +2668,7 @@ function stdhead($title = "", $msgalert = true, $script = "", $place = "") '.$lang_functions['text_attended'].'', $attendance->points, $CURUSER['attendance_card']); }else{ printf(' %s', $lang_functions['text_attendance']);}?> [] []: where('inviter', $CURUSER['id'])->where('invitee', '')->where('expired_at', '>', now())->count())?> - = \App\Models\User::CLASS_ADMINISTRATOR) printf('[%s]', nexus_env('FILAMENT_PATH', 'nexusphp'), $lang_functions['text_management_system'])?> + = \App\Models\User::CLASS_ADMINISTRATOR) printf('[%s]', nexus_env('FILAMENT_PATH', 'nexusphp'), $lang_functions['text_management_system'])?>
@@ -6410,7 +6410,7 @@ function torrent_name_for_admin(\App\Models\Torrent|null $torrent, $withTags = f return ''; } $name = sprintf( - '', + '', $torrent->id, $torrent->name, Str::limit($torrent->name, $length) ); $tags = ''; diff --git a/lang/chs/lang_complains.php b/lang/chs/lang_complains.php index 8df7f2389..64c5e42dc 100644 --- a/lang/chs/lang_complains.php +++ b/lang/chs/lang_complains.php @@ -28,5 +28,5 @@ 'no_complaints_have_been_processed' => '暂无已处理的申诉', 'text_view_band_log' => '查看封禁记录', 'reply_notify_subject' => '申诉回复', - 'reply_notify_body' => '你在网站 %s 的申诉有了回复,点此 查看。', + 'reply_notify_body' => '你在网站 %s 的申诉有了回复,点此 查看。', ]; diff --git a/lang/chs/lang_mybonus.php b/lang/chs/lang_mybonus.php index 21bc88aae..823b81e48 100644 --- a/lang/chs/lang_mybonus.php +++ b/lang/chs/lang_mybonus.php @@ -150,7 +150,7 @@ 'official_tag_bonus_additional_factor' => '最终奖励为计算所得官种奖励乘以官种系数,当前官种系数为: ', 'reward_type_official_addition' => '官种加成', 'text_get_by_harem' => '后宫加成每小时将额外得到如下的魔力值', - 'harem_additional_desc' => '后宫只考虑直属后宫。每个后宫加成值可在此查看', + 'harem_additional_desc' => '后宫只考虑直属后宫。每个后宫加成值可在此查看', 'harem_additional_note' => '注意:如果自己不做种,此加成值不会增加到用户账号上', 'harem_additional_factor' => '所得奖励为全部后宫的时魔(不考虑加成)之和,乘以后宫加成系数,当前值为:', 'text_bonus_summary' => '每小时获得的合计魔力值', diff --git a/lang/chs/lang_settings.php b/lang/chs/lang_settings.php index cc7d6ae4e..66301a639 100644 --- a/lang/chs/lang_settings.php +++ b/lang/chs/lang_settings.php @@ -759,7 +759,7 @@ 'submit_misc_settings' => '其他设定', 'text_misc_settings_note' => '配置其他杂项。', 'row_misc_donation_custom' => '捐赠自定义内容', - 'text_donation_custom_note' => '捐赠页自定义的内容,展示于支付宝、PayPal上面。支持 bbcode 标签', + 'text_donation_custom_note' => '捐赠页自定义的内容,展示于支付宝、PayPal上面。支持 bbcode 标签', 'row_approval_status_icon_enabled' => '显示审核状态图标', 'text_approval_status_icon_enabled_note' => "是否在种子列表展示审核状态图标,默认: '否'。", 'row_approval_status_none_visible' => '未审核种子是否可见', diff --git a/lang/cht/lang_complains.php b/lang/cht/lang_complains.php index bccbc8fea..509d36997 100644 --- a/lang/cht/lang_complains.php +++ b/lang/cht/lang_complains.php @@ -28,5 +28,5 @@ 'no_complaints_have_been_processed' => '暫無已處理的申訴', 'text_view_band_log' => '查看封禁記錄', 'reply_notify_subject' => '申訴回復', - 'reply_notify_body' => '你在網站 %s 的申訴有了回復,點此 查看。', + 'reply_notify_body' => '你在網站 %s 的申訴有了回復,點此 查看。', ]; diff --git a/lang/cht/lang_mybonus.php b/lang/cht/lang_mybonus.php index 9232a3b94..ed202b9ec 100644 --- a/lang/cht/lang_mybonus.php +++ b/lang/cht/lang_mybonus.php @@ -150,7 +150,7 @@ 'official_tag_bonus_additional_factor' => '最終獎勵為計算所得官種獎勵乘以官種系數,當前官種系數為: ', 'reward_type_official_addition' => '官種加成', 'text_get_by_harem' => '後宮加成每小時將額外得到如下的魔力值', - 'harem_additional_desc' => '後宮只考慮直屬後宮。每個後宮加成值可在此查看', + 'harem_additional_desc' => '後宮只考慮直屬後宮。每個後宮加成值可在此查看', 'harem_additional_note' => '註意:如果自己不做種,此加成值不會增加到用戶賬號上', 'harem_additional_factor' => '所得獎勵為全部後宮的時魔(不考慮加成)之和,乘以後宮加成系數,當前值為:', 'text_bonus_summary' => '每小時獲得的合計魔力值', diff --git a/lang/cht/lang_settings.php b/lang/cht/lang_settings.php index 773a221c3..19ff39f85 100644 --- a/lang/cht/lang_settings.php +++ b/lang/cht/lang_settings.php @@ -759,7 +759,7 @@ 'submit_misc_settings' => '其他設定', 'text_misc_settings_note' => '配置其他雜項。', 'row_misc_donation_custom' => '捐贈自定義內容', - 'text_donation_custom_note' => '捐贈頁自定義的內容,展示於支付寶、PayPal上面。支持 bbcode 標簽', + 'text_donation_custom_note' => '捐贈頁自定義的內容,展示於支付寶、PayPal上面。支持 bbcode 標簽', 'row_approval_status_icon_enabled' => '顯示審核狀態圖標', 'text_approval_status_icon_enabled_note' => "是否在種子列表展示審核狀態圖標,默認: '否'。", 'row_approval_status_none_visible' => '未審核種子是否可見', diff --git a/lang/en/lang_complains.php b/lang/en/lang_complains.php index 2dfd42544..42a971fbf 100644 --- a/lang/en/lang_complains.php +++ b/lang/en/lang_complains.php @@ -28,5 +28,5 @@ 'no_complaints_have_been_processed' => 'No complaints have been processed', 'text_view_band_log' => 'View ban log', 'reply_notify_subject' => 'Complaint replied', - 'reply_notify_body' => 'You have a reply to your complaint on the site %s, click here to see it.', + 'reply_notify_body' => 'You have a reply to your complaint on the site %s, click here to see it.', ]; diff --git a/lang/en/lang_settings.php b/lang/en/lang_settings.php index 8013f389c..8062a8cfd 100644 --- a/lang/en/lang_settings.php +++ b/lang/en/lang_settings.php @@ -759,7 +759,7 @@ 'submit_misc_settings' => 'Misc settings', 'text_misc_settings_note' => 'Misc settings', 'row_misc_donation_custom' => 'Donation custom', - 'text_donation_custom_note' => 'Donation page custom content, displayed above Alipay, PayPal. Support bbcode tag', + 'text_donation_custom_note' => 'Donation page custom content, displayed above Alipay, PayPal. Support bbcode tag', 'row_approval_status_icon_enabled' => 'Show approval status icon', 'text_approval_status_icon_enabled_note' => "Whether to show the approval status icon in the torrent list, default: 'No'.", 'row_approval_status_none_visible' => 'Visibility of not reviewed torrents', diff --git a/nexus/Install/install/install.php b/nexus/Install/install/install.php index cfbd053dd..08af5202e 100644 --- a/nexus/Install/install/install.php +++ b/nexus/Install/install/install.php @@ -225,7 +225,7 @@
- Welcome to the NexusPHP installer, if you have any questions, clickherefor help. + Welcome to the NexusPHP installer, if you have any questions, clickherefor help.